Updated PaintContour() method
[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
462ee303 6# /* $Id$ */
fe4da5cc 7
b9d0a01d 8ifdef ALIVERBOSE
9MUTE:=
10else
11MUTE:=@
12endif
fe4da5cc 13
8d7652bd 14CLEAN=$(findstring clean,$(MAKECMDGOALS))
bdfb9593 15
462ee303 16#-------------------------------------------------------------------------------
b9d0a01d 17# IRST coding rule check
462ee303 18
b9d0a01d 19IRST_INSTALLDIR=$(ALICE)/local/IRST
50a3b0ee 20IRST_CONFIG_DIR=$(IRST_INSTALLDIR)/userConfig/ALICE
b9d0a01d 21CLASSPATH=$(IRST_INSTALLDIR)
50a3b0ee 22export CLASSPATH IRST_INSTALLDIR IRST_CONFIG_DIR
b9d0a01d 23CODE_CHECK=java rules.ALICE.ALICERuleChecker
24REV_ENG=$(IRST_INSTALLDIR)/scripts/revEng.sh
fe4da5cc 25
67f2eee7 26SMELL_DETECTOR_DIR=$(IRST_INSTALLDIR)/smell-detector
118c0ae6 27
28
462ee303 29#-------------------------------------------------------------------------------
462ee303 30# Include machine dependent macros
fe4da5cc 31
b9d0a01d 32-include build/Makefile.$(ALICE_TARGET)
fe4da5cc 33
462ee303 34#-------------------------------------------------------------------------------
35# Check if called with debug
42865053 36
b9d0a01d 37ifeq ($(ALIDEBUG),YES)
b934f194 38override ALICE_TARGET := $(ALICE_TARGET)DEBUG
39FFLAGS := -g $(filter-out -O%,$(FFLAGS))
4448d4ac 40CXXFLAGS := -g $(filter-out -O%,$(CXXFLAGS))
41CFLAGS := -g $(filter-out -O%,$(CFLAGS))
b934f194 42SOFLAGS := -g $(filter-out -O%,$(SOFLAGS))
43LDFLAGS := -g $(filter-out -O%,$(LDFLAGS))
b9d0a01d 44endif
fe4da5cc 45
462ee303 46#-------------------------------------------------------------------------------
47# Check if called with profile
2d8cad5a 48
49ifeq ($(ALIPROFILE),YES)
b934f194 50override ALICE_TARGET := $(ALICE_TARGET)PROF
51FFLAGS += -pg
2d8cad5a 52CXXFLAGS += -pg
b934f194 53CFLAGS += -pg
54SOFLAGS += -pg
55LDFLAGS += -pg
2d8cad5a 56endif
2d8cad5a 57
462ee303 58#-------------------------------------------------------------------------------
59# Check if DATE is installed
b8f3fa00 60
61ifdef DATE_ROOT
462ee303 62DATEFLAGS = -DALI_DATE -D${DATE_SYS} -DDATE_SYS=${DATE_SYS} -Dlong32=${DATE_LONG32} \
bf25155c 63 -Dlong64='${DATE_LONG64}' -DdatePointer=${DATE_POINTER} -I${DATE_COMMON_DEFS}
b934f194 64CXXFLAGS += $(DATEFLAGS)
65CFLAGS += $(DATEFLAGS)
b8f3fa00 66CINTFLAGS += $(DATEFLAGS)
e506ace2 67DEPINC += $(DATEFLAGS)
68else
8c50acf2 69DATEFLAGS = -D`uname` -DDATE_SYS=`uname` -Dlong32='int' \
e506ace2 70 -Dlong64='long long' -DdatePointer='long'
71CXXFLAGS += $(DATEFLAGS)
72CFLAGS += $(DATEFLAGS)
73CINTFLAGS += $(DATEFLAGS)
b934f194 74DEPINC += $(DATEFLAGS)
0a1aa611 75endif
0a1aa611 76
462ee303 77#-------------------------------------------------------------------------------
e44bc3df 78# Location where to install libraries and binaries and common header files
79
80LIBPATH := lib/tgt_$(ALICE_TARGET)
81BINPATH := bin/tgt_$(ALICE_TARGET)
82EXPORTDIR := $(ALICE_ROOT)/include
83BINLIBDIRS := -L$(ALICE_ROOT)/$(LIBPATH)
84
85#-------------------------------------------------------------------------------
462ee303 86# Modules to build
fe4da5cc 87
e3642d02 88ifeq (ALIVERBOSE,2)
462ee303 89$(warning MAKECMDGOALS=$(MAKECMDGOALS))
90endif
fe4da5cc 91
b934f194 92ALIROOTMODULES := STEER PHOS TRD TPC ZDC MUON PMD FMD TOF ITS \
b384f8a4 93 ACORDE HMPID T0 STRUCT EVGEN RALICE VZERO \
e756ece8 94 THijing MEVSIM TMEVSIM THbtp HBTP EMCAL HBTAN \
92b443ef 95 THerwig TEPEMGEN EPEMGEN FASTSIM TPHIC RAW MONITOR ANALYSIS \
00b2559b 96 JETAN HLT LHC ESDCheck EVE
41f6cf69 97
b9d0a01d 98ifeq ($(findstring TFluka,$(MAKECMDGOALS)),TFluka)
462ee303 99ALIROOTMODULES += TFluka
b9d0a01d 100endif
101
18d2e4ee 102ifeq ($(findstring PWG0,$(MAKECMDGOALS)),PWG0)
103ALIROOTMODULES += PWG0
104endif
105
04d2c4d5 106ifeq ($(findstring PWG2,$(MAKECMDGOALS)),PWG2)
107ALIROOTMODULES += PWG2
108endif
109
f3fc258a 110ifeq ($(findstring PWG3,$(MAKECMDGOALS)),PWG3)
111ALIROOTMODULES += PWG3
112endif
113
739baceb 114ifeq ($(findstring PWG4,$(MAKECMDGOALS)),PWG4)
115ALIROOTMODULES += PWG4
116endif
117
18d2e4ee 118ifeq ($(findstring SHUTTLE,$(MAKECMDGOALS)),SHUTTLE)
119ALIROOTMODULES += SHUTTLE
120endif
121
2830f9fb 122ifeq ($(findstring Flugg,$(MAKECMDGOALS)),Flugg)
462ee303 123ALIROOTMODULES += Flugg
2830f9fb 124endif
b9d0a01d 125
af4ebdd2 126CERNMODULES := LHAPDF PYTHIA6 HIJING MICROCERN HERWIG
b9d0a01d 127
462ee303 128MODULES := $(ALIROOTMODULES) $(CERNMODULES) ALIROOT
b9d0a01d 129
130MODDIRS := $(MODULES)
131
462ee303 132#-------------------------------------------------------------------------------
133# Default include dirs for C++, Fortran, Cint, and dependencies
134# The module directory will be added by each module
b9d0a01d 135
19ca05d1 136GENINC := -I$(ALICE_ROOT)/include -I$(shell root-config --incdir)
19ca05d1 137CXXFLAGS += $(GENINC)
138CXXFLAGSNO += $(GENINC)
139CINTFLAGS += $(GENINC)
140DEPINC += $(GENINC)
b9d0a01d 141
462ee303 142#-------------------------------------------------------------------------------
143# Libraries to link binaries against
144# Libraries will be linked against SHLIB
de6c7cfd 145# ROOT libraries
146
e9f631d2 147ROOTCLIBS := $(shell root-config --glibs) -lThread -lMinuit -lHtml -lVMC -lEG -lGeom -lTreePlayer -lXMLIO
b9d0a01d 148
3df2764f 149ROOTPLIBS := -lEGPythia6
de6c7cfd 150
151ALILIBS := -L$(LIBDIR) -lMUON -lTPC -lPMD -lTRD -lFMD -lTOF \
b384f8a4 152 -lITS -lPHOS -lACORDE -lHMPID -lVZERO -lZDC -lSTRUCT \
ababa197 153 -lT0 -lEVGEN -lSTEER
de6c7cfd 154
155LIBS := $(ROOTCLIBS) $(ROOTPLIBS) $(SYSLIBS)
b9d0a01d 156
462ee303 157#-------------------------------------------------------------------------------
b9d0a01d 158# default target
462ee303 159
4dc83bdb 160default:
0693bbb3 161 $(MUTE)$(MAKE) aliroot
b9d0a01d 162
de6c7cfd 163FORCE:
164
462ee303 165#-------------------------------------------------------------------------------
166# Each module will add to these macros
b9d0a01d 167
168ALLLIBS :=
169ALLEXECS :=
170INCLUDEFILES :=
b934f194 171BINLIBS :=
172EXPORTFILES :=
b9d0a01d 173
462ee303 174#-------------------------------------------------------------------------------
8d7652bd 175# Dependencies of module.mk files if not cleaning
b9d0a01d 176
8ef0bd93 177ifeq ($(CLEAN),)
b9d0a01d 178include build/module.dep
8d7652bd 179endif
b9d0a01d 180
462ee303 181#-------------------------------------------------------------------------------
182# Check if module.mk is present for the library
183
5386b933 184%.mk: build/module.tpl build/header.tpl build/clean.tpl share/alibtool
b9d0a01d 185ifndef ALIQUIET
186 @echo "***** Creating $@ file *****";
187endif
188 @share/alibtool mkmodule $(patsubst %/module.mk,%,$@) > $@;
b9d0a01d 189
462ee303 190#-------------------------------------------------------------------------------
462ee303 191# If making modules, not not include anything
b9d0a01d 192
bdfb9593 193ifeq ($(findstring modules,$(MAKECMDGOALS)),)
b9d0a01d 194
462ee303 195#-------------------------------------------------------------------------------
196# Include the modules
197
b934f194 198-include $(patsubst %,%/module.mk,$(MODULES))
b9d0a01d 199
462ee303 200#-------------------------------------------------------------------------------
bdfb9593 201# If cleaning, do not include dependencies or module.mk files.
202
203ifeq ($(CLEAN),)
204
205#-------------------------------------------------------------------------------
462ee303 206# Include dependencies if not making them!
b9d0a01d 207
462ee303 208ifneq ($(MAKECMDGOALS),depend)
9f1751e4 209ifneq ($(MAKECMDGOALS),)
462ee303 210
e3642d02 211ifeq (ALIVERBOSE,2)
462ee303 212$(warning INCLUDEFILES=$(INCLUDEFILES))
b9d0a01d 213endif
462ee303 214-include $(INCLUDEFILES)
b9d0a01d 215
216endif
217endif
462ee303 218endif
9f1751e4 219endif
462ee303 220
221#-------------------------------------------------------------------------------
222# Include dummy dependency file *MUST* be last includefile
b9d0a01d 223
b9d0a01d 224include build/dummy.d
b9d0a01d 225
226
462ee303 227#-------------------------------------------------------------------------------
228# Targets
b9d0a01d 229
2ea00b17 230.PHONY: alilibs aliroot makedistr clean distclean clean-all \
9f1751e4 231 htmldoc profile modules depend
b9d0a01d 232
b934f194 233modules: $(patsubst %,%/module.mk,$(MODULES))
41f6cf69 234
2d8cad5a 235ifeq ($(ALIPROFILE),YES)
3a5e5a40 236alilibs: $(LIBPATH) modules $(ALLLIBS) $(ALLALIBS)
2d8cad5a 237else
3a5e5a40 238alilibs: $(LIBPATH) modules $(ALLLIBS)
2d8cad5a 239endif
41f6cf69 240
b8205a22 241aliroot: alilibs $(BINPATH) $(ALLEXECS)
9f1751e4 242
3c1a04dc 243alimdc-static: $(LIBPATH) $(RAWDatabaseALIB) $(MDCALIB) $(ESDALIB)
244 $(MUTE)rm -rf $(LIBPATH)/libAliMDC.a
245 $(MUTE)rm -rf junk
246 mkdir junk && cd junk && ar x ../$(RAWDatabaseALIB) && ar x ../$(MDCALIB) && ar x ../$(ESDALIB) && ar r ../$(LIBPATH)/libAliMDC.a *.o && cd .. && rm -rf junk
247
462ee303 248#-------------------------------------------------------------------------------
b9d0a01d 249# Single Makefile "distribution": Makefile + modules + mkdepend scripts
b934f194 250makedistr: $(MODULES)
b9d0a01d 251 tar -cvf MakeDistr.tar $(patsubst %,%/*.pkg,$(MODULES)) \
b934f194 252 Makefile create build/*
41f6cf69 253
b9d0a01d 254all: aliroot
41f6cf69 255
b934f194 256depend: $(INCLUDEFILES)
41f6cf69 257
b9d0a01d 258debug:
259ifndef ALIQUIET
260 @echo "***** Entering DEBUG mode. *****"
261endif
e1f602dc 262 @(export ALIDEBUG=YES && $(MAKE) aliroot)
b934f194 263
2d8cad5a 264profile:
265ifndef ALIQUIET
266 @echo "***** Entering PROFILE mode. *****"
267endif
e1f602dc 268 @(export ALIPROFILE=YES && $(MAKE) aliroot)
b934f194 269
b9d0a01d 270$(MODULES):
271ifndef ALIQUIET
272 @echo "***** Making $@ *****"
273endif
274 @mkdir -p $@
275
276$(BINPATH):
277ifndef ALIQUIET
278 @echo "***** Making $@ *****"
279endif
280 @mkdir -p $@
281
282$(LIBPATH):
283ifndef ALIQUIET
284 @echo "***** Making $@ *****"
285endif
286 @mkdir -p $@
287
288build/dummy.d: $(EXPORTFILES)
289 @(if [ ! -f $@ ] ; then \
290 touch $@; \
291 fi)
292
293clean:
2ea00b17 294 @echo "***** No target clean, use one of these *****"
b9d0a01d 295 @echo " clean-aliroot : Clean up all aliroot libraries"
296 @echo " clean-MODULENAME : Clean everything from module MODULENAME"
297 @echo " clean-all : Cleans up everything, including cern libraires"
1aa44b64 298 @echo " distclean : Like clean-all + clean all tgt_*'s"
b934f194 299 @echo " clean-modules : Clean all module.mk files in all modules"
b9d0a01d 300 @echo " clean-libs : Clean all libraries (not object files)"
301 @echo "********************************************"
302
303clean-all: clean-modules clean-libs clean-bins
304ifndef ALIQUIET
305 @echo "***** Cleaning up everything ****"
306endif
307 $(MUTE)rm -rf $(patsubst %,%/tgt_$(ALICE_TARGET),$(MODULES))
308 $(MUTE)rm -rf $(EXPORTDIR)
309
2ea00b17 310distclean: clean-all
1aa44b64 311 $(MUTE)rm -rf */tgt_* bin lib
2ea00b17 312
462ee303 313#-------------------------------------------------------------------------------
314# This cleans only libraries that are not CERN-libraries
b9d0a01d 315
316clean-aliroot: $(patsubst %,%/module.mk,$(ALIROOTMODULES)) $(patsubst %,clean-%,$(ALIROOTMODULES))
317
7e96fcc7 318CHECKMODULES := $(MODULES)
2900fa57 319CHECKMODULES := $(filter-out HBTP,$(CHECKMODULES))
320CHECKMODULES := $(filter-out MEVSIM,$(CHECKMODULES))
321CHECKMODULES := $(filter-out EPEMGEN,$(CHECKMODULES))
0b5dd071 322CHECKMODULES := $(filter-out TPHIC,$(CHECKMODULES))
af4ebdd2 323CHECKMODULES := $(filter-out LHAPDF,$(CHECKMODULES))
7e96fcc7 324CHECKMODULES := $(filter-out MICROCERN,$(CHECKMODULES))
b9d0a01d 325
b934f194 326check-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,check-%,$(CHECKMODULES))
b9d0a01d 327
5b0f3b29 328smell-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,smell-%,$(CHECKMODULES))
329
b934f194 330reveng-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,reveng-%,$(CHECKMODULES))
b9d0a01d 331
b934f194 332revdisp-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,revdisp-%,$(CHECKMODULES))
b9d0a01d 333
118c0ae6 334smell-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,smell-%,$(CHECKMODULES))
335
b9d0a01d 336clean-dicts:
337ifndef ALIQUIET
338 @echo "***** Cleaning up G__ files *****"
339endif
340 $(MUTE)rm -rf */tgt_$(ALICE_TARGET)/G__*
41f6cf69 341
b9d0a01d 342clean-modules:
343ifndef ALIQUIET
344 @echo "***** Cleaning up module.mk files *****"
345endif
b934f194 346 $(MUTE)rm -rf $(patsubst %,%/module.mk,$(MODULES))
41f6cf69 347
b9d0a01d 348clean-depend:
349ifndef ALIQUIET
350 @echo "***** Cleaning up dependencies *****"
351endif
352 $(MUTE)echo rm `find . -name "*.d"`
353
354clean-objects:
355ifndef ALIQUIET
356 @echo "***** Cleaning up .o files *****"
357endif
358 $(MUTE)echo rm `find . -name "*.o"`
359
360clean-libs:
361ifndef ALIQUIET
362 @echo "***** Cleaning up library files *****"
363endif
364 $(MUTE)rm -rf lib/tgt_$(ALICE_TARGET)/*
365
366clean-bins:
367ifndef ALIQUIET
368 @echo "***** Cleaning up binary files *****"
369endif
370 $(MUTE)rm -rf bin/tgt_$(ALICE_TARGET)
d7a221d0 371
b934f194 372clean-check-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,clean-check-%,$(CHECKMODULES))
ba546cfd 373
5b0f3b29 374clean-smell-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,clean-smell-%,$(CHECKMODULES))
375
b934f194 376clean-reveng-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,clean-reveng-%,$(CHECKMODULES))
ba546cfd 377
d7a221d0 378htmldoc:
379 @rm -rf html/roothtml
380 @rm -f html/picts
381 @rm -f /tmp/macros
382 @cd html ;\
383 aliroot -q -b "mkhtml.C(0,1)" ;\
384 ls ../macros/*.C > /tmp/macros ;\
385 for i in $(ALIROOTMODULES) ; do \
386 ls ../$$i/*.C 2>/dev/null >> /tmp/macros ;\
387 done ;\
388 for i in `cat /tmp/macros` ; do \
389 echo $$i ; \
390 aliroot -b -q "mkhtml.C(\"$$i\")" > /dev/null ;\
391 done ;\
392 ./makeExampleList ;
393 @ln -s ../picts html/picts
394 @ln -s ../../picts html/roothtml/picts
395 @ln -s ../../../picts html/roothtml/src/picts
396 @ln -s ../../../picts html/roothtml/examples/picts