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