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