]>
Commit | Line | Data |
---|---|---|
1 | ||
2 | ||
3 | ifndef PACKFFLAGS | |
4 | @PACKAGE@FFLAGS:=$(FFLAGS) | |
5 | else | |
6 | @PACKAGE@FFLAGS:=$(PACKFFLAGS) | |
7 | endif | |
8 | ||
9 | ifndef PACKCFLAGS | |
10 | @PACKAGE@CFLAGS:=$(CFLAGS) | |
11 | else | |
12 | @PACKAGE@CFLAGS:=$(PACKCFLAGS) | |
13 | endif | |
14 | ||
15 | ifndef PACKCXXFLAGS | |
16 | @PACKAGE@CXXFLAGS:=$(CXXFLAGS) | |
17 | else | |
18 | @PACKAGE@CXXFLAGS:=$(PACKCXXFLAGS) | |
19 | endif | |
20 | ||
21 | ifndef PACKDCXXFLAGS | |
22 | ifeq ($(PLATFORM),linuxicc) | |
23 | @PACKAGE@DCXXFLAGS:=$(filter-out -O%,$(CXXFLAGS)) -O0 | |
24 | else | |
25 | @PACKAGE@DCXXFLAGS:=$(filter-out -O%,$(CXXFLAGS)) | |
26 | endif | |
27 | else | |
28 | @PACKAGE@DCXXFLAGS:=$(PACKCXXFLAGS) | |
29 | endif | |
30 | ||
31 | ||
32 | ifdef DHDR | |
33 | WITHDICT=YES | |
34 | else | |
35 | WITHDICT= | |
36 | endif | |
37 | ||
38 | # Headerfiles exported to common place: | |
39 | @PACKAGE@EXPORT:=$(EXPORT) | |
40 | @PACKAGE@EXPORTDEST:=$(patsubst %,$(EXPORTDIR)/%,$(EXPORT)) | |
41 | ||
42 | ||
43 | #Extra include,libs, defines etc. | |
44 | ||
45 | @PACKAGE@DEFINE:=$(EDEFINE) | |
46 | ||
47 | @PACKAGE@INC:=$(patsubst %,-I%,$(EINCLUDE)) -I@MODULE@ | |
48 | ||
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)) | |
62 | @PACKAGE@H:=$(patsubst %,$(MODDIR)/%,$(HDRS)) $(EHDRS) | |
63 | ||
64 | ############################################################################# | |
65 | # | |
66 | # If special rootcint headerfiles is specified use them | |
67 | # else use all headers | |
68 | ||
69 | ifndef CINTHDRS | |
70 | @PACKAGE@CINTHDRS:=$(@PACKAGE@H) | |
71 | else | |
72 | @PACKAGE@CINTHDRS:=$(CINTHDRS) | |
73 | endif | |
74 | ############################################################################# | |
75 | ||
76 | # Package Dictionary | |
77 | ||
78 | @PACKAGE@DH:=$(MODDIR)/$(DHDR) | |
79 | ||
80 | ||
81 | #All objects | |
82 | @PACKAGE@CO:=$(patsubst %,$(MODDIRO)/%, $(CSRCS:.c=.o)) | |
83 | TEMP:=$(FSRCS:.F=.o) | |
84 | @PACKAGE@FO:=$(patsubst %,$(MODDIRO)/%, $(TEMP:.f=.o)) | |
85 | @PACKAGE@O:= $(patsubst %,$(MODDIRO)/%, $(SRCS:.cxx=.o)) $(@PACKAGE@FO) $(@PACKAGE@CO) | |
86 | ||
87 | ||
88 | ||
89 | ifdef 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) | |
94 | else | |
95 | @PACKAGE@DS:= | |
96 | @PACKAGE@DO:= | |
97 | @PACKAGE@DDEP:= | |
98 | @PACKAGE@DEP:=$(@PACKAGE@O:.o=.d) | |
99 | endif | |
100 | ||
101 | ||
102 | #The actual library file | |
103 | ||
104 | @PACKAGE@LIB:=$(LIBPATH)/lib@PACKAGE@.$(SOEXT) | |
105 | ||
106 | #Add this to the modules libs | |
107 | @MODULE@LIBS += $(@PACKAGE@LIB) | |
108 | ||
109 | #The actual binary file | |
110 | ||
111 | @PACKAGE@BIN:=$(BINPATH)/@PACKAGE@ | |
112 | ||
113 | #Add to modules list of binaries | |
114 | @MODULE@BINS += $(@PACKAGE@BIN) | |
115 | ||
116 | # Use in the main Makefile | |
117 | ||
118 | ifeq ($(TYPE),lib) | |
119 | ALLLIBS += $(@PACKAGE@LIB) | |
120 | BINLIBS += -l@PACKAGE@ | |
121 | else | |
122 | ALLEXECS += $(@PACKAGE@BIN) | |
123 | endif | |
124 | ||
125 | # include all dependency files | |
126 | INCLUDEFILES +=$(@PACKAGE@DEP) | |
127 | ||
128 | EXPORTFILES += $(@PACKAGE@EXPORTDEST) | |
129 | ||
130 | #local rules | |
131 | ||
132 | #The exportfiles only include if any!! | |
133 | ||
134 | ifdef @PACKAGE@EXPORT | |
135 | #$(@PACKAGE@EXPORTDEST): $(patsubst %,@MODULE@/%,$(@PACKAGE@EXPORT)) | |
136 | ||
137 | $(@PACKAGE@EXPORTDEST): $(EXPORTDIR)/%.h: @MODULE@/%.h | |
138 | ifndef ALIQUIET | |
139 | @echo "***** Copying file $^ to $@ *****" | |
140 | endif | |
141 | @[ -d $(dir $@) ] || mkdir $(dir $@) | |
142 | @cp $^ $@ | |
143 | endif | |
144 | ||
145 | $(@PACKAGE@LIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk | |
146 | ifndef ALIQUIET | |
147 | @echo "***** Linking library $@ *****" | |
148 | endif | |
149 | $(MUTE)TMPDIR=/tmp/@MODULE@$$$$.`date +%M%S` ; \ | |
150 | export TMPDIR; mkdir $$TMPDIR ; cd $$TMPDIR ; \ | |
151 | find $(CURDIR)/@MODULE@/tgt_$(ALICE_TARGET) -name '*.o' -exec ln -s {} . \; ;\ | |
152 | rm -f $(CURDIR)/$@ ;\ | |
153 | $(SHLD) $(SOFLAGS) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) -o $(CURDIR)/$@ $(notdir $(@PACKAGE@O) $(@PACKAGE@DO)) $(SHLIB) ;\ | |
154 | cd $(CURDIR) ; rm -rf $$TMPDIR | |
155 | $(MUTE)chmod a-w $@ | |
156 | ||
157 | $(@PACKAGE@BIN):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk | |
158 | ifndef ALIQUIET | |
159 | @echo "***** Making executable $@ *****" | |
160 | endif | |
161 | $(MUTE)$(LD) $(LDFLAGS) $(@PACKAGE@O) $(@PACKAGE@DO) $(BINLIBDIRS) $(@PACKAGE@ELIBS) $(LIBS) $(EXEFLAGS) -o $@ | |
162 | ||
163 | $(@PACKAGE@DS): $(@PACKAGE@CINTHDRS) $(@PACKAGE@DH) @MODULE@/module.mk | |
164 | ifndef ALIQUIET | |
165 | @echo "***** Creating $@ *****"; | |
166 | endif | |
167 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) | |
168 | $(MUTE)rootcint -f $@ -c $(@PACKAGE@DEFINE) $(CINTFLAGS) $(@PACKAGE@INC) $(@PACKAGE@CINTHDRS) $(@PACKAGE@DH) | |
169 | ||
170 | $(@PACKAGE@DO): $(@PACKAGE@DS) | |
171 | ifndef ALIQUIET | |
172 | @echo "***** Compiling $< *****"; | |
173 | endif | |
174 | $(MUTE)$(CXX) -c $(@PACKAGE@INC) -I$(ALICE_ROOT) $< -o $@ $(@PACKAGE@DCXXFLAGS) | |
175 | ||
176 | #Different targets for the module | |
177 | ||
178 | all-@PACKAGE@: $(@PACKAGE@LIB) | |
179 | ||
180 | depend-@PACKAGE@: $(@PACKAGE@DEP) | |
181 | ||
182 | # determination of object files | |
183 | $(MODDIRO)/%.o: $(MODDIRO)/%.cxx $(MODDIRO)/%.d | |
184 | ifndef ALIQUIET | |
185 | @echo "***** Compiling $< *****"; | |
186 | endif | |
187 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) | |
188 | $(MUTE)$(CXX) $(@PACKAGE@DEFINE) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@CXXFLAGS) | |
189 | ||
190 | $(MODDIRO)/%.o: $(MODDIR)/%.cxx $(MODDIRO)/%.d | |
191 | ifndef ALIQUIET | |
192 | @echo "***** Compiling $< *****"; | |
193 | endif | |
194 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) | |
195 | $(MUTE)$(CXX) $(@PACKAGE@DEFINE) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@CXXFLAGS) | |
196 | ||
197 | $(MODDIRO)/%.o: $(MODDIR)/%.F $(MODDIRO)/%.d | |
198 | ifndef ALIQUIET | |
199 | @echo "***** Compiling $< *****"; | |
200 | endif | |
201 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) | |
202 | $(MUTE)$(F77) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@FFLAGS) | |
203 | ||
204 | $(MODDIRO)/%.o: $(MODDIR)/%.f $(MODDIRO)/%.d | |
205 | ifndef ALIQUIET | |
206 | @echo "***** Compiling $< *****"; | |
207 | endif | |
208 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) | |
209 | $(MUTE)$(F77) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@FFLAGS) | |
210 | ||
211 | $(MODDIRO)/%.o: $(MODDIR)/%.c $(MODDIRO)/%.d | |
212 | ifndef ALIQUIET | |
213 | @echo "***** Compiling $< *****"; | |
214 | endif | |
215 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) | |
216 | $(MUTE)$(CC) $(@PACKAGE@DEFINE) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@CFLAGS) | |
217 | ||
218 | $(@PACKAGE@DDEP): $(@PACKAGE@DS) | |
219 | ifndef ALIQUIET | |
220 | @echo "***** Making dependencies for $< *****"; | |
221 | endif | |
222 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) | |
223 | @share/alibtool depend "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@ | |
224 | ||
225 | $(MODDIRO)/%.d: $(MODDIRS)/%.cxx | |
226 | ifndef ALIQUIET | |
227 | @echo "***** Making dependencies for $< *****"; | |
228 | endif | |
229 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) | |
230 | @share/alibtool depend "$(@PACKAGE@DEFINE) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@ | |
231 | $(MODDIRO)/%.d: $(MODDIRS)/%.f | |
232 | ifndef ALIQUIET | |
233 | @echo "***** Making dependencies for $< *****"; | |
234 | endif | |
235 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) | |
236 | @share/alibtool dependF "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@ | |
237 | $(MODDIRO)/%.d: $(MODDIRS)/%.F | |
238 | ifndef ALIQUIET | |
239 | @echo "***** Making dependencies for $< *****"; | |
240 | endif | |
241 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) | |
242 | $(MUTE)share/alibtool dependF "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@ | |
243 | $(MODDIRO)/%.d: $(MODDIRS)/%.c | |
244 | ifndef ALIQUIET | |
245 | @echo "***** Making dependencies for $< *****"; | |
246 | endif | |
247 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) | |
248 | @share/alibtool depend "$(@PACKAGE@DEFINE) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@ |