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