b9d0a01d |
1 | # Top level Makefile for AliRoot System |
2 | # |
3 | # Author: Jan-Erik Revsbech (revsbech@fys.ku.dk) |
4 | # Developed on idea of Boris Polichtchouk (Boris.Polichtchouk@cern.ch), 15/4/2001 |
fe4da5cc |
5 | |
fe4da5cc |
6 | |
b9d0a01d |
7 | ifdef ALIVERBOSE |
8 | MUTE:= |
9 | else |
10 | MUTE:=@ |
11 | endif |
fe4da5cc |
12 | |
b9d0a01d |
13 | # IRST coding rule check |
14 | IRST_INSTALLDIR=$(ALICE)/local/IRST |
50a3b0ee |
15 | IRST_CONFIG_DIR=$(IRST_INSTALLDIR)/userConfig/ALICE |
b9d0a01d |
16 | CLASSPATH=$(IRST_INSTALLDIR) |
50a3b0ee |
17 | export CLASSPATH IRST_INSTALLDIR IRST_CONFIG_DIR |
b9d0a01d |
18 | CODE_CHECK=java rules.ALICE.ALICERuleChecker |
19 | REV_ENG=$(IRST_INSTALLDIR)/scripts/revEng.sh |
fe4da5cc |
20 | |
fe4da5cc |
21 | |
b9d0a01d |
22 | include build/Makefile.config |
b934f194 |
23 | ################################################################## |
24 | # |
25 | # Where to install libraries and binaries |
b9d0a01d |
26 | # and common header files |
47b969ba |
27 | |
1aa44b64 |
28 | LIBPATH = lib/tgt_$(ALICE_TARGET) |
29 | BINPATH = bin/tgt_$(ALICE_TARGET) |
b9d0a01d |
30 | EXPORTDIR = $(ALICE_ROOT)/include |
31 | ################################################################## |
47b969ba |
32 | |
b9d0a01d |
33 | ################################################################## |
b934f194 |
34 | # include machine dependent macros |
fe4da5cc |
35 | |
b9d0a01d |
36 | -include build/Makefile.$(ALICE_TARGET) |
37 | ################################################################## |
fe4da5cc |
38 | |
b9d0a01d |
39 | ################################################################## |
b934f194 |
40 | # |
b9d0a01d |
41 | # Check if called with debug |
42865053 |
42 | |
b9d0a01d |
43 | ifeq ($(ALIDEBUG),YES) |
b934f194 |
44 | override ALICE_TARGET := $(ALICE_TARGET)DEBUG |
45 | FFLAGS := -g $(filter-out -O%,$(FFLAGS)) |
b9d0a01d |
46 | CXXFLAGS := -g $(filter-out -O%,$(CXXLAGS)) |
b934f194 |
47 | CFLAGS := -g $(filter-out -O%,$(CLAGS)) |
48 | SOFLAGS := -g $(filter-out -O%,$(SOFLAGS)) |
49 | LDFLAGS := -g $(filter-out -O%,$(LDFLAGS)) |
b9d0a01d |
50 | endif |
51 | ################################################################## |
fe4da5cc |
52 | |
2d8cad5a |
53 | ################################################################## |
b934f194 |
54 | # |
2d8cad5a |
55 | # Check if called with profile |
56 | |
57 | ifeq ($(ALIPROFILE),YES) |
b934f194 |
58 | override ALICE_TARGET := $(ALICE_TARGET)PROF |
59 | FFLAGS += -pg |
2d8cad5a |
60 | CXXFLAGS += -pg |
b934f194 |
61 | CFLAGS += -pg |
62 | SOFLAGS += -pg |
63 | LDFLAGS += -pg |
2d8cad5a |
64 | endif |
65 | ################################################################## |
66 | |
b8f3fa00 |
67 | ################################################################## |
b934f194 |
68 | # |
b8f3fa00 |
69 | # check if DATE is installed |
70 | |
71 | ifdef DATE_ROOT |
b934f194 |
72 | DATEFLAGS = -DALI_DATE -D${DATE_SYS} -DDATE_SYS=${DATE_SYS} -Dlong32=${DATE_LONG32} -Dlong64=${DATE_LONG64} -DdatePointer=${DATE_POINTER} |
73 | CXXFLAGS += $(DATEFLAGS) |
74 | CFLAGS += $(DATEFLAGS) |
b8f3fa00 |
75 | CINTFLAGS += $(DATEFLAGS) |
b934f194 |
76 | DEPINC += $(DATEFLAGS) |
0a1aa611 |
77 | endif |
78 | ################################################################## |
79 | |
b9d0a01d |
80 | ################################################################## |
81 | # |
b934f194 |
82 | # Modules to build |
fe4da5cc |
83 | |
b9d0a01d |
84 | # Uncomment to show some output |
85 | #$(warning MAKECMDGOALS=$(MAKECMDGOALS)) |
fe4da5cc |
86 | |
b934f194 |
87 | ALIROOTMODULES := STEER PHOS TRD TPC ZDC MUON PMD FMD TOF ITS \ |
b9d0a01d |
88 | CRT RICH START STRUCT EVGEN RALICE ALIFAST VZERO \ |
1aa44b64 |
89 | THijing CONTAINERS MEVSIM TMEVSIM THbtp HBTP EMCAL HBTAN \ |
cfdc4533 |
90 | THerwig TEPEMGEN EPEMGEN FASTSIM TPHIC RAW MONITOR DISPLAY ANALYSIS \ |
15606e91 |
91 | JETAN HLT |
41f6cf69 |
92 | |
b934f194 |
93 | CERNMODULES := PDF PYTHIA6 HIJING MICROCERN HERWIG |
b9d0a01d |
94 | |
b934f194 |
95 | MODULES := $(ALIROOTMODULES) $(CERNMODULES) |
b9d0a01d |
96 | |
97 | ifeq ($(findstring TFluka,$(MAKECMDGOALS)),TFluka) |
98 | MODULES += TFluka |
99 | endif |
100 | |
2830f9fb |
101 | ifeq ($(findstring Flugg,$(MAKECMDGOALS)),Flugg) |
102 | MODULES += Flugg |
103 | endif |
b9d0a01d |
104 | |
105 | ################################################################## |
106 | |
b934f194 |
107 | MODULES += ALIROOT |
b9d0a01d |
108 | |
109 | MODDIRS := $(MODULES) |
110 | |
111 | ############################################################# |
b934f194 |
112 | # |
113 | # Default include dirs for |
114 | # C++, Fortran, Cint, and dependencies |
b9d0a01d |
115 | # The module directory will be added by each module |
116 | # |
117 | |
19ca05d1 |
118 | GENINC := -I$(ALICE_ROOT)/include -I$(shell root-config --incdir) |
b9d0a01d |
119 | |
19ca05d1 |
120 | CXXFLAGS += $(GENINC) |
121 | CXXFLAGSNO += $(GENINC) |
122 | CINTFLAGS += $(GENINC) |
123 | DEPINC += $(GENINC) |
b9d0a01d |
124 | |
b9d0a01d |
125 | ############################################################# |
126 | |
127 | |
128 | ############################################################# |
129 | # |
130 | # Libraries to link binaries against |
131 | # Libraries will be linked againstSHLIB |
132 | LIBS := $(GLIBS) $(ROOTLIBS) $(SYSLIBS) |
133 | ############################################################# |
134 | |
135 | |
136 | # default target |
137 | default: alilibs aliroot |
138 | |
139 | |
140 | ############################################################# |
141 | # |
142 | # Each module will add to this |
143 | |
144 | ALLLIBS := |
145 | ALLEXECS := |
146 | INCLUDEFILES := |
b934f194 |
147 | BINLIBS := |
148 | EXPORTFILES := |
b9d0a01d |
149 | ############################################################# |
150 | |
151 | BINLIBDIRS := -L$(ALICE_ROOT)/$(LIBPATH) |
152 | |
153 | |
154 | #Dependencies of module.mk files |
155 | |
156 | include build/module.dep |
157 | |
158 | ############################################################# |
b934f194 |
159 | # |
b9d0a01d |
160 | # Check if module.mk is present for the library |
161 | %.mk: build/module.tpl |
162 | ifndef ALIQUIET |
163 | @echo "***** Creating $@ file *****"; |
164 | endif |
165 | @share/alibtool mkmodule $(patsubst %/module.mk,%,$@) > $@; |
166 | ############################################################# |
167 | |
168 | # ************************************************************************** |
169 | # |
b934f194 |
170 | # If cleaning, do not include |
b9d0a01d |
171 | # dependencies or module.mk files. |
172 | |
2ea00b17 |
173 | ifeq ($(findstring $(MAKECMDGOALS), clean distclean clean-all clean-dicts clean-modules clean-depend clean-objects clean-libs clean-bins),) |
b9d0a01d |
174 | |
175 | # If making modules, not not include |
176 | # anything |
177 | |
178 | ifneq ($(findstring modules,$(MAKECMDGOALS)),modules) |
179 | |
180 | ############################################################# |
b934f194 |
181 | # |
b9d0a01d |
182 | # Include the modules |
b934f194 |
183 | -include $(patsubst %,%/module.mk,$(MODULES)) |
b9d0a01d |
184 | |
185 | # |
186 | # |
187 | ############################################################# |
188 | |
189 | ############################################################# |
190 | # |
191 | # include dependencies if not making them! |
192 | ifneq ($(MAKECMDGOALS),depend ) |
193 | # Don't include if cleaning of any sort |
194 | ifneq ($(findstring clean,$(MAKECMDGOALS)),clean) |
2830f9fb |
195 | #$(warning INCLUDEFILES=$(INCLUDEFILES)) |
776dc587 |
196 | -include $(INCLUDEFILES) |
b9d0a01d |
197 | endif |
198 | endif |
199 | ############################################################# |
200 | |
201 | endif |
202 | endif |
203 | # ************************************************************************** |
204 | |
205 | ############################################################# |
206 | # |
207 | # include dummy dependency file |
208 | # *MUST* be last includefile |
209 | include build/dummy.d |
210 | ############################################################# |
211 | |
212 | |
213 | # targets |
214 | |
2ea00b17 |
215 | .PHONY: alilibs aliroot makedistr clean distclean clean-all \ |
216 | htmldoc profile |
b9d0a01d |
217 | |
b934f194 |
218 | modules: $(patsubst %,%/module.mk,$(MODULES)) |
41f6cf69 |
219 | |
3e27ea2b |
220 | |
b9d0a01d |
221 | aliroot: $(BINPATH) $(ALLEXECS) alilibs bin |
3e27ea2b |
222 | |
2d8cad5a |
223 | ifeq ($(ALIPROFILE),YES) |
224 | alilibs: $(LIBPATH) $(ALLLIBS) $(ALLALIBS) lib modules |
225 | else |
b9d0a01d |
226 | alilibs: $(LIBPATH) $(ALLLIBS) lib modules |
2d8cad5a |
227 | endif |
41f6cf69 |
228 | |
b9d0a01d |
229 | # Single Makefile "distribution": Makefile + modules + mkdepend scripts |
b934f194 |
230 | makedistr: $(MODULES) |
b9d0a01d |
231 | tar -cvf MakeDistr.tar $(patsubst %,%/*.pkg,$(MODULES)) \ |
b934f194 |
232 | Makefile create build/* |
41f6cf69 |
233 | |
b9d0a01d |
234 | all: aliroot |
41f6cf69 |
235 | |
236 | |
b934f194 |
237 | depend: $(INCLUDEFILES) |
41f6cf69 |
238 | |
b9d0a01d |
239 | debug: |
240 | ifndef ALIQUIET |
241 | @echo "***** Entering DEBUG mode. *****" |
242 | endif |
243 | @(export ALIDEBUG=YES && $(MAKE)) |
b934f194 |
244 | |
2d8cad5a |
245 | profile: |
246 | ifndef ALIQUIET |
247 | @echo "***** Entering PROFILE mode. *****" |
248 | endif |
249 | @(export ALIPROFILE=YES && $(MAKE)) |
b934f194 |
250 | |
251 | lib: |
b9d0a01d |
252 | @mkdir lib |
253 | @mkdir lib/tgt_$(ALICE_TARGET) |
254 | |
b934f194 |
255 | bin: |
b9d0a01d |
256 | @mkdir bin |
257 | @mkdir bin/tgt_$(ALICE_TARGET) |
258 | |
259 | $(MODULES): |
260 | ifndef ALIQUIET |
261 | @echo "***** Making $@ *****" |
262 | endif |
263 | @mkdir -p $@ |
264 | |
265 | $(BINPATH): |
266 | ifndef ALIQUIET |
267 | @echo "***** Making $@ *****" |
268 | endif |
269 | @mkdir -p $@ |
270 | |
271 | $(LIBPATH): |
272 | ifndef ALIQUIET |
273 | @echo "***** Making $@ *****" |
274 | endif |
275 | @mkdir -p $@ |
276 | |
277 | build/dummy.d: $(EXPORTFILES) |
278 | @(if [ ! -f $@ ] ; then \ |
279 | touch $@; \ |
280 | fi) |
281 | |
282 | clean: |
2ea00b17 |
283 | @echo "***** No target clean, use one of these *****" |
b9d0a01d |
284 | @echo " clean-aliroot : Clean up all aliroot libraries" |
285 | @echo " clean-MODULENAME : Clean everything from module MODULENAME" |
286 | @echo " clean-all : Cleans up everything, including cern libraires" |
1aa44b64 |
287 | @echo " distclean : Like clean-all + clean all tgt_*'s" |
b934f194 |
288 | @echo " clean-modules : Clean all module.mk files in all modules" |
b9d0a01d |
289 | @echo " clean-libs : Clean all libraries (not object files)" |
290 | @echo "********************************************" |
291 | |
292 | clean-all: clean-modules clean-libs clean-bins |
293 | ifndef ALIQUIET |
294 | @echo "***** Cleaning up everything ****" |
295 | endif |
296 | $(MUTE)rm -rf $(patsubst %,%/tgt_$(ALICE_TARGET),$(MODULES)) |
297 | $(MUTE)rm -rf $(EXPORTDIR) |
298 | |
2ea00b17 |
299 | distclean: clean-all |
1aa44b64 |
300 | $(MUTE)rm -rf */tgt_* bin lib |
2ea00b17 |
301 | |
b9d0a01d |
302 | #This cleans only libraries that are not CERN-libraries |
303 | |
304 | clean-aliroot: $(patsubst %,%/module.mk,$(ALIROOTMODULES)) $(patsubst %,clean-%,$(ALIROOTMODULES)) |
305 | |
7e96fcc7 |
306 | CHECKMODULES := $(MODULES) |
2900fa57 |
307 | CHECKMODULES := $(filter-out HBTP,$(CHECKMODULES)) |
308 | CHECKMODULES := $(filter-out MEVSIM,$(CHECKMODULES)) |
309 | CHECKMODULES := $(filter-out EPEMGEN,$(CHECKMODULES)) |
0b5dd071 |
310 | CHECKMODULES := $(filter-out TPHIC,$(CHECKMODULES)) |
7e96fcc7 |
311 | CHECKMODULES := $(filter-out PDF,$(CHECKMODULES)) |
312 | CHECKMODULES := $(filter-out MICROCERN,$(CHECKMODULES)) |
b9d0a01d |
313 | |
b934f194 |
314 | check-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,check-%,$(CHECKMODULES)) |
b9d0a01d |
315 | |
b934f194 |
316 | reveng-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,reveng-%,$(CHECKMODULES)) |
b9d0a01d |
317 | |
b934f194 |
318 | revdisp-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,revdisp-%,$(CHECKMODULES)) |
b9d0a01d |
319 | |
320 | clean-dicts: |
321 | ifndef ALIQUIET |
322 | @echo "***** Cleaning up G__ files *****" |
323 | endif |
324 | $(MUTE)rm -rf */tgt_$(ALICE_TARGET)/G__* |
41f6cf69 |
325 | |
b9d0a01d |
326 | clean-modules: |
327 | ifndef ALIQUIET |
328 | @echo "***** Cleaning up module.mk files *****" |
329 | endif |
b934f194 |
330 | $(MUTE)rm -rf $(patsubst %,%/module.mk,$(MODULES)) |
41f6cf69 |
331 | |
b9d0a01d |
332 | clean-depend: |
333 | ifndef ALIQUIET |
334 | @echo "***** Cleaning up dependencies *****" |
335 | endif |
336 | $(MUTE)echo rm `find . -name "*.d"` |
337 | |
338 | clean-objects: |
339 | ifndef ALIQUIET |
340 | @echo "***** Cleaning up .o files *****" |
341 | endif |
342 | $(MUTE)echo rm `find . -name "*.o"` |
343 | |
344 | clean-libs: |
345 | ifndef ALIQUIET |
346 | @echo "***** Cleaning up library files *****" |
347 | endif |
348 | $(MUTE)rm -rf lib/tgt_$(ALICE_TARGET)/* |
349 | |
350 | clean-bins: |
351 | ifndef ALIQUIET |
352 | @echo "***** Cleaning up binary files *****" |
353 | endif |
354 | $(MUTE)rm -rf bin/tgt_$(ALICE_TARGET) |
d7a221d0 |
355 | |
b934f194 |
356 | clean-check-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,clean-check-%,$(CHECKMODULES)) |
ba546cfd |
357 | |
b934f194 |
358 | clean-reveng-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,clean-reveng-%,$(CHECKMODULES)) |
ba546cfd |
359 | |
d7a221d0 |
360 | htmldoc: |
361 | @rm -rf html/roothtml |
362 | @rm -f html/picts |
363 | @rm -f /tmp/macros |
364 | @cd html ;\ |
365 | aliroot -q -b "mkhtml.C(0,1)" ;\ |
366 | ls ../macros/*.C > /tmp/macros ;\ |
367 | for i in $(ALIROOTMODULES) ; do \ |
368 | ls ../$$i/*.C 2>/dev/null >> /tmp/macros ;\ |
369 | done ;\ |
370 | for i in `cat /tmp/macros` ; do \ |
371 | echo $$i ; \ |
372 | aliroot -b -q "mkhtml.C(\"$$i\")" > /dev/null ;\ |
373 | done ;\ |
374 | ./makeExampleList ; |
375 | @ln -s ../picts html/picts |
376 | @ln -s ../../picts html/roothtml/picts |
377 | @ln -s ../../../picts html/roothtml/src/picts |
378 | @ln -s ../../../picts html/roothtml/examples/picts |