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 | |
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 |
57 | ifndef CINTHDRS |
58 | @PACKAGE@CINTHDRS:=$(@PACKAGE@H) |
59 | else |
60 | @PACKAGE@CINTHDRS:=$(CINTHDRS) |
61 | endif |
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)) |
71 | TEMP:=$(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 |
77 | ifdef 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) |
82 | else |
83 | @PACKAGE@DS:= |
84 | @PACKAGE@DO:= |
85 | @PACKAGE@DDEP:= |
86 | @PACKAGE@DEP:=$(@PACKAGE@O:.o=.d) |
87 | endif |
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 | |
106 | ifeq ($(TYPE),lib) |
107 | ALLLIBS += $(@PACKAGE@LIB) |
108 | BINLIBS += -l@PACKAGE@ |
109 | else |
110 | ALLEXECS += $(@PACKAGE@BIN) |
111 | endif |
112 | |
113 | # include all dependency files |
114 | INCLUDEFILES +=$(@PACKAGE@DEP) |
115 | |
f347de98 |
116 | EXPORTFILES += $(@PACKAGE@EXPORTDEST) |
f0a26826 |
117 | |
118 | #local rules |
119 | |
f347de98 |
120 | #The exportfiles only include if any!! |
121 | |
122 | ifdef @PACKAGE@EXPORT |
896cb507 |
123 | #$(@PACKAGE@EXPORTDEST): $(patsubst %,@MODULE@/%,$(@PACKAGE@EXPORT)) |
124 | |
125 | $(@PACKAGE@EXPORTDEST): $(EXPORTDIR)/%.h: @MODULE@/%.h |
15142e2f |
126 | ifndef ALIQUIET |
ca816b72 |
127 | @echo "***** Copying file @MODULE@/$(notdir $@) to $@ *****" |
15142e2f |
128 | endif |
f347de98 |
129 | @[ -d $(dir $@) ] || mkdir $(dir $@) |
896cb507 |
130 | @cp @MODULE@/$(notdir $@) $@ |
f347de98 |
131 | endif |
132 | |
f0a26826 |
133 | $(@PACKAGE@LIB):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk |
15142e2f |
134 | ifndef ALIQUIET |
f0a26826 |
135 | @echo "***** Linking library $@ *****" |
15142e2f |
136 | endif |
137 | $(MUTE)$(SHLD) $(SOFLAGS) $(@PACKAGE@ELIBSDIR) $(@PACKAGE@ELIBS) -o $@ $(@PACKAGE@O) $(@PACKAGE@DO) $(SHLIB) |
f347de98 |
138 | |
f0a26826 |
139 | $(@PACKAGE@BIN):$(@PACKAGE@O) $(@PACKAGE@DO) @MODULE@/module.mk |
15142e2f |
140 | ifndef ALIQUIET |
141 | @echo "***** Making executable $@ *****" |
142 | endif |
143 | $(MUTE)$(LD) $(LDFLAGS) $(@PACKAGE@O) $(@PACKAGE@DO) $(BINLIBDIRS) $(LIBS) $(@PACKAGE@ELIBS) $(EXEFLAGS) -o $@ |
f0a26826 |
144 | |
6bb8c070 |
145 | $(@PACKAGE@DS): $(@PACKAGE@CINTHDRS) $(@PACKAGE@DH) @MODULE@/module.mk |
15142e2f |
146 | ifndef ALIQUIET |
f0a26826 |
147 | @echo "***** Creating $@ *****"; |
15142e2f |
148 | endif |
f0a26826 |
149 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) |
6bb8c070 |
150 | $(MUTE)rootcint -f $@ -c $(CINTFLAGS) $(@PACKAGE@INC) $(shell echo $^ | sed -e 's/@MODULE@\/module\.mk//') |
f0a26826 |
151 | |
152 | $(@PACKAGE@DO): $(@PACKAGE@DS) |
15142e2f |
153 | ifndef ALIQUIET |
154 | @echo "***** Compiling $< *****"; |
155 | endif |
156 | $(MUTE)$(CXX) -c $(@PACKAGE@INC) -I$(ALICE_ROOT) $< -o $@ $(@PACKAGE@CXXFLAGS) |
f0a26826 |
157 | |
158 | #Different targets for the module |
159 | |
160 | all-@PACKAGE@: $(@PACKAGE@LIB) |
161 | |
f0a26826 |
162 | depend-@PACKAGE@: $(@PACKAGE@DEP) |
163 | |
164 | # determination of object files |
165 | $(MODDIRO)/%.o: $(MODDIR)/%.cxx $(MODDIRO)/%.d |
15142e2f |
166 | ifndef ALIQUIET |
167 | @echo "***** Compiling $< *****"; |
168 | endif |
f0a26826 |
169 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) |
15142e2f |
170 | $(MUTE)$(CXX) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@CXXFLAGS) |
f0a26826 |
171 | |
172 | $(MODDIRO)/%.o: $(MODDIR)/%.F $(MODDIRO)/%.d |
15142e2f |
173 | ifndef ALIQUIET |
174 | @echo "***** Compiling $< *****"; |
175 | endif |
f0a26826 |
176 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) |
15142e2f |
177 | $(MUTE)$(F77) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@FFLAGS) |
f0a26826 |
178 | |
179 | $(MODDIRO)/%.o: $(MODDIR)/%.f $(MODDIRO)/%.d |
15142e2f |
180 | ifndef ALIQUIET |
181 | @echo "***** Compiling $< *****"; |
182 | endif |
f0a26826 |
183 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) |
15142e2f |
184 | $(MUTE)$(F77) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@FFLAGS) |
f0a26826 |
185 | |
186 | $(MODDIRO)/%.o: $(MODDIR)/%.c $(MODDIRO)/%.d |
15142e2f |
187 | ifndef ALIQUIET |
188 | @echo "***** Compiling $< *****"; |
189 | endif |
f0a26826 |
190 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) |
15142e2f |
191 | $(MUTE)$(CC) -c $(@PACKAGE@INC) $< -o $@ $(@PACKAGE@CFLAGS) |
f0a26826 |
192 | |
193 | $(@PACKAGE@DDEP): $(@PACKAGE@DS) |
15142e2f |
194 | ifndef ALIQUIET |
f0a26826 |
195 | @echo "***** Making dependencies for $< *****"; |
15142e2f |
196 | endif |
f0a26826 |
197 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) |
198 | @share/alibtool depend "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@ |
199 | |
d47d6108 |
200 | $(MODDIRO)/%.d: $(MODDIRS)/%.cxx |
15142e2f |
201 | ifndef ALIQUIET |
f0a26826 |
202 | @echo "***** Making dependencies for $< *****"; |
15142e2f |
203 | endif |
f0a26826 |
204 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) |
896cb507 |
205 | @share/alibtool depend "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@ |
206 | $(MODDIRO)/%.d: $(MODDIRS)/%.f |
15142e2f |
207 | ifndef ALIQUIET |
f0a26826 |
208 | @echo "***** Making dependencies for $< *****"; |
15142e2f |
209 | endif |
f0a26826 |
210 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) |
896cb507 |
211 | @share/alibtool dependF "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@ |
212 | $(MODDIRO)/%.d: $(MODDIRS)/%.F |
15142e2f |
213 | ifndef ALIQUIET |
f0a26826 |
214 | @echo "***** Making dependencies for $< *****"; |
15142e2f |
215 | endif |
f0a26826 |
216 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) |
15142e2f |
217 | $(MUTE)share/alibtool dependF "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@ |
896cb507 |
218 | $(MODDIRO)/%.d: $(MODDIRS)/%.c |
15142e2f |
219 | ifndef ALIQUIET |
f0a26826 |
220 | @echo "***** Making dependencies for $< *****"; |
15142e2f |
221 | endif |
f0a26826 |
222 | @(if [ ! -d '$(dir $@)' ]; then echo "***** Making directory $(dir $@) *****"; mkdir -p $(dir $@); fi;) |
896cb507 |
223 | @share/alibtool depend "$(@PACKAGE@ELIBSDIR) $(@PACKAGE@INC) $(DEPINC) $<" > $@ |