libpthread is now need by root 5-17/04
[u/mrichter/AliRoot.git] / build / module.tpl
CommitLineData
117cfc60 1#-*- Mode: Makefile -*-
f0a26826 2
f347de98 3
f0a26826 4ifndef PACKFFLAGS
5@PACKAGE@FFLAGS:=$(FFLAGS)
6else
7@PACKAGE@FFLAGS:=$(PACKFFLAGS)
8endif
9
10ifndef PACKCFLAGS
11@PACKAGE@CFLAGS:=$(CFLAGS)
12else
13@PACKAGE@CFLAGS:=$(PACKCFLAGS)
14endif
15
16ifndef PACKCXXFLAGS
17@PACKAGE@CXXFLAGS:=$(CXXFLAGS)
18else
19@PACKAGE@CXXFLAGS:=$(PACKCXXFLAGS)
20endif
21
88cb7938 22ifndef PACKSOFLAGS
23@PACKAGE@SOFLAGS:=$(SOFLAGS)
24else
25@PACKAGE@SOFLAGS:=$(PACKSOFLAGS)
26endif
27
28ifdef DYEXT
29ifndef PACKDYFLAGS
30@PACKAGE@DYFLAGS:=$(DYFLAGS)
31else
32@PACKAGE@DYFLAGS:=$(PACKDYFLAGS)
33endif
34endif
35
651e35f1 36ifndef PACKLDFLAGS
37@PACKAGE@LDFLAGS:=$(LDFLAGS)
38else
39@PACKAGE@LDFLAGS:=$(PACKLDFLAGS)
40endif
41
810722e6 42ifndef PACKDCXXFLAGS
19ca05d1 43@PACKAGE@DCXXFLAGS:=$(CXXFLAGSNO)
810722e6 44else
117cfc60 45@PACKAGE@DCXXFLAGS:=$(PACKDCXXFLAGS)
810722e6 46endif
47
de6c7cfd 48ifndef PACKBLIBS
49@PACKAGE@BLIBS:=$(LIBS)
50else
51@PACKAGE@BLIBS:=$(PACKBLIBS)
52endif
53
216d9f87 54WITHDICT=
55ifneq ($(DHDR),)
f0a26826 56WITHDICT=YES
57else
216d9f87 58ifneq ($(CINTAUTOLINK),)
59WITHDICT=YES
60endif
f0a26826 61endif
62
f347de98 63# Headerfiles exported to common place:
64@PACKAGE@EXPORT:=$(EXPORT)
65@PACKAGE@EXPORTDEST:=$(patsubst %,$(EXPORTDIR)/%,$(EXPORT))
66
67
67fd7264 68#Extra include,libs, defines etc.
69
eb5bc777 70@PACKAGE@DEFINE:=$(EDEFINE) -D_MODULE_=\"@MODULE@\"
f347de98 71
72@PACKAGE@INC:=$(patsubst %,-I%,$(EINCLUDE)) -I@MODULE@
73
f0a26826 74@PACKAGE@ELIBS:=$(patsubst %,-l%,$(ELIBS))
87c71321 75@PACKAGE@ELIBSDEP:=$(patsubst %,lib/tgt_$(ALICE_TARGET)/lib%.$(SOEXT),$(ELIBS))
f0a26826 76@PACKAGE@ELIBSDIR:=$(patsubst %,-L%,$(ELIBSDIR))
77
78#c sources and headers
79
80@PACKAGE@CS:=$(patsubst %,$(MODDIR)/%,$(CSRCS))
81@PACKAGE@CH:=$(patsubst %,$(MODDIR)/%,$(CHDRS))
82
83#Fortran sources
84@PACKAGE@FS:=$(patsubst %,$(MODDIR)/%,$(FSRCS))
85
86#c++ sources and header
87@PACKAGE@S:=$(patsubst %,$(MODDIR)/%,$(SRCS))
f347de98 88@PACKAGE@H:=$(patsubst %,$(MODDIR)/%,$(HDRS)) $(EHDRS)
89
90#############################################################################
91#
92# If special rootcint headerfiles is specified use them
93# else use all headers
f0a26826 94
f347de98 95ifndef CINTHDRS
ce917c76 96@PACKAGE@CINTHDRS:=$(@PACKAGE@H)
f347de98 97else
216d9f87 98@PACKAGE@CINTHDRS:=$(CINTHDRS:%=@MODULE@/%)
2bf97326 99#@PACKAGE@CINTHDRS:=$(pathsubst %,@MODULE@/%,$(CINTHDRS))
f347de98 100endif
2bf97326 101@PACKAGE@CINTCLASSES:=$(patsubst %.h,%,$(notdir $(@PACKAGE@CINTHDRS)))
f347de98 102#############################################################################
f0a26826 103
104# Package Dictionary
216d9f87 105ifneq ($(DHDR),)
f0a26826 106@PACKAGE@DH:=$(MODDIR)/$(DHDR)
216d9f87 107else
108@PACKAGE@DH:=
109endif
110ifneq ($(CINTAUTOLINK),)
111@PACKAGE@DAL:=$(MODDIRO)/G__@PACKAGE@AutoLinkDef.h
112@PACKAGE@DH+=$(@PACKAGE@DAL)
113endif
f0a26826 114
f0a26826 115#All objects
521bebb4 116@PACKAGE@CXXO:=$(patsubst %,$(MODDIRO)/%, $(SRCS:.cxx=.o))
f0a26826 117@PACKAGE@CO:=$(patsubst %,$(MODDIRO)/%, $(CSRCS:.c=.o))
521bebb4 118@PACKAGE@SMALLFO:=$(patsubst %.f,$(MODDIRO)/%.o, $(filter %.f, $(FSRCS)))
119@PACKAGE@CAPITFO:=$(patsubst %.F,$(MODDIRO)/%.o, $(filter %.F, $(FSRCS)))
120@PACKAGE@FO:=$(@PACKAGE@SMALLFO) $(@PACKAGE@CAPITFO)
121@PACKAGE@O:= $(@PACKAGE@CXXO) $(@PACKAGE@FO) $(@PACKAGE@CO)
da1b5393 122@PACKAGE@CHV:=$(patsubst %,$(MODDIRC)/%, $(SRCS:.cxx=.viol))
123@PACKAGE@SML:=$(patsubst %,$(MODDIRZ)/%, $(SRCS:.cxx=.smell))
f0a26826 124
d47d6108 125
126
f0a26826 127ifdef WITHDICT
128 @PACKAGE@DS:=$(MODDIRO)/G__@PACKAGE@.cxx
129 @PACKAGE@DO:=$(MODDIRO)/G__@PACKAGE@.o
130 @PACKAGE@DDEP:=$(@PACKAGE@DO:.o=.d)
131 @PACKAGE@DEP:=$(@PACKAGE@O:.o=.d) $(@PACKAGE@DDEP)
132else
133 @PACKAGE@DS:=
134 @PACKAGE@DO:=
135 @PACKAGE@DDEP:=
136 @PACKAGE@DEP:=$(@PACKAGE@O:.o=.d)
137endif
138
139
140#The actual library file
141
142@PACKAGE@LIB:=$(LIBPATH)/lib@PACKAGE@.$(SOEXT)
40c469d5 143
144ifneq ($(DYEXT),)
145@PACKAGE@DLIB:=$(LIBPATH)/lib@PACKAGE@.$(DYEXT)
146endif
147
2d8cad5a 148@PACKAGE@ALIB:=$(LIBPATH)/lib@PACKAGE@.$(AEXT)
f0a26826 149
d47d6108 150#Add this to the modules libs
151@MODULE@LIBS += $(@PACKAGE@LIB)
2d8cad5a 152@MODULE@ALIBS += $(@PACKAGE@ALIB)
40c469d5 153ifneq ($(DYEXT),)
154@MODULE@DLIBS += $(@PACKAGE@DLIB)
155endif
d47d6108 156
f0a26826 157#The actual binary file
158
159@PACKAGE@BIN:=$(BINPATH)/@PACKAGE@
160
d47d6108 161#Add to modules list of binaries
162@MODULE@BINS += $(@PACKAGE@BIN)
f0a26826 163
f347de98 164# Use in the main Makefile
f0a26826 165
166ifeq ($(TYPE),lib)
167ALLLIBS += $(@PACKAGE@LIB)
2d8cad5a 168ALLALIBS += $(@PACKAGE@ALIB)
40c469d5 169ifneq ($(DYEXT),)
170ALLLIBS += $(@PACKAGE@DLIB)
171endif
f0a26826 172BINLIBS += -l@PACKAGE@
173else
174ALLEXECS += $(@PACKAGE@BIN)
175endif
176
40c469d5 177ifeq ($(DYEXT),)
178@PACKAGE@LIB := $(@PACKAGE@LIB)
179else
180@PACKAGE@LIB := $(@PACKAGE@LIB)
181endif
182
87c71321 183# include all dependence files
f0a26826 184INCLUDEFILES +=$(@PACKAGE@DEP)
185
f347de98 186EXPORTFILES += $(@PACKAGE@EXPORTDEST)
f0a26826 187
188#local rules
189
f347de98 190#The exportfiles only include if any!!
191
192ifdef @PACKAGE@EXPORT
896cb507 193#$(@PACKAGE@EXPORTDEST): $(patsubst %,@MODULE@/%,$(@PACKAGE@EXPORT))
194
195$(@PACKAGE@EXPORTDEST): $(EXPORTDIR)/%.h: @MODULE@/%.h
15142e2f 196ifndef ALIQUIET
ba419e66 197 @echo "***** Copying file $^ to $@ *****"
15142e2f 198endif
53f2641c 199 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
ba419e66 200 @cp $^ $@
f347de98 201endif
202
88cb7938 203#------------------------------------------------------------------------
204
796dbee6 205ifneq (,$(findstring macosx,$(ALICE_TARGET)))
f3564e28 206$(@PACKAGE@LIB): $(@PACKAGE@DLIB) $(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk
207ifndef ALIQUIET
208 @echo "***** Linking library $@ *****"
209endif
210 $(MUTE)rm -f $@; cd $(dir $@); ln -s $(notdir $(@PACKAGE@DLIB)) $(notdir $@)
211else
f0a26826 212$(@PACKAGE@LIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk
15142e2f 213ifndef ALIQUIET
f0a26826 214 @echo "***** Linking library $@ *****"
15142e2f 215endif
faeab8a4 216 $(MUTE)TMPDIR=/tmp/@MODULE@$$$$.`date +%M%S` ; \
117cfc60 217 export TMPDIR; mkdir -p $$TMPDIR ; cd $$TMPDIR ; \
faeab8a4 218 find $(CURDIR)/@MODULE@/tgt_$(ALICE_TARGET) -name '*.o' -exec ln -s {} . \; ;\
043a26ce 219 \rm -f $(CURDIR)/$@ ;\
7930dd19 220 TMPLIB=$(notdir $(@PACKAGE@LIB)); export TMPLIB;\
ce4e6d58 221 $(SHLD) $(@PACKAGE@SOFLAGS) -o $(CURDIR)/$@ $(notdir $(@PACKAGE@O) $(@PACKAGE@DO)) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(SHLIB);\
222 chmod a-w $(CURDIR)/$@ ;\
fe250300 223 cd $(ALICE_ROOT) ; \rm -rf $$TMPDIR
f3564e28 224endif
810722e6 225
40c469d5 226ifneq ($(DYEXT),)
227$(@PACKAGE@DLIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk
228ifndef ALIQUIET
229 @echo "***** Linking library $@ *****"
230endif
231 $(MUTE)TMPDIR=/tmp/@MODULE@$$$$.`date +%M%S` ; \
117cfc60 232 export TMPDIR; mkdir -p $$TMPDIR ; cd $$TMPDIR ; \
40c469d5 233 find $(CURDIR)/@MODULE@/tgt_$(ALICE_TARGET) -name '*.o' -exec ln -s {} . \; ;\
fe250300 234 \rm -f $(CURDIR)/$@ ;\
ce4e6d58 235 $(DYLD) $(@PACKAGE@DYFLAGS) -o $(CURDIR)/$@ $(notdir $(@PACKAGE@O) $(@PACKAGE@DO)) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(DYLIB);\
236 chmod a-w $(CURDIR)/$@ ;\
fe250300 237 cd $(ALICE_ROOT) ; \rm -rf $$TMPDIR
40c469d5 238endif
239
88cb7938 240#------------------------------------------------------------------------
241
2d8cad5a 242$(@PACKAGE@ALIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk
243ifndef ALIQUIET
244 @echo "***** Linking static library $@ *****"
245endif
246 $(MUTE)TMPDIR=/tmp/@MODULE@$$$$.`date +%M%S` ; \
117cfc60 247 export TMPDIR; mkdir -p $$TMPDIR ; cd $$TMPDIR ; \
2d8cad5a 248 find $(CURDIR)/@MODULE@/tgt_$(ALICE_TARGET) -name '*.o' -exec ln -s {} . \; ;\
7930dd19 249 \rm -f $(CURDIR)/$@ ;\
250 TMPLIB=$(notdir $(@PACKAGE@LIB)); export TMPLIB;\
043a26ce 251 $(ALLD) $(ALFLAGS) $(CURDIR)/$@ $(notdir $(@PACKAGE@O) $(@PACKAGE@DO)) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(ALLIB);\
252 cd $(CURDIR) ; \rm -rf $$TMPDIR
2d8cad5a 253 $(MUTE)chmod a-w $@
254
255
2603dcc4 256$(@PACKAGE@BIN):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk
15142e2f 257ifndef ALIQUIET
258 @echo "***** Making executable $@ *****"
259endif
2d8cad5a 260ifeq ($(ALIPROFILE),YES)
de6c7cfd 261 $(MUTE)$(LD) $(@PACKAGE@LDFLAGS) $(@PACKAGE@O) $(ARLIBS) $(SHLIBS) $(@PACKAGE@BLIBS) $(EXEFLAGS) -o $@
2d8cad5a 262else
de6c7cfd 263 $(MUTE)$(LD) $(@PACKAGE@LDFLAGS) $(@PACKAGE@O) $(@PACKAGE@DO) $(BINLIBDIRS) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(@PACKAGE@BLIBS) $(EXEFLAGS) -o $@
2d8cad5a 264endif
f0a26826 265
216d9f87 266$(@PACKAGE@DAL): $(@PACKAGE@CINTHDRS) @MODULE@/module.mk @MODULE@/tgt_$(ALICE_TARGET)/@PACKAGE@_srcslist
267ifndef ALIQUIET
268 @echo "***** Creating $@ *****";
269endif
2bf97326 270 $(MUTE)echo '//automatically generated ROOT DICT definition' > $@
271 $(MUTE)echo '//!!! DO NOT EDIT THIS FILE !!!' >> $@
216d9f87 272 $(MUTE)echo '#ifdef __CINT__' >> $@
273 $(MUTE)echo '#pragma link off all globals;' >> $@
274 $(MUTE)echo '#pragma link off all classes;' >> $@
275 $(MUTE)echo '#pragma link off all functions;' >> $@
2bf97326 276 $(MUTE)$(foreach i, $(@PACKAGE@CINTCLASSES), \
59e05d49 277 echo "#pragma link C++ class $(i)+;" >> $@ ;)
216d9f87 278 $(MUTE)echo '#endif' >> $@
279
de6c7cfd 280$(@PACKAGE@DS): $(@PACKAGE@CINTHDRS) $(@PACKAGE@DH) @MODULE@/module.mk @MODULE@/tgt_$(ALICE_TARGET)/@PACKAGE@_srcslist
15142e2f 281ifndef ALIQUIET
ce917c76 282 @echo "***** Creating $@ *****";
15142e2f 283endif
f0a26826 284 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
043a26ce 285 @\rm -f $(patsubst %.cxx,%.d, $@)
ce917c76 286 $(MUTE)rootcint -f $@ -c $(@PACKAGE@DEFINE) $(CINTFLAGS) $(@PACKAGE@INC) $(@PACKAGE@CINTHDRS) $(@PACKAGE@DH)
f0a26826 287
62b5f6a4 288$(@PACKAGE@DO): $(@PACKAGE@DS)
15142e2f 289ifndef ALIQUIET
290 @echo "***** Compiling $< *****";
291endif
117cfc60 292 $(MUTE)$(CXX) $(@PACKAGE@DEFINE) -c $(@PACKAGE@INC) -I$(ALICE_ROOT) $< -o $@ $(@PACKAGE@DCXXFLAGS)
f0a26826 293
62b5f6a4 294$(MODDIRO)/@PACKAGE@_srcslist: @MODULE@/@TYPE@@PACKAGE@.pkg
e7fb9451 295 $(MUTE)if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi
296 $(MUTE)for i in $(@PACKAGE@CS) $(@PACKAGE@S) xyz; do echo $$i; done | sort > $@.new
6a772515 297 $(MUTE)for j in `diff -w $@ $@.new 2>/dev/null | awk '/^\</{sub(".c.*",".",$$2); print $$2}' | $(XARGS) basename` ;\
298 do grep -l $$j `find */tgt_$(ALICE_TARGET) -name "*.d"` | $(XARGS) echo \rm -f ;\
299 (find @MODULE@/tgt_$(ALICE_TARGET) -name "$${j}d" ; find @MODULE@/tgt_$(ALICE_TARGET) -name "$${j}o") | $(XARGS) echo \rm -f ;\
62b5f6a4 300 done
e7fb9451 301 $(MUTE)diff -q -w >/dev/null 2>&1 $@ $@.new ;\
62b5f6a4 302 if [ $$? -ne 0 ]; then \mv $@.new $@; else \rm $@.new; fi
de6c7cfd 303
f0a26826 304#Different targets for the module
305
5edd655b 306ifeq ($(TYPE),lib)
5864aa62 307all-@PACKAGE@: $(@PACKAGE@LIB)
40c469d5 308ifneq ($(DYEXT),)
309all-@PACKAGE@: $(@PACKAGE@DLIB)
310endif
5edd655b 311else
312all-@PACKAGE@: $(@PACKAGE@BIN)
313endif
314
f0a26826 315depend-@PACKAGE@: $(@PACKAGE@DEP)
316
317# determination of object files
521bebb4 318$(@PACKAGE@CXXO): $(MODDIRO)/%.o: $(MODDIR)/%.cxx $(MODDIRO)/%.d
15142e2f 319ifndef ALIQUIET
320 @echo "***** Compiling $< *****";
321endif
f0a26826 322 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
67fd7264 323 $(MUTE)$(CXX) $(@PACKAGE@DEFINE) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@CXXFLAGS)
f0a26826 324
521bebb4 325$(@PACKAGE@CAPITFO): $(MODDIRO)/%.o: $(MODDIR)/%.F $(MODDIRO)/%.d
15142e2f 326ifndef ALIQUIET
327 @echo "***** Compiling $< *****";
328endif
f0a26826 329 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
15142e2f 330 $(MUTE)$(F77) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@FFLAGS)
f0a26826 331
521bebb4 332$(@PACKAGE@SMALLFO): $(MODDIRO)/%.o: $(MODDIR)/%.f $(MODDIRO)/%.d
15142e2f 333ifndef ALIQUIET
334 @echo "***** Compiling $< *****";
335endif
f0a26826 336 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
15142e2f 337 $(MUTE)$(F77) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@FFLAGS)
f0a26826 338
521bebb4 339$(@PACKAGE@CO): $(MODDIRO)/%.o: $(MODDIR)/%.c $(MODDIRO)/%.d
15142e2f 340ifndef ALIQUIET
341 @echo "***** Compiling $< *****";
342endif
f0a26826 343 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
67fd7264 344 $(MUTE)$(CC) $(@PACKAGE@DEFINE) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@CFLAGS)
f0a26826 345
346$(@PACKAGE@DDEP): $(@PACKAGE@DS)
15142e2f 347ifndef ALIQUIET
87c71321 348 @echo "***** Making dependences for $< *****";
15142e2f 349endif
f0a26826 350 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
351 @share/alibtool depend "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@
352
521bebb4 353$(@PACKAGE@CXXO:.o=.d): $(MODDIRO)/%.d: $(MODDIRS)/%.cxx
15142e2f 354ifndef ALIQUIET
87c71321 355 @echo "***** Making dependences for $< *****";
15142e2f 356endif
f0a26826 357 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
67fd7264 358 @share/alibtool depend "$(@PACKAGE@DEFINE) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@
521bebb4 359
360$(@PACKAGE@SMALLFO:.o=.d): $(MODDIRO)/%.d: $(MODDIRS)/%.f
15142e2f 361ifndef ALIQUIET
87c71321 362 @echo "***** Making dependences for $< *****";
15142e2f 363endif
f0a26826 364 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
896cb507 365 @share/alibtool dependF "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@
521bebb4 366
367$(@PACKAGE@CAPITFO:.o=.d): $(MODDIRO)/%.d: $(MODDIRS)/%.F
15142e2f 368ifndef ALIQUIET
87c71321 369 @echo "***** Making dependences for $< *****";
15142e2f 370endif
f0a26826 371 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
15142e2f 372 $(MUTE)share/alibtool dependF "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@
521bebb4 373
374$(@PACKAGE@CO:.o=.d): $(MODDIRO)/%.d: $(MODDIRS)/%.c
15142e2f 375ifndef ALIQUIET
87c71321 376 @echo "***** Making dependences for $< *****";
15142e2f 377endif
f0a26826 378 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
67fd7264 379 @share/alibtool depend "$(@PACKAGE@DEFINE) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@
b9d0a01d 380
bdfb9593 381.PRECIOUS: $(patsubst %.cxx,$(MODDIRO)/%.d,$(SRCS))
382.PRECIOUS: $(patsubst %.c,$(MODDIRO)/%.d,$(CSRCS))
383.PRECIOUS: $(patsubst %.F,$(MODDIRO)/%.d,$(patsubst %.f,$(MODDIRO)/%.d,$(FSRCS)))
814cac0f 384
da1b5393 385check-@MODULE@: $(@PACKAGE@CHV)
b9d0a01d 386
387# IRST coding rule check
da1b5393 388$(@PACKAGE@CHV:.viol=.i): $(MODDIRC)/%.i: $(MODDIR)/%.cxx $(MODDIRO)/%.d
b9d0a01d 389 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
f684a380 390 $(MUTE)$(CXX) -E $(@PACKAGE@DEFINE) $(@PACKAGE@INC) -I. $< > $@ $(@PACKAGE@CXXFLAGS)
b9d0a01d 391 @cd $(dir $@) ; $(IRST_INSTALLDIR)/patch/patch4alice.prl $(notdir $@)
392
393# IRST coding rule check
da1b5393 394$(@PACKAGE@CHV): $(MODDIRC)/%.viol: $(MODDIRC)/%.i
8faf5ae4 395 $(MUTE)echo $@ ; $(CODE_CHECK) $< $(shell echo $(dir $<) | sed -e 's:/check::') > $@
b9d0a01d 396
da1b5393 397.SECONDARY: $(@PACKAGE@CHV:.viol=.i) $(@PACKAGE@CHI:.viol=.ii)
71aa2819 398
da1b5393 399PACKREVENG += $(@PACKAGE@CHV:.viol=.ii)
b9d0a01d 400
118c0ae6 401# IRST code smell checker
402
da1b5393 403smell-@MODULE@: $(@PACKAGE@SML)
118c0ae6 404
da1b5393 405$(@PACKAGE@SML:.smell=_cxx.ml) : $(MODDIRZ)/%_cxx.ml : $(MODDIR)/%.cxx
84cdca4c 406 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
407 $(MUTE)src2srcml $< $@
408
da1b5393 409$(@PACKAGE@SML:.smell=_h.ml) : $(MODDIRZ)/%_h.ml : $(MODDIR)/%.h
118c0ae6 410 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
84cdca4c 411 $(MUTE)src2srcml $< $@
412
da1b5393 413$(@PACKAGE@SML) : $(MODDIRZ)/%.smell : $(MODDIRZ)/%_cxx.ml $(MODDIRZ)/%_h.ml
84cdca4c 414 $(MUTE)echo smelling $@
da1b5393 415 $(MUTE)java -classpath $(SMELL_DETECTOR_DIR):$(SMELL_DETECTOR_DIR)/xom-1.1.jar -Xmx500m SmellDetector $? > $@
fe0beaf5 416 $(MUTE)[ -s $@ ] || touch $@
118c0ae6 417
da1b5393 418.SECONDARY: $(@PACKAGE@SML:.smell=_cxx.ml) $(@PACKAGE@SML:.smell=_h.ml)
118c0ae6 419
ce917c76 420# targets to create .par archives (jgrosseo)
421@PACKAGE@.par: $(patsubst %,@MODULE@/@PACKAGE@/%,$(filter-out dict.%, $(HDRS) $(SRCS) $(DHDR) $(PKGFILE) Makefile Makefile.arch lib@PACKAGE@.pkg PROOF-INF))
422 @echo "Creating archive" $@ ...
f4f10f1c 423 @cd @MODULE@; tar cfzh /tmp/$@ @PACKAGE@
ce917c76 424 @rm -rf @MODULE@/@PACKAGE@
f4f10f1c 425 @echo "package" $@ "in /tmp/"$@
67a579df 426 @echo $@ "done"
ce917c76 427
428@MODULE@/@PACKAGE@/Makefile: @MODULE@/Makefile
429 @echo Copying $< to $@ with transformations
430 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
3b2d7a6f 431 @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/; s/PACKAGE = .*/PACKAGE = @PACKAGE@/' < $^ > $@
ce917c76 432
433@MODULE@/@PACKAGE@/Makefile.arch: $(ROOTSYS)/test/Makefile.arch
434 @echo Copying $< to $@
435 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
c8a60375 436 @cp -pR $^ $@
ce917c76 437
438@MODULE@/@PACKAGE@/PROOF-INF: @MODULE@/PROOF-INF.@PACKAGE@
439 @echo Copying $< to $@
440 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
c8a60375 441 @cp -pR $^ $@
ce917c76 442
443@MODULE@/@PACKAGE@/%: @MODULE@/%
444 @echo Copying $< to $@
445 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
c8a60375 446 @cp -pR $< $@
ce917c76 447
448test-@PACKAGE@.par: @PACKAGE@.par
449 @echo "INFO: The file $< is now tested, in case of an error check in par-tmp/@PACKAGE@."
450 @mkdir -p par-tmp
ded0ad79 451 @cd par-tmp; tar xfz /tmp/$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh
ce917c76 452 @rm -rf par-tmp/@PACKAGE@
453 @echo "INFO: Testing succeeded (already cleaned up)"