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