1 |
|
# |
2 |
|
# Preliminaries |
3 |
|
# |
4 |
+ |
LIBDIR=$(LOCALTOP)/lib/$(SCRAM_ARCH) $(RELEASETOP)/lib/$(SCRAM_ARCH) $(PRIORITY_LIBDIR) |
5 |
+ |
|
6 |
+ |
CXXFLAGS+=$(CXXUSERFLAGS) |
7 |
|
|
8 |
|
# |
9 |
|
# Make sure nobody tries to run this directly through gmake |
13 |
|
endif |
14 |
|
|
15 |
|
|
16 |
+ |
# -- storage of libraries |
17 |
+ |
librarystore:=$(LOCALTOP)/$(INTlib) |
18 |
+ |
|
19 |
+ |
libsavaillocal=$(notdir $(wildcard $(librarystore)/*)) |
20 |
+ |
libsavailbase=$(notdir $(wildcard $(RELEASETOP)/$(INTlib)/*)) |
21 |
+ |
libsavail=$(sort $(libsavailbase) $(libsavaillocal)) |
22 |
+ |
libslocal=$(foreach var,$(lib),$(filter lib$(var).a, $(libsavail))) |
23 |
+ |
libslocal_I=$(foreach var,$(lib_I),$(filter lib$(var).a, $(libsavail))) |
24 |
+ |
libslocal_d=$(foreach var,$(lib_d),$(filter lib$(var).a, $(libsavail))) |
25 |
+ |
|
26 |
|
# |
27 |
|
# Pointing to file storage locations for the various types |
28 |
|
# |
34 |
|
# |
35 |
|
ifdef ReqDependencies |
36 |
|
always:$(LOCALTOP)/$(workdir)/PackageReqs |
37 |
< |
$(LOCALTOP)/$(workdir)/PackageReqs::$(ReqDependencies) |
37 |
> |
$(LOCALTOP)/$(workdir)/PackageReqs:$(ReqDependencies) |
38 |
|
$(TOOL_HOME)/BuildPackageReqs $@ $? |
39 |
|
endif |
40 |
|
|
41 |
+ |
|
42 |
|
# |
43 |
|
# Get local mods |
44 |
|
# |
45 |
|
ifdef LatestBuildFile |
46 |
|
include ${LatestBuildFile} |
47 |
|
endif |
48 |
+ |
|
49 |
|
# |
50 |
|
# get build requirements Class |
51 |
|
# |
53 |
|
include ${DefaultBuildFile} |
54 |
|
endif |
55 |
|
|
56 |
+ |
# |
57 |
+ |
# Group Settings |
58 |
+ |
# |
59 |
+ |
ifdef SCRAM_GROUPSDIR |
60 |
+ |
-include $(SCRAM_GROUPSDIR) |
61 |
+ |
endif |
62 |
+ |
|
63 |
+ |
# Site settings |
64 |
+ |
# |
65 |
+ |
clientmakefile=$(LOCALTOP)/$(INTwork)/clientmakefile |
66 |
+ |
-include $(clientmakefile) |
67 |
|
|
68 |
|
# |
69 |
|
# get build targets |
70 |
|
# |
71 |
+ |
include ${TOOL_HOME}/compilers.mk |
72 |
|
include ${TOOL_HOME}/toolrules.mk |
73 |
|
|
74 |
|
|
75 |
|
# |
76 |
|
# -- Some tool setups which dont yet have a home |
77 |
|
# |
78 |
< |
CPPFLAGS += $(INCLUDEPATH) |
78 |
> |
CPPFLAGS += $(addprefix -I,$(PRIORITY_INCLUDE)) $(INCLUDEPATH) |
79 |
|
|
53 |
– |
# |
54 |
– |
# Site settings |
55 |
– |
# |
56 |
– |
clientmakefile=$(LOCALTOP)/$(INTwork)/clientmakefile |
57 |
– |
include $(clientmakefile) |
80 |
|
|
81 |
|
# |
82 |
|
# now add our includepath |
83 |
|
# |
84 |
|
INCLUDEPATH+=-I$(LOCALTOP)/${INTsrc} -I$(RELEASETOP)/${INTsrc} |
85 |
|
|
86 |
+ |
# |
87 |
+ |
# Dependency information |
88 |
+ |
# |
89 |
+ |
-include dependencies.mk |
90 |
+ |
|
91 |
+ |
#dependencies.mk :: $(clientmakefile) |
92 |
|
# |
93 |
|
# Process Subdirs |
94 |
|
# |
95 |
|
ifdef SUBDIRS |
96 |
|
$(SUBDIRS):: |
97 |
|
@echo ------- Building ---- $@ ----------- |
98 |
< |
cd $(LOCALTOP)/$(THISDIR)/$@; $(TOOL_HOME)/scram build |
98 |
> |
@if [ -d $(LOCALTOP)/$(ClassDir)/$@ ]; then \ |
99 |
> |
cd $(LOCALTOP)/$(ClassDir)/$@; $(TOOL_HOME)/scram build; \ |
100 |
> |
else echo SCRAM Warning : $@ does not exist; \ |
101 |
> |
fi |
102 |
|
endif |
103 |
|
|
73 |
– |
# |
74 |
– |
# clientmakefile creation |
75 |
– |
# |
76 |
– |
$(clientmakefile): $(LOCALTOP)/.SCRAM/${SCRAM_ARCH}/clientsettings $(projdeps) $(TOOL_HOME)/ProcessSiteFile |
77 |
– |
@$(TOOL_HOME)/ProcessSiteFile $< $@ $(projdeps) |
104 |
|
|
105 |
< |
HELPINCLUDEMAKEFILES := ${DefaultBuildFile} ${TOOL_HOME}/toolrules.mk |
105 |
> |
#HELPINCLUDEMAKEFILES := ${DefaultBuildFile} ${TOOL_HOME}/toolrules.mk |
106 |
|
|
107 |
|
# |
108 |
|
# |
112 |
|
dummy: |
113 |
|
|
114 |
|
|
115 |
< |
help: |
116 |
< |
@echo "Available Targets" |
115 |
> |
.PHONY: help clean |
116 |
> |
help:: |
117 |
> |
@echo "--------------------------------------------------------" |
118 |
> |
ifndef BINMODE |
119 |
> |
help:: |
120 |
> |
@echo "General Targets" |
121 |
> |
@echo "---------------" |
122 |
> |
@echo "clean - clean out the corresponding working directory" |
123 |
> |
@echo "echo_VAR - debugging only, prints out the value of the scram variable VAR" |
124 |
|
@echo "-----------------" |
125 |
< |
@cat $(HELPINCLUDEMAKEFILES) | grep ':' | grep -v '^[\%\$$]' | \ |
93 |
< |
grep -v ':=' | grep -v 'vpath' |
125 |
> |
endif |
126 |
|
|
127 |
|
exit: |
128 |
< |
@echo "Please Use the orcabuild script. Do not use gmake directly." |
128 |
> |
@echo "Please Use Scram. Do not use gmake directly." |
129 |
|
@exit 1 |
130 |
|
|
131 |
|
echo_%: |
132 |
|
@echo "$(subst echo_,,$@) = $($(subst echo_,,$@))" |
133 |
|
|
134 |
+ |
|
135 |
+ |
# |
136 |
+ |
# Other non-critical targets |
137 |
+ |
# |
138 |
+ |
|
139 |
+ |
TAGS: |
140 |
+ |
etags -o TAGS $(files) $(binfiles) |
141 |
+ |
|
142 |
+ |
tags: |
143 |
+ |
ctags -o tags $(files) $(binfiles) |
144 |
+ |
|
145 |
+ |
# |
146 |
|
# |
147 |
|
# clean targets |
148 |
|
# |
151 |
|
# it has come through the wrapper script |
152 |
|
|
153 |
|
ifdef DefaultMakefile |
154 |
< |
clean: |
154 |
> |
clean:: |
155 |
|
@echo Cleaning working folder $(workdir) |
156 |
< |
@rm -f $(LOCALTOP)/$(workdir)/* |
156 |
> |
ifdef LOCALTOP |
157 |
> |
ifdef workdir |
158 |
> |
@rm -rf $(LOCALTOP)/$(workdir)/* |
159 |
> |
endif |
160 |
> |
endif |
161 |
|
|
162 |
|
very_clean: |
163 |
|
@echo Cleaning all working folders in $(INTwork) |
164 |
|
@cd $(LOCALTOP)/$(INTwork) |
165 |
< |
@rm -rf $(LOCALTOP)/$(INTwork)/*.o |
165 |
> |
ifdef LOCALTOP |
166 |
> |
ifdef workdir |
167 |
> |
@rm -rf $(LOCALTOP)/$(INTwork)/* |
168 |
|
endif |
169 |
+ |
endif |
170 |
+ |
endif |
171 |
+ |
|
172 |
+ |
# |
173 |
+ |
# datestamp files |
174 |
+ |
# |
175 |
+ |
scramds_%:: |
176 |
+ |
@$(SCRAM_HOME)/src/scramds $*.ds $* |
177 |
+ |
|
178 |
+ |
# |
179 |
+ |
# rather than tracing all the dependency root - just check all local .ds files |
180 |
+ |
# |
181 |
+ |
dsfiles=$(wildcard *.ds) |
182 |
+ |
releasedsfiles=$(wildcard $(RELEASETOP)/$(workdir)/*.ds) |
183 |
+ |
|
184 |
+ |
datestamp :: |
185 |
+ |
@if [ "$(dsfiles)" = "" ]; then \ |
186 |
+ |
if [ "$(releasedsfiles)" != "" ]; then \ |
187 |
+ |
cp $(releasedsfiles) $(LOCALTOP)/$(workdir); \ |
188 |
+ |
fi; \ |
189 |
+ |
fi |
190 |
+ |
|
191 |
+ |
datestamp:: $(addprefix scramds_, $(basename $(dsfiles))) |