f0a26826 |
1 | |
f347de98 |
2 | |
f0a26826 |
3 | ifndef PACKFFLAGS |
4 | @PACKAGE@FFLAGS:=$(FFLAGS) |
5 | else |
6 | @PACKAGE@FFLAGS:=$(PACKFFLAGS) |
7 | endif |
8 | |
9 | ifndef PACKCFLAGS |
10 | @PACKAGE@CFLAGS:=$(CFLAGS) |
11 | else |
12 | @PACKAGE@CFLAGS:=$(PACKCFLAGS) |
13 | endif |
14 | |
15 | ifndef PACKCXXFLAGS |
16 | @PACKAGE@CXXFLAGS:=$(CXXFLAGS) |
17 | else |
18 | @PACKAGE@CXXFLAGS:=$(PACKCXXFLAGS) |
19 | endif |
20 | |
810722e6 |
21 | ifndef PACKDCXXFLAGS |
22 | ifeq ($(PLATFORM),linuxicc) |
23 | @PACKAGE@DCXXFLAGS:=$(filter-out -O%,$(CXXFLAGS)) -O0 |
24 | else |
25 | @PACKAGE@DCXXFLAGS:=$(filter-out -O%,$(CXXFLAGS)) |
26 | endif |
27 | else |
28 | @PACKAGE@DCXXFLAGS:=$(PACKCXXFLAGS) |
29 | endif |
30 | |
f0a26826 |
31 | |
32 | ifdef DHDR |
33 | WITHDICT=YES |
34 | else |
35 | WITHDICT= |
36 | endif |
37 | |
f347de98 |
38 | # Headerfiles exported to common place: |
39 | @PACKAGE@EXPORT:=$(EXPORT) |
40 | @PACKAGE@EXPORTDEST:=$(patsubst %,$(EXPORTDIR)/%,$(EXPORT)) |
41 | |
42 | |
67fd7264 |
43 | #Extra include,libs, defines etc. |
44 | |
45 | @PACKAGE@DEFINE:=$(EDEFINE) |
f347de98 |
46 | |
47 | @PACKAGE@INC:=$(patsubst %,-I%,$(EINCLUDE)) -I@MODULE@ |
48 | |
f0a26826 |
49 | @PACKAGE@ELIBS:=$(patsubst %,-l%,$(ELIBS)) |
50 | @PACKAGE@ELIBSDIR:=$(patsubst %,-L%,$(ELIBSDIR)) |
51 | |
52 | #c sources and headers |
53 | |
54 | @PACKAGE@CS:=$(patsubst %,$(MODDIR)/%,$(CSRCS)) |
55 | @PACKAGE@CH:=$(patsubst %,$(MODDIR)/%,$(CHDRS)) |
56 | |
57 | #Fortran sources |
58 | @PACKAGE@FS:=$(patsubst %,$(MODDIR)/%,$(FSRCS)) |
59 | |
60 | #c++ sources and header |
61 | @PACKAGE@S:=$(patsubst %,$(MODDIR)/%,$(SRCS)) |
f347de98 |
62 | @PACKAGE@H:=$(patsubst %,$(MODDIR)/%,$(HDRS)) $(EHDRS) |
63 | |
64 | ############################################################################# |
65 | # |
66 | # If special rootcint headerfiles is specified use them |
67 | # else use all headers |
f0a26826 |
68 | |
f347de98 |
69 | ifndef CINTHDRS |
70 | @PACKAGE@CINTHDRS:=$(@PACKAGE@H) |
71 | else |
72 | @PACKAGE@CINTHDRS:=$(CINTHDRS) |
73 | endif |
74 | ############################################################################# |
f0a26826 |
75 | |
76 | # Package Dictionary |
77 | |
78 | @PACKAGE@DH:=$(MODDIR)/$(DHDR) |
79 | |
80 | |
81 | #All objects |
82 | @PACKAGE@CO:=$(patsubst %,$(MODDIRO)/%, $(CSRCS:.c=.o)) |
83 | TEMP:=$(FSRCS:.F=.o) |
84 | @PACKAGE@FO:=$(patsubst %,$(MODDIRO)/%, $(TEMP:.f=.o)) |
85 | @PACKAGE@O:= $(patsubst %,$(MODDIRO)/%, $(SRCS:.cxx=.o)) $(@PACKAGE@FO) $(@PACKAGE@CO) |
86 | |
d47d6108 |
87 | |
88 | |
f0a26826 |
89 | ifdef WITHDICT |
90 | @PACKAGE@DS:=$(MODDIRO)/G__@PACKAGE@.cxx |
91 | @PACKAGE@DO:=$(MODDIRO)/G__@PACKAGE@.o |
92 | @PACKAGE@DDEP:=$(@PACKAGE@DO:.o=.d) |
93 | @PACKAGE@DEP:=$(@PACKAGE@O:.o=.d) $(@PACKAGE@DDEP) |
94 | else |
95 | @PACKAGE@DS:= |
96 | @PACKAGE@DO:= |
97 | @PACKAGE@DDEP:= |
98 | @PACKAGE@DEP:=$(@PACKAGE@O:.o=.d) |
99 | endif |
100 | |
101 | |
102 | #The actual library file |
103 | |
104 | @PACKAGE@LIB:=$(LIBPATH)/lib@PACKAGE@.$(SOEXT) |
40c469d5 |
105 | |
106 | ifneq ($(DYEXT),) |
107 | @PACKAGE@DLIB:=$(LIBPATH)/lib@PACKAGE@.$(DYEXT) |
108 | endif |
109 | |
2d8cad5a |
110 | @PACKAGE@ALIB:=$(LIBPATH)/lib@PACKAGE@.$(AEXT) |
f0a26826 |
111 | |
d47d6108 |
112 | #Add this to the modules libs |
113 | @MODULE@LIBS += $(@PACKAGE@LIB) |
2d8cad5a |
114 | @MODULE@ALIBS += $(@PACKAGE@ALIB) |
40c469d5 |
115 | ifneq ($(DYEXT),) |
116 | @MODULE@DLIBS += $(@PACKAGE@DLIB) |
117 | endif |
d47d6108 |
118 | |
f0a26826 |
119 | #The actual binary file |
120 | |
121 | @PACKAGE@BIN:=$(BINPATH)/@PACKAGE@ |
122 | |
d47d6108 |
123 | #Add to modules list of binaries |
124 | @MODULE@BINS += $(@PACKAGE@BIN) |
f0a26826 |
125 | |
f347de98 |
126 | # Use in the main Makefile |
f0a26826 |
127 | |
128 | ifeq ($(TYPE),lib) |
129 | ALLLIBS += $(@PACKAGE@LIB) |
2d8cad5a |
130 | ALLALIBS += $(@PACKAGE@ALIB) |
40c469d5 |
131 | ifneq ($(DYEXT),) |
132 | ALLLIBS += $(@PACKAGE@DLIB) |
133 | endif |
f0a26826 |
134 | BINLIBS += -l@PACKAGE@ |
135 | else |
136 | ALLEXECS += $(@PACKAGE@BIN) |
137 | endif |
138 | |
40c469d5 |
139 | ifeq ($(DYEXT),) |
140 | @PACKAGE@LIB := $(@PACKAGE@LIB) |
141 | else |
142 | @PACKAGE@LIB := $(@PACKAGE@LIB) |
143 | endif |
144 | |
f0a26826 |
145 | # include all dependency files |
146 | INCLUDEFILES +=$(@PACKAGE@DEP) |
147 | |
f347de98 |
148 | EXPORTFILES += $(@PACKAGE@EXPORTDEST) |
f0a26826 |
149 | |
150 | #local rules |
151 | |
f347de98 |
152 | #The exportfiles only include if any!! |
153 | |
154 | ifdef @PACKAGE@EXPORT |
896cb507 |
155 | #$(@PACKAGE@EXPORTDEST): $(patsubst %,@MODULE@/%,$(@PACKAGE@EXPORT)) |
156 | |
157 | $(@PACKAGE@EXPORTDEST): $(EXPORTDIR)/%.h: @MODULE@/%.h |
15142e2f |
158 | ifndef ALIQUIET |
ba419e66 |
159 | @echo "***** Copying file $^ to $@ *****" |
15142e2f |
160 | endif |
f347de98 |
161 | @[ -d $(dir $@) ] || mkdir $(dir $@) |
ba419e66 |
162 | @cp $^ $@ |
f347de98 |
163 | endif |
164 | |
f0a26826 |
165 | $(@PACKAGE@LIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk |
15142e2f |
166 | ifndef ALIQUIET |
f0a26826 |
167 | @echo "***** Linking library $@ *****" |
15142e2f |
168 | endif |
faeab8a4 |
169 | $(MUTE)TMPDIR=/tmp/@MODULE@$$$$.`date +%M%S` ; \ |
170 | export TMPDIR; mkdir $$TMPDIR ; cd $$TMPDIR ; \ |
171 | find $(CURDIR)/@MODULE@/tgt_$(ALICE_TARGET) -name '*.o' -exec ln -s {} . \; ;\ |
631ac73d |
172 | rm -f $(CURDIR)/$@ ;\ |
b9d0a01d |
173 | $(SHLD) $(SOFLAGS) -o $(CURDIR)/$@ $(notdir $(@PACKAGE@O) $(@PACKAGE@DO)) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(SHLIB);\ |
72b9e86f |
174 | cd $(CURDIR) ; rm -rf $$TMPDIR |
f3a14d41 |
175 | $(MUTE)chmod a-w $@ |
810722e6 |
176 | |
40c469d5 |
177 | ifneq ($(DYEXT),) |
178 | $(@PACKAGE@DLIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk |
179 | ifndef ALIQUIET |
180 | @echo "***** Linking library $@ *****" |
181 | endif |
182 | $(MUTE)TMPDIR=/tmp/@MODULE@$$$$.`date +%M%S` ; \ |
183 | export TMPDIR; mkdir $$TMPDIR ; cd $$TMPDIR ; \ |
184 | find $(CURDIR)/@MODULE@/tgt_$(ALICE_TARGET) -name '*.o' -exec ln -s {} . \; ;\ |
185 | rm -f $(CURDIR)/$@ ;\ |
186 | $(DYLD) $(@PACKAGE@DYFLAGS) -o $(CURDIR)/$@ $(notdir $(@PACKAGE@O) $(@PACKAGE@DO)) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(DYLIB); |
187 | $(MUTE)chmod a-w $(CURDIR)/$@ ;\ |
188 | rm -rf $$TMPDIR |
189 | endif |
190 | |
2d8cad5a |
191 | $(@PACKAGE@ALIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk |
192 | ifndef ALIQUIET |
193 | @echo "***** Linking static library $@ *****" |
194 | endif |
195 | $(MUTE)TMPDIR=/tmp/@MODULE@$$$$.`date +%M%S` ; \ |
196 | export TMPDIR; mkdir $$TMPDIR ; cd $$TMPDIR ; \ |
197 | find $(CURDIR)/@MODULE@/tgt_$(ALICE_TARGET) -name '*.o' -exec ln -s {} . \; ;\ |
198 | rm -f $(CURDIR)/$@ ;\ |
199 | $(ALLD) $(ALFLAGS) $(CURDIR)/$@ $(notdir $(@PACKAGE@O) $(@PACKAGE@DO)) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(ALLIB);\ |
200 | cd $(CURDIR) ; rm -rf $$TMPDIR |
201 | $(MUTE)chmod a-w $@ |
202 | |
203 | |
f0a26826 |
204 | $(@PACKAGE@BIN):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk |
15142e2f |
205 | ifndef ALIQUIET |
206 | @echo "***** Making executable $@ *****" |
207 | endif |
2d8cad5a |
208 | ifeq ($(ALIPROFILE),YES) |
2d8cad5a |
209 | $(MUTE)$(LD) $(LDFLAGS) $(@PACKAGE@O) $(ARLIBS) $(SHLIBS) $(LIBS) $(EXEFLAGS) -o $@ |
2d8cad5a |
210 | else |
211 | $(MUTE)$(LD) $(LDFLAGS) $(@PACKAGE@O) $(@PACKAGE@DO) $(BINLIBDIRS) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(LIBS) $(EXEFLAGS) -o $@ |
212 | endif |
f0a26826 |
213 | |
6bb8c070 |
214 | $(@PACKAGE@DS): $(@PACKAGE@CINTHDRS) $(@PACKAGE@DH) @MODULE@/module.mk |
15142e2f |
215 | ifndef ALIQUIET |
f0a26826 |
216 | @echo "***** Creating $@ *****"; |
15142e2f |
217 | endif |
f0a26826 |
218 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) |
5af243da |
219 | @rm -f $(patsubst %.cxx,%.d, $@) |
67fd7264 |
220 | $(MUTE)rootcint -f $@ -c $(@PACKAGE@DEFINE) $(CINTFLAGS) $(@PACKAGE@INC) $(@PACKAGE@CINTHDRS) $(@PACKAGE@DH) |
f0a26826 |
221 | |
222 | $(@PACKAGE@DO): $(@PACKAGE@DS) |
15142e2f |
223 | ifndef ALIQUIET |
224 | @echo "***** Compiling $< *****"; |
225 | endif |
810722e6 |
226 | $(MUTE)$(CXX) -c $(@PACKAGE@INC) -I$(ALICE_ROOT) $< -o $@ $(@PACKAGE@DCXXFLAGS) |
f0a26826 |
227 | |
228 | #Different targets for the module |
229 | |
5edd655b |
230 | ifeq ($(TYPE),lib) |
5864aa62 |
231 | all-@PACKAGE@: $(@PACKAGE@LIB) |
40c469d5 |
232 | ifneq ($(DYEXT),) |
233 | all-@PACKAGE@: $(@PACKAGE@DLIB) |
234 | endif |
5edd655b |
235 | else |
236 | all-@PACKAGE@: $(@PACKAGE@BIN) |
237 | endif |
238 | |
f0a26826 |
239 | depend-@PACKAGE@: $(@PACKAGE@DEP) |
240 | |
241 | # determination of object files |
82910ea7 |
242 | $(MODDIRO)/%.o: $(MODDIRO)/%.cxx $(MODDIRO)/%.d |
243 | ifndef ALIQUIET |
244 | @echo "***** Compiling $< *****"; |
245 | endif |
246 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) |
247 | $(MUTE)$(CXX) $(@PACKAGE@DEFINE) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@CXXFLAGS) |
248 | |
f0a26826 |
249 | $(MODDIRO)/%.o: $(MODDIR)/%.cxx $(MODDIRO)/%.d |
15142e2f |
250 | ifndef ALIQUIET |
251 | @echo "***** Compiling $< *****"; |
252 | endif |
f0a26826 |
253 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) |
67fd7264 |
254 | $(MUTE)$(CXX) $(@PACKAGE@DEFINE) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@CXXFLAGS) |
f0a26826 |
255 | |
256 | $(MODDIRO)/%.o: $(MODDIR)/%.F $(MODDIRO)/%.d |
15142e2f |
257 | ifndef ALIQUIET |
258 | @echo "***** Compiling $< *****"; |
259 | endif |
f0a26826 |
260 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) |
15142e2f |
261 | $(MUTE)$(F77) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@FFLAGS) |
f0a26826 |
262 | |
263 | $(MODDIRO)/%.o: $(MODDIR)/%.f $(MODDIRO)/%.d |
15142e2f |
264 | ifndef ALIQUIET |
265 | @echo "***** Compiling $< *****"; |
266 | endif |
f0a26826 |
267 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) |
15142e2f |
268 | $(MUTE)$(F77) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@FFLAGS) |
f0a26826 |
269 | |
270 | $(MODDIRO)/%.o: $(MODDIR)/%.c $(MODDIRO)/%.d |
15142e2f |
271 | ifndef ALIQUIET |
272 | @echo "***** Compiling $< *****"; |
273 | endif |
f0a26826 |
274 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) |
67fd7264 |
275 | $(MUTE)$(CC) $(@PACKAGE@DEFINE) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@CFLAGS) |
f0a26826 |
276 | |
277 | $(@PACKAGE@DDEP): $(@PACKAGE@DS) |
15142e2f |
278 | ifndef ALIQUIET |
f0a26826 |
279 | @echo "***** Making dependencies for $< *****"; |
15142e2f |
280 | endif |
f0a26826 |
281 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) |
282 | @share/alibtool depend "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@ |
283 | |
d47d6108 |
284 | $(MODDIRO)/%.d: $(MODDIRS)/%.cxx |
15142e2f |
285 | ifndef ALIQUIET |
f0a26826 |
286 | @echo "***** Making dependencies for $< *****"; |
15142e2f |
287 | endif |
f0a26826 |
288 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) |
67fd7264 |
289 | @share/alibtool depend "$(@PACKAGE@DEFINE) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@ |
896cb507 |
290 | $(MODDIRO)/%.d: $(MODDIRS)/%.f |
15142e2f |
291 | ifndef ALIQUIET |
f0a26826 |
292 | @echo "***** Making dependencies for $< *****"; |
15142e2f |
293 | endif |
f0a26826 |
294 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) |
896cb507 |
295 | @share/alibtool dependF "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@ |
296 | $(MODDIRO)/%.d: $(MODDIRS)/%.F |
15142e2f |
297 | ifndef ALIQUIET |
f0a26826 |
298 | @echo "***** Making dependencies for $< *****"; |
15142e2f |
299 | endif |
f0a26826 |
300 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) |
15142e2f |
301 | $(MUTE)share/alibtool dependF "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@ |
896cb507 |
302 | $(MODDIRO)/%.d: $(MODDIRS)/%.c |
15142e2f |
303 | ifndef ALIQUIET |
f0a26826 |
304 | @echo "***** Making dependencies for $< *****"; |
15142e2f |
305 | endif |
f0a26826 |
306 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) |
67fd7264 |
307 | @share/alibtool depend "$(@PACKAGE@DEFINE) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@ |
b9d0a01d |
308 | |
309 | @PACKAGE@CHECKS := $(patsubst %.cxx,@PACKAGE@/check/%.viol,$(SRCS)) |
310 | |
311 | check-@PACKAGE@: $(@PACKAGE@CHECKS) |
312 | |
313 | # IRST coding rule check |
314 | @PACKAGE@/check/%.i : @PACKAGE@/%.cxx |
315 | @[ -d $(dir $@) ] || mkdir -p $(dir $@) |
316 | $(MUTE)$(CXX) -E $(@PACKAGE@DEFINE) $(@PACKAGE@INC) $< > $@ $(@PACKAGE@CXXFLAGS) |
317 | @cd $(dir $@) ; $(IRST_INSTALLDIR)/patch/patch4alice.prl $(notdir $@) |
318 | |
319 | # IRST coding rule check |
320 | @PACKAGE@/check/%.viol : @PACKAGE@/check/%.i |
321 | @cd @PACKAGE@ ; [ -r @PACKAGE@ ] || ln -s ../@PACKAGE@ @PACKAGE@ |
322 | -@echo $@ ; $(CODE_CHECK) $< ./@PACKAGE@ > $@ |
323 | |
324 | @PACKAGE@PREPROC = $(patsubst %.viol,%.i,$(@PACKAGE@CHECKS)) |
325 | |
326 | @PACKAGE@REVENGS = $(patsubst %.viol,%.ii,$(@PACKAGE@CHECKS)) |
327 | |
328 | .SECONDARY: $(@PACKAGE@REVENGS) $(@PACKAGE@PREPROC) |
329 | |
330 | reveng-@PACKAGE@: @PACKAGE@/check/classDiagram.dot |
331 | |
332 | @PACKAGE@/check/classDiagram.dot: $(@PACKAGE@PREPROC) |
333 | @$(REV_ENG) $^ |
334 | @-mv classDiagram.dot $@ |
335 | |
336 | revdisp-@PACKAGE@: reveng-@PACKAGE@ |
337 | @echo revdisp for @PACKAGE@ |
338 | @cd @PACKAGE@/check ; \ |
339 | $(IRST_INSTALLDIR)/webreveng/create-class-diagram-pages.sh |
340 | @sed -e "s/\@PACKAGE\@/@PACKAGE@/g" < $(ALICE_ROOT)/build/HomePage.html > @PACKAGE@/check/HomePage.html |
341 | |