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