Hardended the reconstruction process, have flags for switching of bench and cleaning.
[u/mrichter/AliRoot.git] / Makefile
CommitLineData
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 #####
8override ALICE_ROOT=$(shell pwd)
fe4da5cc 9
b9d0a01d 10ifdef ALIVERBOSE
11MUTE:=
12else
13MUTE:=@
14endif
fe4da5cc 15
b9d0a01d 16# IRST coding rule check
17IRST_INSTALLDIR=$(ALICE)/local/IRST
50a3b0ee 18IRST_CONFIG_DIR=$(IRST_INSTALLDIR)/userConfig/ALICE
b9d0a01d 19CLASSPATH=$(IRST_INSTALLDIR)
50a3b0ee 20export CLASSPATH IRST_INSTALLDIR IRST_CONFIG_DIR
b9d0a01d 21CODE_CHECK=java rules.ALICE.ALICERuleChecker
22REV_ENG=$(IRST_INSTALLDIR)/scripts/revEng.sh
fe4da5cc 23
fe4da5cc 24
b9d0a01d 25include build/Makefile.config
26##################################################################
27#
28# Where to install libraries and binaries
29# and common header files
47b969ba 30
b9d0a01d 31LIBPATH=lib/tgt_$(ALICE_TARGET)
32BINPATH=bin/tgt_$(ALICE_TARGET)
33EXPORTDIR = $(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 46ifeq ($(ALIDEBUG),YES)
47override ALICE_TARGET:=$(ALICE_TARGET)DEBUG
48FFLAGS := -g $(filter-out -O%,$(FFLAGS))
49CXXFLAGS := -g $(filter-out -O%,$(CXXLAGS))
50CFLAGS := -g $(filter-out -O%,$(CLAGS))
51SOFLAGS := -g $(filter-out -O%,$(SOFLAGS))
52LDFLAGS := -g $(filter-out -O%,$(LDFLAGS))
53endif
54##################################################################
fe4da5cc 55
2d8cad5a 56##################################################################
57#
58# Check if called with profile
59
60ifeq ($(ALIPROFILE),YES)
61override ALICE_TARGET:=$(ALICE_TARGET)PROF
62FFLAGS += -pg
63CXXFLAGS += -pg
64CFLAGS += -pg
65SOFLAGS += -pg
66LDFLAGS += -pg
67endif
68##################################################################
69
b8f3fa00 70##################################################################
71#
72# check if DATE is installed
73
74ifdef DATE_ROOT
75DATEFLAGS = -DALI_DATE -D${DATE_SYS} -DDATE_SYS=${DATE_SYS} -Dlong32=${DATE_LONG32} -Dlong64=${DATE_LONG64} -DdatePointer=${DATE_POINTER}
76CXXFLAGS += $(DATEFLAGS)
77CFLAGS += $(DATEFLAGS)
78CINTFLAGS += $(DATEFLAGS)
79DEPINC += $(DATEFLAGS)
0a1aa611 80endif
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 90ALIROOTMODULES:= 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 96CERNMODULES:= PDF PYTHIA6 HIJING MICROCERN HERWIG
b9d0a01d 97
98MODULES:=$(ALIROOTMODULES) $(CERNMODULES)
99
100ifeq ($(findstring TFluka,$(MAKECMDGOALS)),TFluka)
101MODULES += TFluka
102endif
103
2830f9fb 104ifeq ($(findstring Flugg,$(MAKECMDGOALS)),Flugg)
105MODULES += Flugg
106endif
b9d0a01d 107
108##################################################################
109
110MODULES += ALIROOT
111
112MODDIRS := $(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
121CXXFLAGS += -I$(ALICE_ROOT)/include
122CXXFLAGS += $(patsubst %,-I%,$(ROOTSYS)/include)
123
124CINTFLAGS += -I$(ALICE_ROOT)/include
125CINTFLAGS += $(patsubst %,-I%,$(ROOTSYS)/include)
126
127DEPINC += -I$(ALICE_ROOT)/include
128DEPINC += $(patsubst %,-I%,$(ROOTSYS)/include)
129#############################################################
130
131
132#############################################################
133#
134# Libraries to link binaries against
135# Libraries will be linked againstSHLIB
136LIBS := $(GLIBS) $(ROOTLIBS) $(SYSLIBS)
137#############################################################
138
139
140# default target
141default: alilibs aliroot
142
143
144#############################################################
145#
146# Each module will add to this
147
148ALLLIBS :=
149ALLEXECS :=
150INCLUDEFILES :=
151BINLIBS :=
152EXPORTFILES :=
153#############################################################
154
155BINLIBDIRS := -L$(ALICE_ROOT)/$(LIBPATH)
156
157
158#Dependencies of module.mk files
159
160include build/module.dep
161
162#############################################################
163#
164# Check if module.mk is present for the library
165%.mk: build/module.tpl
166ifndef ALIQUIET
167 @echo "***** Creating $@ file *****";
168endif
169 @share/alibtool mkmodule $(patsubst %/module.mk,%,$@) > $@;
170#############################################################
171
172# **************************************************************************
173#
174# If cleaning, do not include
175# dependencies or module.mk files.
176
177ifeq ($(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
182ifneq ($(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!
196ifneq ($(MAKECMDGOALS),depend )
197# Don't include if cleaning of any sort
198ifneq ($(findstring clean,$(MAKECMDGOALS)),clean)
2830f9fb 199#$(warning INCLUDEFILES=$(INCLUDEFILES))
776dc587 200-include $(INCLUDEFILES)
b9d0a01d 201endif
202endif
203#############################################################
204
205endif
206endif
207# **************************************************************************
208
209#############################################################
210#
211# include dummy dependency file
212# *MUST* be last includefile
213include build/dummy.d
214#############################################################
215
216
217# targets
218
2d8cad5a 219.PHONY: alilibs aliroot makedistr clean htmldoc profile
b9d0a01d 220
221modules: $(patsubst %,%/module.mk,$(MODULES))
41f6cf69 222
3e27ea2b 223
b9d0a01d 224aliroot: $(BINPATH) $(ALLEXECS) alilibs bin
3e27ea2b 225
2d8cad5a 226ifeq ($(ALIPROFILE),YES)
227alilibs: $(LIBPATH) $(ALLLIBS) $(ALLALIBS) lib modules
228else
b9d0a01d 229alilibs: $(LIBPATH) $(ALLLIBS) lib modules
2d8cad5a 230endif
41f6cf69 231
b9d0a01d 232# Single Makefile "distribution": Makefile + modules + mkdepend scripts
233makedistr: $(MODULES)
234 tar -cvf MakeDistr.tar $(patsubst %,%/*.pkg,$(MODULES)) \
235 Makefile create build/*
41f6cf69 236
b9d0a01d 237all: aliroot
41f6cf69 238
239
b9d0a01d 240depend: $(INCLUDEFILES)
41f6cf69 241
b9d0a01d 242debug:
243ifndef ALIQUIET
244 @echo "***** Entering DEBUG mode. *****"
245endif
246 @(export ALIDEBUG=YES && $(MAKE))
2d8cad5a 247profile:
248ifndef ALIQUIET
249 @echo "***** Entering PROFILE mode. *****"
250endif
251 @(export ALIPROFILE=YES && $(MAKE))
b9d0a01d 252lib:
253 @mkdir lib
254 @mkdir lib/tgt_$(ALICE_TARGET)
255
256bin:
257 @mkdir bin
258 @mkdir bin/tgt_$(ALICE_TARGET)
259
260$(MODULES):
261ifndef ALIQUIET
262 @echo "***** Making $@ *****"
263endif
264 @mkdir -p $@
265
266$(BINPATH):
267ifndef ALIQUIET
268 @echo "***** Making $@ *****"
269endif
270 @mkdir -p $@
271
272$(LIBPATH):
273ifndef ALIQUIET
274 @echo "***** Making $@ *****"
275endif
276 @mkdir -p $@
277
278build/dummy.d: $(EXPORTFILES)
279 @(if [ ! -f $@ ] ; then \
280 touch $@; \
281 fi)
282
283clean:
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
292clean-all: clean-modules clean-libs clean-bins
293ifndef ALIQUIET
294 @echo "***** Cleaning up everything ****"
295endif
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
301clean-aliroot: $(patsubst %,%/module.mk,$(ALIROOTMODULES)) $(patsubst %,clean-%,$(ALIROOTMODULES))
302
7e96fcc7 303CHECKMODULES := $(MODULES)
2900fa57 304CHECKMODULES := $(filter-out HBTP,$(CHECKMODULES))
305CHECKMODULES := $(filter-out MEVSIM,$(CHECKMODULES))
306CHECKMODULES := $(filter-out EPEMGEN,$(CHECKMODULES))
0b5dd071 307CHECKMODULES := $(filter-out TPHIC,$(CHECKMODULES))
7e96fcc7 308CHECKMODULES := $(filter-out PDF,$(CHECKMODULES))
309CHECKMODULES := $(filter-out MICROCERN,$(CHECKMODULES))
b9d0a01d 310
311check-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,check-%,$(CHECKMODULES))
312
313reveng-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,reveng-%,$(CHECKMODULES))
314
315revdisp-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,revdisp-%,$(CHECKMODULES))
316
317clean-dicts:
318ifndef ALIQUIET
319 @echo "***** Cleaning up G__ files *****"
320endif
321 $(MUTE)rm -rf */tgt_$(ALICE_TARGET)/G__*
41f6cf69 322
b9d0a01d 323clean-modules:
324ifndef ALIQUIET
325 @echo "***** Cleaning up module.mk files *****"
326endif
327 $(MUTE)rm -rf $(patsubst %,%/module.mk,$(MODULES))
41f6cf69 328
b9d0a01d 329clean-depend:
330ifndef ALIQUIET
331 @echo "***** Cleaning up dependencies *****"
332endif
333 $(MUTE)echo rm `find . -name "*.d"`
334
335clean-objects:
336ifndef ALIQUIET
337 @echo "***** Cleaning up .o files *****"
338endif
339 $(MUTE)echo rm `find . -name "*.o"`
340
341clean-libs:
342ifndef ALIQUIET
343 @echo "***** Cleaning up library files *****"
344endif
345 $(MUTE)rm -rf lib/tgt_$(ALICE_TARGET)/*
346
347clean-bins:
348ifndef ALIQUIET
349 @echo "***** Cleaning up binary files *****"
350endif
351 $(MUTE)rm -rf bin/tgt_$(ALICE_TARGET)
d7a221d0 352
ba546cfd 353clean-check-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,clean-check-%,$(CHECKMODULES))
354
355clean-reveng-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,clean-reveng-%,$(CHECKMODULES))
356
d7a221d0 357htmldoc:
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