]>
Commit | Line | Data |
---|---|---|
1 | ||
2 | ||
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 | ||
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 | ||
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 | ||
45 | ||
46 | ifdef DHDR | |
47 | WITHDICT=YES | |
48 | else | |
49 | WITHDICT= | |
50 | endif | |
51 | ||
52 | # Headerfiles exported to common place: | |
53 | @PACKAGE@EXPORT:=$(EXPORT) | |
54 | @PACKAGE@EXPORTDEST:=$(patsubst %,$(EXPORTDIR)/%,$(EXPORT)) | |
55 | ||
56 | ||
57 | #Extra include,libs, defines etc. | |
58 | ||
59 | @PACKAGE@DEFINE:=$(EDEFINE) | |
60 | ||
61 | @PACKAGE@INC:=$(patsubst %,-I%,$(EINCLUDE)) -I@MODULE@ | |
62 | ||
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)) | |
76 | @PACKAGE@H:=$(patsubst %,$(MODDIR)/%,$(HDRS)) $(EHDRS) | |
77 | ||
78 | ############################################################################# | |
79 | # | |
80 | # If special rootcint headerfiles is specified use them | |
81 | # else use all headers | |
82 | ||
83 | ifndef CINTHDRS | |
84 | @PACKAGE@CINTHDRS:=$(@PACKAGE@H) | |
85 | else | |
86 | @PACKAGE@CINTHDRS:=$(CINTHDRS) | |
87 | endif | |
88 | ############################################################################# | |
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 | ||
101 | ||
102 | ||
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) | |
119 | ||
120 | ifneq ($(DYEXT),) | |
121 | @PACKAGE@DLIB:=$(LIBPATH)/lib@PACKAGE@.$(DYEXT) | |
122 | endif | |
123 | ||
124 | @PACKAGE@ALIB:=$(LIBPATH)/lib@PACKAGE@.$(AEXT) | |
125 | ||
126 | #Add this to the modules libs | |
127 | @MODULE@LIBS += $(@PACKAGE@LIB) | |
128 | @MODULE@ALIBS += $(@PACKAGE@ALIB) | |
129 | ifneq ($(DYEXT),) | |
130 | @MODULE@DLIBS += $(@PACKAGE@DLIB) | |
131 | endif | |
132 | ||
133 | #The actual binary file | |
134 | ||
135 | @PACKAGE@BIN:=$(BINPATH)/@PACKAGE@ | |
136 | ||
137 | #Add to modules list of binaries | |
138 | @MODULE@BINS += $(@PACKAGE@BIN) | |
139 | ||
140 | # Use in the main Makefile | |
141 | ||
142 | ifeq ($(TYPE),lib) | |
143 | ALLLIBS += $(@PACKAGE@LIB) | |
144 | ALLALIBS += $(@PACKAGE@ALIB) | |
145 | ifneq ($(DYEXT),) | |
146 | ALLLIBS += $(@PACKAGE@DLIB) | |
147 | endif | |
148 | BINLIBS += -l@PACKAGE@ | |
149 | else | |
150 | ALLEXECS += $(@PACKAGE@BIN) | |
151 | endif | |
152 | ||
153 | ifeq ($(DYEXT),) | |
154 | @PACKAGE@LIB := $(@PACKAGE@LIB) | |
155 | else | |
156 | @PACKAGE@LIB := $(@PACKAGE@LIB) | |
157 | endif | |
158 | ||
159 | # include all dependency files | |
160 | INCLUDEFILES +=$(@PACKAGE@DEP) | |
161 | ||
162 | EXPORTFILES += $(@PACKAGE@EXPORTDEST) | |
163 | ||
164 | #local rules | |
165 | ||
166 | #The exportfiles only include if any!! | |
167 | ||
168 | ifdef @PACKAGE@EXPORT | |
169 | #$(@PACKAGE@EXPORTDEST): $(patsubst %,@MODULE@/%,$(@PACKAGE@EXPORT)) | |
170 | ||
171 | $(@PACKAGE@EXPORTDEST): $(EXPORTDIR)/%.h: @MODULE@/%.h | |
172 | ifndef ALIQUIET | |
173 | @echo "***** Copying file $^ to $@ *****" | |
174 | endif | |
175 | @[ -d $(dir $@) ] || mkdir $(dir $@) | |
176 | @cp $^ $@ | |
177 | endif | |
178 | ||
179 | #------------------------------------------------------------------------ | |
180 | ||
181 | $(@PACKAGE@LIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk | |
182 | ifndef ALIQUIET | |
183 | @echo "***** Linking library $@ *****" | |
184 | endif | |
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 {} . \; ;\ | |
188 | rm -f $(CURDIR)/$@ ;\ | |
189 | TMPLIB=$(notdir $(@PACKAGE@LIB)); export TMPLIB;\ | |
190 | $(SHLD) $(@PACKAGE@SOFLAGS) -o $(CURDIR)/$@ $(notdir $(@PACKAGE@O) $(@PACKAGE@DO)) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(SHLIB);\ | |
191 | chmod a-w $(CURDIR)/$@ ;\ | |
192 | cd $(ALICE_ROOT) ; \rm -rf $$TMPDIR | |
193 | ||
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)/$@ ;\ | |
203 | $(DYLD) $(@PACKAGE@DYFLAGS) -o $(CURDIR)/$@ $(notdir $(@PACKAGE@O) $(@PACKAGE@DO)) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(DYLIB);\ | |
204 | chmod a-w $(CURDIR)/$@ ;\ | |
205 | cd $(ALICE_ROOT) ; \rm -rf $$TMPDIR | |
206 | endif | |
207 | ||
208 | #------------------------------------------------------------------------ | |
209 | ||
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)/$@ ;\ | |
218 | $(ALLD) $(ALFLAGS) $(CURDIR)/$@ $(notdir $(@PACKAGE@O)) $(notdir @PACKAGE@DO) $(ALLIB);\ | |
219 | cd $(CURDIR) ; rm -rf $$TMPDIR | |
220 | $(MUTE)chmod a-w $@ | |
221 | ||
222 | ||
223 | $(@PACKAGE@BIN):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk | |
224 | ifndef ALIQUIET | |
225 | @echo "***** Making executable $@ *****" | |
226 | endif | |
227 | ifeq ($(ALIPROFILE),YES) | |
228 | $(MUTE)$(LD) $(LDFLAGS) $(@PACKAGE@O) $(ARLIBS) $(SHLIBS) $(LIBS) $(EXEFLAGS) -o $@ | |
229 | else | |
230 | $(MUTE)$(LD) $(LDFLAGS) $(@PACKAGE@O) $(@PACKAGE@DO) $(BINLIBDIRS) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(LIBS) $(EXEFLAGS) -o $@ | |
231 | endif | |
232 | ||
233 | $(@PACKAGE@DS): $(@PACKAGE@CINTHDRS) $(@PACKAGE@DH) @MODULE@/module.mk | |
234 | ifndef ALIQUIET | |
235 | @echo "***** Creating $@ *****"; | |
236 | endif | |
237 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) | |
238 | $(MUTE)rootcint -f $@ -c $(@PACKAGE@DEFINE) $(CINTFLAGS) $(@PACKAGE@INC) $(@PACKAGE@CINTHDRS) $(@PACKAGE@DH) | |
239 | ||
240 | $(@PACKAGE@DO): $(@PACKAGE@DS) | |
241 | ifndef ALIQUIET | |
242 | @echo "***** Compiling $< *****"; | |
243 | endif | |
244 | $(MUTE)$(CXX) -c $(@PACKAGE@INC) -I$(ALICE_ROOT) $< -o $@ $(@PACKAGE@DCXXFLAGS) | |
245 | ||
246 | #Different targets for the module | |
247 | ||
248 | ifeq ($(TYPE),lib) | |
249 | all-@PACKAGE@: $(@PACKAGE@LIB) | |
250 | ifneq ($(DYEXT),) | |
251 | all-@PACKAGE@: $(@PACKAGE@DLIB) | |
252 | endif | |
253 | else | |
254 | all-@PACKAGE@: $(@PACKAGE@BIN) | |
255 | endif | |
256 | ||
257 | depend-@PACKAGE@: $(@PACKAGE@DEP) | |
258 | ||
259 | # determination of object files | |
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 | ||
267 | $(MODDIRO)/%.o: $(MODDIR)/%.cxx $(MODDIRO)/%.d | |
268 | ifndef ALIQUIET | |
269 | @echo "***** Compiling $< *****"; | |
270 | endif | |
271 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) | |
272 | $(MUTE)$(CXX) $(@PACKAGE@DEFINE) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@CXXFLAGS) | |
273 | ||
274 | $(MODDIRO)/%.o: $(MODDIR)/%.F $(MODDIRO)/%.d | |
275 | ifndef ALIQUIET | |
276 | @echo "***** Compiling $< *****"; | |
277 | endif | |
278 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) | |
279 | $(MUTE)$(F77) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@FFLAGS) | |
280 | ||
281 | $(MODDIRO)/%.o: $(MODDIR)/%.f $(MODDIRO)/%.d | |
282 | ifndef ALIQUIET | |
283 | @echo "***** Compiling $< *****"; | |
284 | endif | |
285 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) | |
286 | $(MUTE)$(F77) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@FFLAGS) | |
287 | ||
288 | $(MODDIRO)/%.o: $(MODDIR)/%.c $(MODDIRO)/%.d | |
289 | ifndef ALIQUIET | |
290 | @echo "***** Compiling $< *****"; | |
291 | endif | |
292 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) | |
293 | $(MUTE)$(CC) $(@PACKAGE@DEFINE) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@CFLAGS) | |
294 | ||
295 | $(@PACKAGE@DDEP): $(@PACKAGE@DS) | |
296 | ifndef ALIQUIET | |
297 | @echo "***** Making dependencies for $< *****"; | |
298 | endif | |
299 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) | |
300 | @share/alibtool depend "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@ | |
301 | ||
302 | $(MODDIRO)/%.d: $(MODDIRS)/%.cxx | |
303 | ifndef ALIQUIET | |
304 | @echo "***** Making dependencies for $< *****"; | |
305 | endif | |
306 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) | |
307 | @share/alibtool depend "$(@PACKAGE@DEFINE) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@ | |
308 | $(MODDIRO)/%.d: $(MODDIRS)/%.f | |
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 dependF "$(@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 | $(MUTE)share/alibtool dependF "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@ | |
320 | $(MODDIRO)/%.d: $(MODDIRS)/%.c | |
321 | ifndef ALIQUIET | |
322 | @echo "***** Making dependencies for $< *****"; | |
323 | endif | |
324 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) | |
325 | @share/alibtool depend "$(@PACKAGE@DEFINE) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@ | |
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 |