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 | ##### include general path/location macros ##### |
8 | override ALICE_ROOT=$(shell pwd) |
fe4da5cc |
9 | |
b9d0a01d |
10 | ifdef ALIVERBOSE |
11 | MUTE:= |
12 | else |
13 | MUTE:=@ |
14 | endif |
fe4da5cc |
15 | |
b9d0a01d |
16 | # IRST coding rule check |
17 | IRST_INSTALLDIR=$(ALICE)/local/IRST |
50a3b0ee |
18 | IRST_CONFIG_DIR=$(IRST_INSTALLDIR)/userConfig/ALICE |
b9d0a01d |
19 | CLASSPATH=$(IRST_INSTALLDIR) |
50a3b0ee |
20 | export CLASSPATH IRST_INSTALLDIR IRST_CONFIG_DIR |
b9d0a01d |
21 | CODE_CHECK=java rules.ALICE.ALICERuleChecker |
22 | REV_ENG=$(IRST_INSTALLDIR)/scripts/revEng.sh |
fe4da5cc |
23 | |
fe4da5cc |
24 | |
b9d0a01d |
25 | include build/Makefile.config |
26 | ################################################################## |
27 | # |
28 | # Where to install libraries and binaries |
29 | # and common header files |
47b969ba |
30 | |
b9d0a01d |
31 | LIBPATH=lib/tgt_$(ALICE_TARGET) |
32 | BINPATH=bin/tgt_$(ALICE_TARGET) |
33 | EXPORTDIR = $(ALICE_ROOT)/include |
34 | ################################################################## |
47b969ba |
35 | |
b9d0a01d |
36 | ################################################################## |
37 | # include machine dependent macros |
fe4da5cc |
38 | |
b9d0a01d |
39 | -include build/Makefile.$(ALICE_TARGET) |
40 | ################################################################## |
fe4da5cc |
41 | |
b9d0a01d |
42 | ################################################################## |
43 | # |
44 | # Check if called with debug |
42865053 |
45 | |
b9d0a01d |
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 | ################################################################## |
fe4da5cc |
55 | |
2d8cad5a |
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 | |
0a1aa611 |
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 | |
b9d0a01d |
85 | ################################################################## |
86 | # |
87 | # Modules to build |
fe4da5cc |
88 | |
b9d0a01d |
89 | # Uncomment to show some output |
90 | #$(warning MAKECMDGOALS=$(MAKECMDGOALS)) |
fe4da5cc |
91 | |
b9d0a01d |
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 \ |
a1fae439 |
95 | THerwig TEPEMGEN EPEMGEN FASTSIM TPHIC RAW MONITOR |
41f6cf69 |
96 | |
c7fd5c1c |
97 | CERNMODULES:= PDF PYTHIA6 HIJING MICROCERN HERWIG |
b9d0a01d |
98 | |
99 | MODULES:=$(ALIROOTMODULES) $(CERNMODULES) |
100 | |
101 | ifeq ($(findstring TFluka,$(MAKECMDGOALS)),TFluka) |
102 | MODULES += TFluka |
103 | endif |
104 | |
2830f9fb |
105 | ifeq ($(findstring Flugg,$(MAKECMDGOALS)),Flugg) |
106 | MODULES += Flugg |
107 | endif |
b9d0a01d |
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) |
2830f9fb |
200 | #$(warning INCLUDEFILES=$(INCLUDEFILES)) |
776dc587 |
201 | -include $(INCLUDEFILES) |
b9d0a01d |
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 | |
2d8cad5a |
220 | .PHONY: alilibs aliroot makedistr clean htmldoc profile |
b9d0a01d |
221 | |
222 | modules: $(patsubst %,%/module.mk,$(MODULES)) |
41f6cf69 |
223 | |
3e27ea2b |
224 | |
b9d0a01d |
225 | aliroot: $(BINPATH) $(ALLEXECS) alilibs bin |
3e27ea2b |
226 | |
2d8cad5a |
227 | ifeq ($(ALIPROFILE),YES) |
228 | alilibs: $(LIBPATH) $(ALLLIBS) $(ALLALIBS) lib modules |
229 | else |
b9d0a01d |
230 | alilibs: $(LIBPATH) $(ALLLIBS) lib modules |
2d8cad5a |
231 | endif |
41f6cf69 |
232 | |
b9d0a01d |
233 | # Single Makefile "distribution": Makefile + modules + mkdepend scripts |
234 | makedistr: $(MODULES) |
235 | tar -cvf MakeDistr.tar $(patsubst %,%/*.pkg,$(MODULES)) \ |
236 | Makefile create build/* |
41f6cf69 |
237 | |
b9d0a01d |
238 | all: aliroot |
41f6cf69 |
239 | |
240 | |
b9d0a01d |
241 | depend: $(INCLUDEFILES) |
41f6cf69 |
242 | |
b9d0a01d |
243 | debug: |
244 | ifndef ALIQUIET |
245 | @echo "***** Entering DEBUG mode. *****" |
246 | endif |
247 | @(export ALIDEBUG=YES && $(MAKE)) |
2d8cad5a |
248 | profile: |
249 | ifndef ALIQUIET |
250 | @echo "***** Entering PROFILE mode. *****" |
251 | endif |
252 | @(export ALIPROFILE=YES && $(MAKE)) |
b9d0a01d |
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 | |
7e96fcc7 |
304 | CHECKMODULES := $(MODULES) |
2900fa57 |
305 | CHECKMODULES := $(filter-out HBTP,$(CHECKMODULES)) |
306 | CHECKMODULES := $(filter-out MEVSIM,$(CHECKMODULES)) |
307 | CHECKMODULES := $(filter-out EPEMGEN,$(CHECKMODULES)) |
0b5dd071 |
308 | CHECKMODULES := $(filter-out TPHIC,$(CHECKMODULES)) |
7e96fcc7 |
309 | CHECKMODULES := $(filter-out PDF,$(CHECKMODULES)) |
310 | CHECKMODULES := $(filter-out MICROCERN,$(CHECKMODULES)) |
b9d0a01d |
311 | |
312 | check-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,check-%,$(CHECKMODULES)) |
313 | |
314 | reveng-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,reveng-%,$(CHECKMODULES)) |
315 | |
316 | revdisp-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,revdisp-%,$(CHECKMODULES)) |
317 | |
318 | clean-dicts: |
319 | ifndef ALIQUIET |
320 | @echo "***** Cleaning up G__ files *****" |
321 | endif |
322 | $(MUTE)rm -rf */tgt_$(ALICE_TARGET)/G__* |
41f6cf69 |
323 | |
b9d0a01d |
324 | clean-modules: |
325 | ifndef ALIQUIET |
326 | @echo "***** Cleaning up module.mk files *****" |
327 | endif |
328 | $(MUTE)rm -rf $(patsubst %,%/module.mk,$(MODULES)) |
41f6cf69 |
329 | |
b9d0a01d |
330 | clean-depend: |
331 | ifndef ALIQUIET |
332 | @echo "***** Cleaning up dependencies *****" |
333 | endif |
334 | $(MUTE)echo rm `find . -name "*.d"` |
335 | |
336 | clean-objects: |
337 | ifndef ALIQUIET |
338 | @echo "***** Cleaning up .o files *****" |
339 | endif |
340 | $(MUTE)echo rm `find . -name "*.o"` |
341 | |
342 | clean-libs: |
343 | ifndef ALIQUIET |
344 | @echo "***** Cleaning up library files *****" |
345 | endif |
346 | $(MUTE)rm -rf lib/tgt_$(ALICE_TARGET)/* |
347 | |
348 | clean-bins: |
349 | ifndef ALIQUIET |
350 | @echo "***** Cleaning up binary files *****" |
351 | endif |
352 | $(MUTE)rm -rf bin/tgt_$(ALICE_TARGET) |
d7a221d0 |
353 | |
ba546cfd |
354 | clean-check-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,clean-check-%,$(CHECKMODULES)) |
355 | |
356 | clean-reveng-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,clean-reveng-%,$(CHECKMODULES)) |
357 | |
d7a221d0 |
358 | htmldoc: |
359 | @rm -rf html/roothtml |
360 | @rm -f html/picts |
361 | @rm -f /tmp/macros |
362 | @cd html ;\ |
363 | aliroot -q -b "mkhtml.C(0,1)" ;\ |
364 | ls ../macros/*.C > /tmp/macros ;\ |
365 | for i in $(ALIROOTMODULES) ; do \ |
366 | ls ../$$i/*.C 2>/dev/null >> /tmp/macros ;\ |
367 | done ;\ |
368 | for i in `cat /tmp/macros` ; do \ |
369 | echo $$i ; \ |
370 | aliroot -b -q "mkhtml.C(\"$$i\")" > /dev/null ;\ |
371 | done ;\ |
372 | ./makeExampleList ; |
373 | @ln -s ../picts html/picts |
374 | @ln -s ../../picts html/roothtml/picts |
375 | @ln -s ../../../picts html/roothtml/src/picts |
376 | @ln -s ../../../picts html/roothtml/examples/picts |