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