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