Correct error message in case of wrong detector code
[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)
f0a26826 122
d47d6108 123
124
f0a26826 125ifdef WITHDICT
126 @PACKAGE@DS:=$(MODDIRO)/G__@PACKAGE@.cxx
127 @PACKAGE@DO:=$(MODDIRO)/G__@PACKAGE@.o
128 @PACKAGE@DDEP:=$(@PACKAGE@DO:.o=.d)
129 @PACKAGE@DEP:=$(@PACKAGE@O:.o=.d) $(@PACKAGE@DDEP)
130else
131 @PACKAGE@DS:=
132 @PACKAGE@DO:=
133 @PACKAGE@DDEP:=
134 @PACKAGE@DEP:=$(@PACKAGE@O:.o=.d)
135endif
136
137
138#The actual library file
139
140@PACKAGE@LIB:=$(LIBPATH)/lib@PACKAGE@.$(SOEXT)
40c469d5 141
142ifneq ($(DYEXT),)
143@PACKAGE@DLIB:=$(LIBPATH)/lib@PACKAGE@.$(DYEXT)
144endif
145
2d8cad5a 146@PACKAGE@ALIB:=$(LIBPATH)/lib@PACKAGE@.$(AEXT)
f0a26826 147
d47d6108 148#Add this to the modules libs
149@MODULE@LIBS += $(@PACKAGE@LIB)
2d8cad5a 150@MODULE@ALIBS += $(@PACKAGE@ALIB)
40c469d5 151ifneq ($(DYEXT),)
152@MODULE@DLIBS += $(@PACKAGE@DLIB)
153endif
d47d6108 154
f0a26826 155#The actual binary file
156
157@PACKAGE@BIN:=$(BINPATH)/@PACKAGE@
158
d47d6108 159#Add to modules list of binaries
160@MODULE@BINS += $(@PACKAGE@BIN)
f0a26826 161
f347de98 162# Use in the main Makefile
f0a26826 163
164ifeq ($(TYPE),lib)
165ALLLIBS += $(@PACKAGE@LIB)
2d8cad5a 166ALLALIBS += $(@PACKAGE@ALIB)
40c469d5 167ifneq ($(DYEXT),)
168ALLLIBS += $(@PACKAGE@DLIB)
169endif
f0a26826 170BINLIBS += -l@PACKAGE@
171else
172ALLEXECS += $(@PACKAGE@BIN)
173endif
174
40c469d5 175ifeq ($(DYEXT),)
176@PACKAGE@LIB := $(@PACKAGE@LIB)
177else
178@PACKAGE@LIB := $(@PACKAGE@LIB)
179endif
180
87c71321 181# include all dependence files
f0a26826 182INCLUDEFILES +=$(@PACKAGE@DEP)
183
f347de98 184EXPORTFILES += $(@PACKAGE@EXPORTDEST)
f0a26826 185
186#local rules
187
f347de98 188#The exportfiles only include if any!!
189
190ifdef @PACKAGE@EXPORT
896cb507 191#$(@PACKAGE@EXPORTDEST): $(patsubst %,@MODULE@/%,$(@PACKAGE@EXPORT))
192
193$(@PACKAGE@EXPORTDEST): $(EXPORTDIR)/%.h: @MODULE@/%.h
15142e2f 194ifndef ALIQUIET
ba419e66 195 @echo "***** Copying file $^ to $@ *****"
15142e2f 196endif
53f2641c 197 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
ba419e66 198 @cp $^ $@
f347de98 199endif
200
88cb7938 201#------------------------------------------------------------------------
202
796dbee6 203ifneq (,$(findstring macosx,$(ALICE_TARGET)))
f3564e28 204$(@PACKAGE@LIB): $(@PACKAGE@DLIB) $(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk
205ifndef ALIQUIET
206 @echo "***** Linking library $@ *****"
207endif
208 $(MUTE)rm -f $@; cd $(dir $@); ln -s $(notdir $(@PACKAGE@DLIB)) $(notdir $@)
209else
f0a26826 210$(@PACKAGE@LIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk
15142e2f 211ifndef ALIQUIET
f0a26826 212 @echo "***** Linking library $@ *****"
15142e2f 213endif
faeab8a4 214 $(MUTE)TMPDIR=/tmp/@MODULE@$$$$.`date +%M%S` ; \
117cfc60 215 export TMPDIR; mkdir -p $$TMPDIR ; cd $$TMPDIR ; \
faeab8a4 216 find $(CURDIR)/@MODULE@/tgt_$(ALICE_TARGET) -name '*.o' -exec ln -s {} . \; ;\
043a26ce 217 \rm -f $(CURDIR)/$@ ;\
7930dd19 218 TMPLIB=$(notdir $(@PACKAGE@LIB)); export TMPLIB;\
ce4e6d58 219 $(SHLD) $(@PACKAGE@SOFLAGS) -o $(CURDIR)/$@ $(notdir $(@PACKAGE@O) $(@PACKAGE@DO)) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(SHLIB);\
220 chmod a-w $(CURDIR)/$@ ;\
fe250300 221 cd $(ALICE_ROOT) ; \rm -rf $$TMPDIR
f3564e28 222endif
810722e6 223
40c469d5 224ifneq ($(DYEXT),)
225$(@PACKAGE@DLIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk
226ifndef ALIQUIET
227 @echo "***** Linking library $@ *****"
228endif
229 $(MUTE)TMPDIR=/tmp/@MODULE@$$$$.`date +%M%S` ; \
117cfc60 230 export TMPDIR; mkdir -p $$TMPDIR ; cd $$TMPDIR ; \
40c469d5 231 find $(CURDIR)/@MODULE@/tgt_$(ALICE_TARGET) -name '*.o' -exec ln -s {} . \; ;\
fe250300 232 \rm -f $(CURDIR)/$@ ;\
ce4e6d58 233 $(DYLD) $(@PACKAGE@DYFLAGS) -o $(CURDIR)/$@ $(notdir $(@PACKAGE@O) $(@PACKAGE@DO)) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(DYLIB);\
234 chmod a-w $(CURDIR)/$@ ;\
fe250300 235 cd $(ALICE_ROOT) ; \rm -rf $$TMPDIR
40c469d5 236endif
237
88cb7938 238#------------------------------------------------------------------------
239
2d8cad5a 240$(@PACKAGE@ALIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk
241ifndef ALIQUIET
242 @echo "***** Linking static library $@ *****"
243endif
244 $(MUTE)TMPDIR=/tmp/@MODULE@$$$$.`date +%M%S` ; \
117cfc60 245 export TMPDIR; mkdir -p $$TMPDIR ; cd $$TMPDIR ; \
2d8cad5a 246 find $(CURDIR)/@MODULE@/tgt_$(ALICE_TARGET) -name '*.o' -exec ln -s {} . \; ;\
7930dd19 247 \rm -f $(CURDIR)/$@ ;\
248 TMPLIB=$(notdir $(@PACKAGE@LIB)); export TMPLIB;\
043a26ce 249 $(ALLD) $(ALFLAGS) $(CURDIR)/$@ $(notdir $(@PACKAGE@O) $(@PACKAGE@DO)) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(ALLIB);\
250 cd $(CURDIR) ; \rm -rf $$TMPDIR
2d8cad5a 251 $(MUTE)chmod a-w $@
252
253
2603dcc4 254$(@PACKAGE@BIN):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk
15142e2f 255ifndef ALIQUIET
256 @echo "***** Making executable $@ *****"
257endif
2d8cad5a 258ifeq ($(ALIPROFILE),YES)
de6c7cfd 259 $(MUTE)$(LD) $(@PACKAGE@LDFLAGS) $(@PACKAGE@O) $(ARLIBS) $(SHLIBS) $(@PACKAGE@BLIBS) $(EXEFLAGS) -o $@
2d8cad5a 260else
de6c7cfd 261 $(MUTE)$(LD) $(@PACKAGE@LDFLAGS) $(@PACKAGE@O) $(@PACKAGE@DO) $(BINLIBDIRS) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) $(@PACKAGE@BLIBS) $(EXEFLAGS) -o $@
2d8cad5a 262endif
f0a26826 263
216d9f87 264$(@PACKAGE@DAL): $(@PACKAGE@CINTHDRS) @MODULE@/module.mk @MODULE@/tgt_$(ALICE_TARGET)/@PACKAGE@_srcslist
265ifndef ALIQUIET
266 @echo "***** Creating $@ *****";
267endif
2bf97326 268 $(MUTE)echo '//automatically generated ROOT DICT definition' > $@
269 $(MUTE)echo '//!!! DO NOT EDIT THIS FILE !!!' >> $@
216d9f87 270 $(MUTE)echo '#ifdef __CINT__' >> $@
271 $(MUTE)echo '#pragma link off all globals;' >> $@
272 $(MUTE)echo '#pragma link off all classes;' >> $@
273 $(MUTE)echo '#pragma link off all functions;' >> $@
2bf97326 274 $(MUTE)$(foreach i, $(@PACKAGE@CINTCLASSES), \
59e05d49 275 echo "#pragma link C++ class $(i)+;" >> $@ ;)
216d9f87 276 $(MUTE)echo '#endif' >> $@
277
de6c7cfd 278$(@PACKAGE@DS): $(@PACKAGE@CINTHDRS) $(@PACKAGE@DH) @MODULE@/module.mk @MODULE@/tgt_$(ALICE_TARGET)/@PACKAGE@_srcslist
15142e2f 279ifndef ALIQUIET
ce917c76 280 @echo "***** Creating $@ *****";
15142e2f 281endif
f0a26826 282 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
043a26ce 283 @\rm -f $(patsubst %.cxx,%.d, $@)
ce917c76 284 $(MUTE)rootcint -f $@ -c $(@PACKAGE@DEFINE) $(CINTFLAGS) $(@PACKAGE@INC) $(@PACKAGE@CINTHDRS) $(@PACKAGE@DH)
f0a26826 285
62b5f6a4 286$(@PACKAGE@DO): $(@PACKAGE@DS)
15142e2f 287ifndef ALIQUIET
288 @echo "***** Compiling $< *****";
289endif
117cfc60 290 $(MUTE)$(CXX) $(@PACKAGE@DEFINE) -c $(@PACKAGE@INC) -I$(ALICE_ROOT) $< -o $@ $(@PACKAGE@DCXXFLAGS)
f0a26826 291
62b5f6a4 292$(MODDIRO)/@PACKAGE@_srcslist: @MODULE@/@TYPE@@PACKAGE@.pkg
e7fb9451 293 $(MUTE)if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi
294 $(MUTE)for i in $(@PACKAGE@CS) $(@PACKAGE@S) xyz; do echo $$i; done | sort > $@.new
6a772515 295 $(MUTE)for j in `diff -w $@ $@.new 2>/dev/null | awk '/^\</{sub(".c.*",".",$$2); print $$2}' | $(XARGS) basename` ;\
296 do grep -l $$j `find */tgt_$(ALICE_TARGET) -name "*.d"` | $(XARGS) echo \rm -f ;\
297 (find @MODULE@/tgt_$(ALICE_TARGET) -name "$${j}d" ; find @MODULE@/tgt_$(ALICE_TARGET) -name "$${j}o") | $(XARGS) echo \rm -f ;\
62b5f6a4 298 done
e7fb9451 299 $(MUTE)diff -q -w >/dev/null 2>&1 $@ $@.new ;\
62b5f6a4 300 if [ $$? -ne 0 ]; then \mv $@.new $@; else \rm $@.new; fi
de6c7cfd 301
f0a26826 302#Different targets for the module
303
5edd655b 304ifeq ($(TYPE),lib)
5864aa62 305all-@PACKAGE@: $(@PACKAGE@LIB)
40c469d5 306ifneq ($(DYEXT),)
307all-@PACKAGE@: $(@PACKAGE@DLIB)
308endif
5edd655b 309else
310all-@PACKAGE@: $(@PACKAGE@BIN)
311endif
312
f0a26826 313depend-@PACKAGE@: $(@PACKAGE@DEP)
314
315# determination of object files
521bebb4 316$(@PACKAGE@CXXO): $(MODDIRO)/%.o: $(MODDIR)/%.cxx $(MODDIRO)/%.d
15142e2f 317ifndef ALIQUIET
318 @echo "***** Compiling $< *****";
319endif
f0a26826 320 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
67fd7264 321 $(MUTE)$(CXX) $(@PACKAGE@DEFINE) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@CXXFLAGS)
f0a26826 322
521bebb4 323$(@PACKAGE@CAPITFO): $(MODDIRO)/%.o: $(MODDIR)/%.F $(MODDIRO)/%.d
15142e2f 324ifndef ALIQUIET
325 @echo "***** Compiling $< *****";
326endif
f0a26826 327 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
15142e2f 328 $(MUTE)$(F77) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@FFLAGS)
f0a26826 329
521bebb4 330$(@PACKAGE@SMALLFO): $(MODDIRO)/%.o: $(MODDIR)/%.f $(MODDIRO)/%.d
15142e2f 331ifndef ALIQUIET
332 @echo "***** Compiling $< *****";
333endif
f0a26826 334 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
15142e2f 335 $(MUTE)$(F77) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@FFLAGS)
f0a26826 336
521bebb4 337$(@PACKAGE@CO): $(MODDIRO)/%.o: $(MODDIR)/%.c $(MODDIRO)/%.d
15142e2f 338ifndef ALIQUIET
339 @echo "***** Compiling $< *****";
340endif
f0a26826 341 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
67fd7264 342 $(MUTE)$(CC) $(@PACKAGE@DEFINE) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@CFLAGS)
f0a26826 343
344$(@PACKAGE@DDEP): $(@PACKAGE@DS)
15142e2f 345ifndef ALIQUIET
87c71321 346 @echo "***** Making dependences for $< *****";
15142e2f 347endif
f0a26826 348 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
349 @share/alibtool depend "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@
350
521bebb4 351$(@PACKAGE@CXXO:.o=.d): $(MODDIRO)/%.d: $(MODDIRS)/%.cxx
15142e2f 352ifndef ALIQUIET
87c71321 353 @echo "***** Making dependences for $< *****";
15142e2f 354endif
f0a26826 355 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
67fd7264 356 @share/alibtool depend "$(@PACKAGE@DEFINE) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@
521bebb4 357
358$(@PACKAGE@SMALLFO:.o=.d): $(MODDIRO)/%.d: $(MODDIRS)/%.f
15142e2f 359ifndef ALIQUIET
87c71321 360 @echo "***** Making dependences for $< *****";
15142e2f 361endif
f0a26826 362 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
896cb507 363 @share/alibtool dependF "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@
521bebb4 364
365$(@PACKAGE@CAPITFO:.o=.d): $(MODDIRO)/%.d: $(MODDIRS)/%.F
15142e2f 366ifndef ALIQUIET
87c71321 367 @echo "***** Making dependences for $< *****";
15142e2f 368endif
f0a26826 369 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
15142e2f 370 $(MUTE)share/alibtool dependF "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@
521bebb4 371
372$(@PACKAGE@CO:.o=.d): $(MODDIRO)/%.d: $(MODDIRS)/%.c
15142e2f 373ifndef ALIQUIET
87c71321 374 @echo "***** Making dependences for $< *****";
15142e2f 375endif
f0a26826 376 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
67fd7264 377 @share/alibtool depend "$(@PACKAGE@DEFINE) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@
b9d0a01d 378
bdfb9593 379.PRECIOUS: $(patsubst %.cxx,$(MODDIRO)/%.d,$(SRCS))
380.PRECIOUS: $(patsubst %.c,$(MODDIRO)/%.d,$(CSRCS))
381.PRECIOUS: $(patsubst %.F,$(MODDIRO)/%.d,$(patsubst %.f,$(MODDIRO)/%.d,$(FSRCS)))
814cac0f 382
71aa2819 383@PACKAGE@CHECKS := $(patsubst %.cxx,@MODULE@/check/%.viol,$(SRCS))
6a549364 384@PACKAGE@SRCDIR := $(dir $(word 1,$(patsubst %.cxx,@MODULE@/%.cxx,$(SRCS))))
385@PACKAGE@CHKDIR := $(dir $(word 1,$(@PACKAGE@CHECKS)))
386@PACKAGE@OBJDIR := $(dir $(word 1,$(patsubst %.cxx,@MODULE@/tgt_$(ALICE_TARGET)/%.cxx,$(SRCS))))
b9d0a01d 387
7e96fcc7 388check-@MODULE@: $(@PACKAGE@CHECKS)
b9d0a01d 389
390# IRST coding rule check
6a549364 391$(@PACKAGE@CHKDIR)%.i : $(@PACKAGE@SRCDIR)%.cxx $(@PACKAGE@OBJDIR)%.d
b9d0a01d 392 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
f684a380 393 $(MUTE)$(CXX) -E $(@PACKAGE@DEFINE) $(@PACKAGE@INC) -I. $< > $@ $(@PACKAGE@CXXFLAGS)
b9d0a01d 394 @cd $(dir $@) ; $(IRST_INSTALLDIR)/patch/patch4alice.prl $(notdir $@)
395
396# IRST coding rule check
71aa2819 397@MODULE@/check/%.viol : @MODULE@/check/%.i
8faf5ae4 398 $(MUTE)echo $@ ; $(CODE_CHECK) $< $(shell echo $(dir $<) | sed -e 's:/check::') > $@
b9d0a01d 399
71aa2819 400@PACKAGE@PREPROC = $(patsubst %.viol,%.i,$(@PACKAGE@CHECKS))
401
402@PACKAGE@REVENGS = $(patsubst %.viol,%.ii,$(@PACKAGE@CHECKS))
403
b9d0a01d 404.SECONDARY: $(@PACKAGE@REVENGS) $(@PACKAGE@PREPROC)
405
c4b5b7b8 406PACKREVENG += $(@PACKAGE@PREPROC)
b9d0a01d 407
118c0ae6 408# IRST code smell checker
409
410@PACKAGE@SMELL := $(patsubst %.cxx,@MODULE@/smell/%.smell,$(SRCS))
411
412smell-@MODULE@: $(@PACKAGE@SMELL)
413
84cdca4c 414@MODULE@/smell/%_cxx.ml : @MODULE@/%.cxx
415 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
416 $(MUTE)src2srcml $< $@
417
418@MODULE@/smell/%_h.ml : @MODULE@/%.h
118c0ae6 419 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
84cdca4c 420 $(MUTE)src2srcml $< $@
421
422@MODULE@/smell/%.smell : @MODULE@/smell/%_cxx.ml @MODULE@/smell/%_h.ml
423 $(MUTE)echo smelling $@
424 java -classpath $(SMELL_DETECTOR_DIR):$(SMELL_DETECTOR_DIR)/xom-1.1.jar -Xmx500m SmellDetector $? > $@
118c0ae6 425
07a57362 426.PRECIOUS: $(patsubst %.cxx,@MODULE@/smell/%_h.ml,$(SRCS)) $(patsubst %.cxx,@MODULE@/smell/%_cxx.ml,$(SRCS))
118c0ae6 427
ce917c76 428# targets to create .par archives (jgrosseo)
429@PACKAGE@.par: $(patsubst %,@MODULE@/@PACKAGE@/%,$(filter-out dict.%, $(HDRS) $(SRCS) $(DHDR) $(PKGFILE) Makefile Makefile.arch lib@PACKAGE@.pkg PROOF-INF))
430 @echo "Creating archive" $@ ...
f4f10f1c 431 @cd @MODULE@; tar cfzh /tmp/$@ @PACKAGE@
ce917c76 432 @rm -rf @MODULE@/@PACKAGE@
f4f10f1c 433 @echo "package" $@ "in /tmp/"$@
67a579df 434 @echo $@ "done"
ce917c76 435
436@MODULE@/@PACKAGE@/Makefile: @MODULE@/Makefile
437 @echo Copying $< to $@ with transformations
438 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
3b2d7a6f 439 @sed 's/include \$$(ROOTSYS)\/test\/Makefile.arch/include Makefile.arch/; s/PACKAGE = .*/PACKAGE = @PACKAGE@/' < $^ > $@
ce917c76 440
441@MODULE@/@PACKAGE@/Makefile.arch: $(ROOTSYS)/test/Makefile.arch
442 @echo Copying $< to $@
443 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
c8a60375 444 @cp -pR $^ $@
ce917c76 445
446@MODULE@/@PACKAGE@/PROOF-INF: @MODULE@/PROOF-INF.@PACKAGE@
447 @echo Copying $< to $@
448 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
c8a60375 449 @cp -pR $^ $@
ce917c76 450
451@MODULE@/@PACKAGE@/%: @MODULE@/%
452 @echo Copying $< to $@
453 @[ -d $(dir $@) ] || mkdir -p $(dir $@)
c8a60375 454 @cp -pR $< $@
ce917c76 455
456test-@PACKAGE@.par: @PACKAGE@.par
457 @echo "INFO: The file $< is now tested, in case of an error check in par-tmp/@PACKAGE@."
458 @mkdir -p par-tmp
ded0ad79 459 @cd par-tmp; tar xfz /tmp/$<; cd $(subst .par,,$<); PROOF-INF/BUILD.sh
ce917c76 460 @rm -rf par-tmp/@PACKAGE@
461 @echo "INFO: Testing succeeded (already cleaned up)"