]>
Commit | Line | Data |
---|---|---|
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 | ||
b8f3fa00 | 70 | ################################################################## |
71 | # | |
72 | # check if DATE is installed | |
73 | ||
74 | ifdef DATE_ROOT | |
75 | DATEFLAGS = -DALI_DATE -D${DATE_SYS} -DDATE_SYS=${DATE_SYS} -Dlong32=${DATE_LONG32} -Dlong64=${DATE_LONG64} -DdatePointer=${DATE_POINTER} | |
76 | CXXFLAGS += $(DATEFLAGS) | |
77 | CFLAGS += $(DATEFLAGS) | |
78 | CINTFLAGS += $(DATEFLAGS) | |
79 | DEPINC += $(DATEFLAGS) | |
0a1aa611 | 80 | endif |
81 | ################################################################## | |
82 | ||
b9d0a01d | 83 | ################################################################## |
84 | # | |
85 | # Modules to build | |
fe4da5cc | 86 | |
b9d0a01d | 87 | # Uncomment to show some output |
88 | #$(warning MAKECMDGOALS=$(MAKECMDGOALS)) | |
fe4da5cc | 89 | |
b9d0a01d | 90 | ALIROOTMODULES:= STEER PHOS TRD TPC ZDC MUON PMD FMD TOF ITS \ |
91 | CRT RICH START STRUCT EVGEN RALICE ALIFAST VZERO \ | |
92 | THijing CONTAINERS MEVSIM TMEVSIM THbtp HBTP EMCAL HBTAN \ | |
cfdc4533 | 93 | THerwig TEPEMGEN EPEMGEN FASTSIM TPHIC RAW MONITOR DISPLAY ANALYSIS \ |
94 | JETAN HLT | |
41f6cf69 | 95 | |
c7fd5c1c | 96 | CERNMODULES:= PDF PYTHIA6 HIJING MICROCERN HERWIG |
b9d0a01d | 97 | |
98 | MODULES:=$(ALIROOTMODULES) $(CERNMODULES) | |
99 | ||
100 | ifeq ($(findstring TFluka,$(MAKECMDGOALS)),TFluka) | |
101 | MODULES += TFluka | |
102 | endif | |
103 | ||
2830f9fb | 104 | ifeq ($(findstring Flugg,$(MAKECMDGOALS)),Flugg) |
105 | MODULES += Flugg | |
106 | endif | |
b9d0a01d | 107 | |
108 | ################################################################## | |
109 | ||
110 | MODULES += ALIROOT | |
111 | ||
112 | MODDIRS := $(MODULES) | |
113 | ||
114 | ############################################################# | |
115 | # | |
116 | # Default include dirs for | |
117 | # C++, Fortran, Cint, and dependencies | |
118 | # The module directory will be added by each module | |
119 | # | |
120 | ||
121 | CXXFLAGS += -I$(ALICE_ROOT)/include | |
122 | CXXFLAGS += $(patsubst %,-I%,$(ROOTSYS)/include) | |
123 | ||
124 | CINTFLAGS += -I$(ALICE_ROOT)/include | |
125 | CINTFLAGS += $(patsubst %,-I%,$(ROOTSYS)/include) | |
126 | ||
127 | DEPINC += -I$(ALICE_ROOT)/include | |
128 | DEPINC += $(patsubst %,-I%,$(ROOTSYS)/include) | |
129 | ############################################################# | |
130 | ||
131 | ||
132 | ############################################################# | |
133 | # | |
134 | # Libraries to link binaries against | |
135 | # Libraries will be linked againstSHLIB | |
136 | LIBS := $(GLIBS) $(ROOTLIBS) $(SYSLIBS) | |
137 | ############################################################# | |
138 | ||
139 | ||
140 | # default target | |
141 | default: alilibs aliroot | |
142 | ||
143 | ||
144 | ############################################################# | |
145 | # | |
146 | # Each module will add to this | |
147 | ||
148 | ALLLIBS := | |
149 | ALLEXECS := | |
150 | INCLUDEFILES := | |
151 | BINLIBS := | |
152 | EXPORTFILES := | |
153 | ############################################################# | |
154 | ||
155 | BINLIBDIRS := -L$(ALICE_ROOT)/$(LIBPATH) | |
156 | ||
157 | ||
158 | #Dependencies of module.mk files | |
159 | ||
160 | include build/module.dep | |
161 | ||
162 | ############################################################# | |
163 | # | |
164 | # Check if module.mk is present for the library | |
165 | %.mk: build/module.tpl | |
166 | ifndef ALIQUIET | |
167 | @echo "***** Creating $@ file *****"; | |
168 | endif | |
169 | @share/alibtool mkmodule $(patsubst %/module.mk,%,$@) > $@; | |
170 | ############################################################# | |
171 | ||
172 | # ************************************************************************** | |
173 | # | |
174 | # If cleaning, do not include | |
175 | # dependencies or module.mk files. | |
176 | ||
177 | ifeq ($(findstring $(MAKECMDGOALS), clean clean-all clean-dicts clean-modules clean-depend clean-objects clean-libs clean-bins),) | |
178 | ||
179 | # If making modules, not not include | |
180 | # anything | |
181 | ||
182 | ifneq ($(findstring modules,$(MAKECMDGOALS)),modules) | |
183 | ||
184 | ############################################################# | |
185 | # | |
186 | # Include the modules | |
187 | -include $(patsubst %,%/module.mk,$(MODULES)) | |
188 | ||
189 | # | |
190 | # | |
191 | ############################################################# | |
192 | ||
193 | ############################################################# | |
194 | # | |
195 | # include dependencies if not making them! | |
196 | ifneq ($(MAKECMDGOALS),depend ) | |
197 | # Don't include if cleaning of any sort | |
198 | ifneq ($(findstring clean,$(MAKECMDGOALS)),clean) | |
2830f9fb | 199 | #$(warning INCLUDEFILES=$(INCLUDEFILES)) |
776dc587 | 200 | -include $(INCLUDEFILES) |
b9d0a01d | 201 | endif |
202 | endif | |
203 | ############################################################# | |
204 | ||
205 | endif | |
206 | endif | |
207 | # ************************************************************************** | |
208 | ||
209 | ############################################################# | |
210 | # | |
211 | # include dummy dependency file | |
212 | # *MUST* be last includefile | |
213 | include build/dummy.d | |
214 | ############################################################# | |
215 | ||
216 | ||
217 | # targets | |
218 | ||
2d8cad5a | 219 | .PHONY: alilibs aliroot makedistr clean htmldoc profile |
b9d0a01d | 220 | |
221 | modules: $(patsubst %,%/module.mk,$(MODULES)) | |
41f6cf69 | 222 | |
3e27ea2b | 223 | |
b9d0a01d | 224 | aliroot: $(BINPATH) $(ALLEXECS) alilibs bin |
3e27ea2b | 225 | |
2d8cad5a | 226 | ifeq ($(ALIPROFILE),YES) |
227 | alilibs: $(LIBPATH) $(ALLLIBS) $(ALLALIBS) lib modules | |
228 | else | |
b9d0a01d | 229 | alilibs: $(LIBPATH) $(ALLLIBS) lib modules |
2d8cad5a | 230 | endif |
41f6cf69 | 231 | |
b9d0a01d | 232 | # Single Makefile "distribution": Makefile + modules + mkdepend scripts |
233 | makedistr: $(MODULES) | |
234 | tar -cvf MakeDistr.tar $(patsubst %,%/*.pkg,$(MODULES)) \ | |
235 | Makefile create build/* | |
41f6cf69 | 236 | |
b9d0a01d | 237 | all: aliroot |
41f6cf69 | 238 | |
239 | ||
b9d0a01d | 240 | depend: $(INCLUDEFILES) |
41f6cf69 | 241 | |
b9d0a01d | 242 | debug: |
243 | ifndef ALIQUIET | |
244 | @echo "***** Entering DEBUG mode. *****" | |
245 | endif | |
246 | @(export ALIDEBUG=YES && $(MAKE)) | |
2d8cad5a | 247 | profile: |
248 | ifndef ALIQUIET | |
249 | @echo "***** Entering PROFILE mode. *****" | |
250 | endif | |
251 | @(export ALIPROFILE=YES && $(MAKE)) | |
b9d0a01d | 252 | lib: |
253 | @mkdir lib | |
254 | @mkdir lib/tgt_$(ALICE_TARGET) | |
255 | ||
256 | bin: | |
257 | @mkdir bin | |
258 | @mkdir bin/tgt_$(ALICE_TARGET) | |
259 | ||
260 | $(MODULES): | |
261 | ifndef ALIQUIET | |
262 | @echo "***** Making $@ *****" | |
263 | endif | |
264 | @mkdir -p $@ | |
265 | ||
266 | $(BINPATH): | |
267 | ifndef ALIQUIET | |
268 | @echo "***** Making $@ *****" | |
269 | endif | |
270 | @mkdir -p $@ | |
271 | ||
272 | $(LIBPATH): | |
273 | ifndef ALIQUIET | |
274 | @echo "***** Making $@ *****" | |
275 | endif | |
276 | @mkdir -p $@ | |
277 | ||
278 | build/dummy.d: $(EXPORTFILES) | |
279 | @(if [ ! -f $@ ] ; then \ | |
280 | touch $@; \ | |
281 | fi) | |
282 | ||
283 | clean: | |
284 | @echo "***** No targen clean, use one of these *****" | |
285 | @echo " clean-aliroot : Clean up all aliroot libraries" | |
286 | @echo " clean-MODULENAME : Clean everything from module MODULENAME" | |
287 | @echo " clean-all : Cleans up everything, including cern libraires" | |
288 | @echo " clean-modules : Clean all module.mk file in all modules" | |
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 | ||
299 | #This cleans only libraries that are not CERN-libraries | |
300 | ||
301 | clean-aliroot: $(patsubst %,%/module.mk,$(ALIROOTMODULES)) $(patsubst %,clean-%,$(ALIROOTMODULES)) | |
302 | ||
7e96fcc7 | 303 | CHECKMODULES := $(MODULES) |
2900fa57 | 304 | CHECKMODULES := $(filter-out HBTP,$(CHECKMODULES)) |
305 | CHECKMODULES := $(filter-out MEVSIM,$(CHECKMODULES)) | |
306 | CHECKMODULES := $(filter-out EPEMGEN,$(CHECKMODULES)) | |
0b5dd071 | 307 | CHECKMODULES := $(filter-out TPHIC,$(CHECKMODULES)) |
7e96fcc7 | 308 | CHECKMODULES := $(filter-out PDF,$(CHECKMODULES)) |
309 | CHECKMODULES := $(filter-out MICROCERN,$(CHECKMODULES)) | |
b9d0a01d | 310 | |
311 | check-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,check-%,$(CHECKMODULES)) | |
312 | ||
313 | reveng-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,reveng-%,$(CHECKMODULES)) | |
314 | ||
315 | revdisp-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,revdisp-%,$(CHECKMODULES)) | |
316 | ||
317 | clean-dicts: | |
318 | ifndef ALIQUIET | |
319 | @echo "***** Cleaning up G__ files *****" | |
320 | endif | |
321 | $(MUTE)rm -rf */tgt_$(ALICE_TARGET)/G__* | |
41f6cf69 | 322 | |
b9d0a01d | 323 | clean-modules: |
324 | ifndef ALIQUIET | |
325 | @echo "***** Cleaning up module.mk files *****" | |
326 | endif | |
327 | $(MUTE)rm -rf $(patsubst %,%/module.mk,$(MODULES)) | |
41f6cf69 | 328 | |
b9d0a01d | 329 | clean-depend: |
330 | ifndef ALIQUIET | |
331 | @echo "***** Cleaning up dependencies *****" | |
332 | endif | |
333 | $(MUTE)echo rm `find . -name "*.d"` | |
334 | ||
335 | clean-objects: | |
336 | ifndef ALIQUIET | |
337 | @echo "***** Cleaning up .o files *****" | |
338 | endif | |
339 | $(MUTE)echo rm `find . -name "*.o"` | |
340 | ||
341 | clean-libs: | |
342 | ifndef ALIQUIET | |
343 | @echo "***** Cleaning up library files *****" | |
344 | endif | |
345 | $(MUTE)rm -rf lib/tgt_$(ALICE_TARGET)/* | |
346 | ||
347 | clean-bins: | |
348 | ifndef ALIQUIET | |
349 | @echo "***** Cleaning up binary files *****" | |
350 | endif | |
351 | $(MUTE)rm -rf bin/tgt_$(ALICE_TARGET) | |
d7a221d0 | 352 | |
ba546cfd | 353 | clean-check-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,clean-check-%,$(CHECKMODULES)) |
354 | ||
355 | clean-reveng-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,clean-reveng-%,$(CHECKMODULES)) | |
356 | ||
d7a221d0 | 357 | htmldoc: |
358 | @rm -rf html/roothtml | |
359 | @rm -f html/picts | |
360 | @rm -f /tmp/macros | |
361 | @cd html ;\ | |
362 | aliroot -q -b "mkhtml.C(0,1)" ;\ | |
363 | ls ../macros/*.C > /tmp/macros ;\ | |
364 | for i in $(ALIROOTMODULES) ; do \ | |
365 | ls ../$$i/*.C 2>/dev/null >> /tmp/macros ;\ | |
366 | done ;\ | |
367 | for i in `cat /tmp/macros` ; do \ | |
368 | echo $$i ; \ | |
369 | aliroot -b -q "mkhtml.C(\"$$i\")" > /dev/null ;\ | |
370 | done ;\ | |
371 | ./makeExampleList ; | |
372 | @ln -s ../picts html/picts | |
373 | @ln -s ../../picts html/roothtml/picts | |
374 | @ln -s ../../../picts html/roothtml/src/picts | |
375 | @ln -s ../../../picts html/roothtml/examples/picts |