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