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