Move SetHighwaterMark() after last possible SetTrack()
[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
21
22ifdef DHDR
23WITHDICT=YES
24else
25WITHDICT=
26endif
27
f347de98 28# Headerfiles exported to common place:
29@PACKAGE@EXPORT:=$(EXPORT)
30@PACKAGE@EXPORTDEST:=$(patsubst %,$(EXPORTDIR)/%,$(EXPORT))
31
32
f0a26826 33#Extra include,libs etc.
f347de98 34
35@PACKAGE@INC:=$(patsubst %,-I%,$(EINCLUDE)) -I@MODULE@
36
f0a26826 37@PACKAGE@ELIBS:=$(patsubst %,-l%,$(ELIBS))
38@PACKAGE@ELIBSDIR:=$(patsubst %,-L%,$(ELIBSDIR))
39
40#c sources and headers
41
42@PACKAGE@CS:=$(patsubst %,$(MODDIR)/%,$(CSRCS))
43@PACKAGE@CH:=$(patsubst %,$(MODDIR)/%,$(CHDRS))
44
45#Fortran sources
46@PACKAGE@FS:=$(patsubst %,$(MODDIR)/%,$(FSRCS))
47
48#c++ sources and header
49@PACKAGE@S:=$(patsubst %,$(MODDIR)/%,$(SRCS))
f347de98 50@PACKAGE@H:=$(patsubst %,$(MODDIR)/%,$(HDRS)) $(EHDRS)
51
52#############################################################################
53#
54# If special rootcint headerfiles is specified use them
55# else use all headers
f0a26826 56
f347de98 57ifndef CINTHDRS
58@PACKAGE@CINTHDRS:=$(@PACKAGE@H)
59else
60@PACKAGE@CINTHDRS:=$(CINTHDRS)
61endif
62#############################################################################
f0a26826 63
64# Package Dictionary
65
66@PACKAGE@DH:=$(MODDIR)/$(DHDR)
67
68
69#All objects
70@PACKAGE@CO:=$(patsubst %,$(MODDIRO)/%, $(CSRCS:.c=.o))
71TEMP:=$(FSRCS:.F=.o)
72@PACKAGE@FO:=$(patsubst %,$(MODDIRO)/%, $(TEMP:.f=.o))
73@PACKAGE@O:= $(patsubst %,$(MODDIRO)/%, $(SRCS:.cxx=.o)) $(@PACKAGE@FO) $(@PACKAGE@CO)
74
d47d6108 75
76
f0a26826 77ifdef WITHDICT
78 @PACKAGE@DS:=$(MODDIRO)/G__@PACKAGE@.cxx
79 @PACKAGE@DO:=$(MODDIRO)/G__@PACKAGE@.o
80 @PACKAGE@DDEP:=$(@PACKAGE@DO:.o=.d)
81 @PACKAGE@DEP:=$(@PACKAGE@O:.o=.d) $(@PACKAGE@DDEP)
82else
83 @PACKAGE@DS:=
84 @PACKAGE@DO:=
85 @PACKAGE@DDEP:=
86 @PACKAGE@DEP:=$(@PACKAGE@O:.o=.d)
87endif
88
89
90#The actual library file
91
92@PACKAGE@LIB:=$(LIBPATH)/lib@PACKAGE@.$(SOEXT)
93
d47d6108 94#Add this to the modules libs
95@MODULE@LIBS += $(@PACKAGE@LIB)
96
f0a26826 97#The actual binary file
98
99@PACKAGE@BIN:=$(BINPATH)/@PACKAGE@
100
d47d6108 101#Add to modules list of binaries
102@MODULE@BINS += $(@PACKAGE@BIN)
f0a26826 103
f347de98 104# Use in the main Makefile
f0a26826 105
106ifeq ($(TYPE),lib)
107ALLLIBS += $(@PACKAGE@LIB)
108BINLIBS += -l@PACKAGE@
109else
110ALLEXECS += $(@PACKAGE@BIN)
111endif
112
113# include all dependency files
114INCLUDEFILES +=$(@PACKAGE@DEP)
115
f347de98 116EXPORTFILES += $(@PACKAGE@EXPORTDEST)
f0a26826 117
118#local rules
119
f347de98 120#The exportfiles only include if any!!
121
122ifdef @PACKAGE@EXPORT
896cb507 123#$(@PACKAGE@EXPORTDEST): $(patsubst %,@MODULE@/%,$(@PACKAGE@EXPORT))
124
125$(@PACKAGE@EXPORTDEST): $(EXPORTDIR)/%.h: @MODULE@/%.h
ca816b72 126 @echo "***** Copying file @MODULE@/$(notdir $@) to $@ *****"
f347de98 127 @[ -d $(dir $@) ] || mkdir $(dir $@)
896cb507 128 @cp @MODULE@/$(notdir $@) $@
f347de98 129endif
130
f0a26826 131$(@PACKAGE@LIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk
132 @echo "***** Linking library $@ *****"
a544e979 133 $(SHLD) $(SOFLAGS) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) -o $@ $(@PACKAGE@O) $(@PACKAGE@DO) $(SHLIB)
f347de98 134
f0a26826 135$(@PACKAGE@BIN):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk
136 @echo "***** Makeing executable $@ *****"
f347de98 137 $(LD) $(LDFLAGS) $(@PACKAGE@O) $(@PACKAGE@DO) $(BINLIBDIRS) $(LIBS) $(@PACKAGE@ELIBS) $(EXEFLAGS) -o $@
f0a26826 138
f347de98 139$(@PACKAGE@DS): $(@PACKAGE@CINTHDRS) $(@PACKAGE@DH)
f0a26826 140 @echo "***** Creating $@ *****";
141 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
f347de98 142 rootcint -f $@ -c $(CINTFLAGS) $(@PACKAGE@INC) $^
f0a26826 143
144$(@PACKAGE@DO): $(@PACKAGE@DS)
145 @echo "***** (Re)compiling $< *****";
f347de98 146 $(CXX) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@CXXFLAGS)
f0a26826 147
148#Different targets for the module
149
150all-@PACKAGE@: $(@PACKAGE@LIB)
151
f0a26826 152depend-@PACKAGE@: $(@PACKAGE@DEP)
153
154# determination of object files
155$(MODDIRO)/%.o: $(MODDIR)/%.cxx $(MODDIRO)/%.d
156 @echo "***** (Re)compiling $< *****";
157 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
f347de98 158 $(CXX) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@CXXFLAGS)
f0a26826 159
160$(MODDIRO)/%.o: $(MODDIR)/%.F $(MODDIRO)/%.d
161 @echo "***** (Re)compiling $< *****";
162 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
163 $(F77) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@FFLAGS)
164
165$(MODDIRO)/%.o: $(MODDIR)/%.f $(MODDIRO)/%.d
166 @echo "***** (Re)compiling $< *****";
167 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
168 $(F77) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@FFLAGS)
169
170$(MODDIRO)/%.o: $(MODDIR)/%.c $(MODDIRO)/%.d
171 @echo "***** (Re)compiling $< *****";
172 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
f347de98 173 $(CC) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@CFLAGS)
f0a26826 174
175$(@PACKAGE@DDEP): $(@PACKAGE@DS)
176 @echo "***** Making dependencies for $< *****";
177 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
178 @share/alibtool depend "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@
179
d47d6108 180$(MODDIRO)/%.d: $(MODDIRS)/%.cxx
f0a26826 181 @echo "***** Making dependencies for $< *****";
182 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
896cb507 183 @share/alibtool depend "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@
184$(MODDIRO)/%.d: $(MODDIRS)/%.f
f0a26826 185 @echo "***** Making dependencies for $< *****";
186 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
896cb507 187 @share/alibtool dependF "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@
188$(MODDIRO)/%.d: $(MODDIRS)/%.F
f0a26826 189 @echo "***** Making dependencies for $< *****";
190 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
f347de98 191 share/alibtool dependF "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@
896cb507 192$(MODDIRO)/%.d: $(MODDIRS)/%.c
f0a26826 193 @echo "***** Making dependencies for $< *****";
194 @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;)
896cb507 195 @share/alibtool depend "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@