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