Updated comments for Doxygen
[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
18d2e4ee 99ifeq ($(findstring PWG0,$(MAKECMDGOALS)),PWG0)
100ALIROOTMODULES += PWG0
101endif
102
103ifeq ($(findstring SHUTTLE,$(MAKECMDGOALS)),SHUTTLE)
104ALIROOTMODULES += SHUTTLE
105endif
106
2830f9fb 107ifeq ($(findstring Flugg,$(MAKECMDGOALS)),Flugg)
462ee303 108ALIROOTMODULES += Flugg
2830f9fb 109endif
b9d0a01d 110
462ee303 111CERNMODULES := PDF PYTHIA6 HIJING MICROCERN HERWIG
b9d0a01d 112
462ee303 113MODULES := $(ALIROOTMODULES) $(CERNMODULES) ALIROOT
b9d0a01d 114
115MODDIRS := $(MODULES)
116
462ee303 117#-------------------------------------------------------------------------------
118# Default include dirs for C++, Fortran, Cint, and dependencies
119# The module directory will be added by each module
b9d0a01d 120
19ca05d1 121GENINC := -I$(ALICE_ROOT)/include -I$(shell root-config --incdir)
19ca05d1 122CXXFLAGS += $(GENINC)
123CXXFLAGSNO += $(GENINC)
124CINTFLAGS += $(GENINC)
125DEPINC += $(GENINC)
b9d0a01d 126
462ee303 127#-------------------------------------------------------------------------------
128# Libraries to link binaries against
129# Libraries will be linked against SHLIB
de6c7cfd 130# ROOT libraries
131
3df2764f 132ROOTCLIBS := $(shell root-config --glibs) -lThread -lMinuit -lHtml -lVMC -lEG -lGeom
b9d0a01d 133
3df2764f 134ROOTPLIBS := -lEGPythia6
de6c7cfd 135
136ALILIBS := -L$(LIBDIR) -lMUON -lTPC -lPMD -lTRD -lFMD -lTOF \
137 -lITS -lPHOS -lCRT -lRICH -lVZERO -lZDC -lSTRUCT \
e756ece8 138 -lSTART -lEVGEN -lSTEER
de6c7cfd 139
140LIBS := $(ROOTCLIBS) $(ROOTPLIBS) $(SYSLIBS)
b9d0a01d 141
462ee303 142#-------------------------------------------------------------------------------
b9d0a01d 143# default target
462ee303 144
4dc83bdb 145default:
0693bbb3 146 $(MUTE)$(MAKE) aliroot
b9d0a01d 147
de6c7cfd 148FORCE:
149
462ee303 150#-------------------------------------------------------------------------------
151# Each module will add to these macros
b9d0a01d 152
153ALLLIBS :=
154ALLEXECS :=
155INCLUDEFILES :=
b934f194 156BINLIBS :=
157EXPORTFILES :=
b9d0a01d 158
462ee303 159#-------------------------------------------------------------------------------
8d7652bd 160# Dependencies of module.mk files if not cleaning
b9d0a01d 161
8ef0bd93 162ifeq ($(CLEAN),)
b9d0a01d 163include build/module.dep
8d7652bd 164endif
b9d0a01d 165
462ee303 166#-------------------------------------------------------------------------------
167# Check if module.mk is present for the library
168
5386b933 169%.mk: build/module.tpl build/header.tpl build/clean.tpl share/alibtool
b9d0a01d 170ifndef ALIQUIET
171 @echo "***** Creating $@ file *****";
172endif
173 @share/alibtool mkmodule $(patsubst %/module.mk,%,$@) > $@;
b9d0a01d 174
462ee303 175#-------------------------------------------------------------------------------
462ee303 176# If making modules, not not include anything
b9d0a01d 177
bdfb9593 178ifeq ($(findstring modules,$(MAKECMDGOALS)),)
b9d0a01d 179
462ee303 180#-------------------------------------------------------------------------------
181# Include the modules
182
b934f194 183-include $(patsubst %,%/module.mk,$(MODULES))
b9d0a01d 184
462ee303 185#-------------------------------------------------------------------------------
bdfb9593 186# If cleaning, do not include dependencies or module.mk files.
187
188ifeq ($(CLEAN),)
189
190#-------------------------------------------------------------------------------
462ee303 191# Include dependencies if not making them!
b9d0a01d 192
462ee303 193ifneq ($(MAKECMDGOALS),depend)
9f1751e4 194ifneq ($(MAKECMDGOALS),)
462ee303 195
e3642d02 196ifeq (ALIVERBOSE,2)
462ee303 197$(warning INCLUDEFILES=$(INCLUDEFILES))
b9d0a01d 198endif
462ee303 199-include $(INCLUDEFILES)
b9d0a01d 200
201endif
202endif
462ee303 203endif
9f1751e4 204endif
462ee303 205
206#-------------------------------------------------------------------------------
207# Include dummy dependency file *MUST* be last includefile
b9d0a01d 208
b9d0a01d 209include build/dummy.d
b9d0a01d 210
211
462ee303 212#-------------------------------------------------------------------------------
213# Targets
b9d0a01d 214
2ea00b17 215.PHONY: alilibs aliroot makedistr clean distclean clean-all \
9f1751e4 216 htmldoc profile modules depend
b9d0a01d 217
b934f194 218modules: $(patsubst %,%/module.mk,$(MODULES))
41f6cf69 219
2d8cad5a 220ifeq ($(ALIPROFILE),YES)
3a5e5a40 221alilibs: $(LIBPATH) modules $(ALLLIBS) $(ALLALIBS)
2d8cad5a 222else
3a5e5a40 223alilibs: $(LIBPATH) modules $(ALLLIBS)
2d8cad5a 224endif
41f6cf69 225
b8205a22 226aliroot: alilibs $(BINPATH) $(ALLEXECS)
9f1751e4 227
462ee303 228#-------------------------------------------------------------------------------
b9d0a01d 229# Single Makefile "distribution": Makefile + modules + mkdepend scripts
b934f194 230makedistr: $(MODULES)
b9d0a01d 231 tar -cvf MakeDistr.tar $(patsubst %,%/*.pkg,$(MODULES)) \
b934f194 232 Makefile create build/*
41f6cf69 233
b9d0a01d 234all: aliroot
41f6cf69 235
b934f194 236depend: $(INCLUDEFILES)
41f6cf69 237
b9d0a01d 238debug:
239ifndef ALIQUIET
240 @echo "***** Entering DEBUG mode. *****"
241endif
e1f602dc 242 @(export ALIDEBUG=YES && $(MAKE) aliroot)
b934f194 243
2d8cad5a 244profile:
245ifndef ALIQUIET
246 @echo "***** Entering PROFILE mode. *****"
247endif
e1f602dc 248 @(export ALIPROFILE=YES && $(MAKE) aliroot)
b934f194 249
b9d0a01d 250$(MODULES):
251ifndef ALIQUIET
252 @echo "***** Making $@ *****"
253endif
254 @mkdir -p $@
255
256$(BINPATH):
257ifndef ALIQUIET
258 @echo "***** Making $@ *****"
259endif
260 @mkdir -p $@
261
262$(LIBPATH):
263ifndef ALIQUIET
264 @echo "***** Making $@ *****"
265endif
266 @mkdir -p $@
267
268build/dummy.d: $(EXPORTFILES)
269 @(if [ ! -f $@ ] ; then \
270 touch $@; \
271 fi)
272
273clean:
2ea00b17 274 @echo "***** No target clean, use one of these *****"
b9d0a01d 275 @echo " clean-aliroot : Clean up all aliroot libraries"
276 @echo " clean-MODULENAME : Clean everything from module MODULENAME"
277 @echo " clean-all : Cleans up everything, including cern libraires"
1aa44b64 278 @echo " distclean : Like clean-all + clean all tgt_*'s"
b934f194 279 @echo " clean-modules : Clean all module.mk files in all modules"
b9d0a01d 280 @echo " clean-libs : Clean all libraries (not object files)"
281 @echo "********************************************"
282
283clean-all: clean-modules clean-libs clean-bins
284ifndef ALIQUIET
285 @echo "***** Cleaning up everything ****"
286endif
287 $(MUTE)rm -rf $(patsubst %,%/tgt_$(ALICE_TARGET),$(MODULES))
288 $(MUTE)rm -rf $(EXPORTDIR)
289
2ea00b17 290distclean: clean-all
1aa44b64 291 $(MUTE)rm -rf */tgt_* bin lib
2ea00b17 292
462ee303 293#-------------------------------------------------------------------------------
294# This cleans only libraries that are not CERN-libraries
b9d0a01d 295
296clean-aliroot: $(patsubst %,%/module.mk,$(ALIROOTMODULES)) $(patsubst %,clean-%,$(ALIROOTMODULES))
297
7e96fcc7 298CHECKMODULES := $(MODULES)
2900fa57 299CHECKMODULES := $(filter-out HBTP,$(CHECKMODULES))
300CHECKMODULES := $(filter-out MEVSIM,$(CHECKMODULES))
301CHECKMODULES := $(filter-out EPEMGEN,$(CHECKMODULES))
0b5dd071 302CHECKMODULES := $(filter-out TPHIC,$(CHECKMODULES))
7e96fcc7 303CHECKMODULES := $(filter-out PDF,$(CHECKMODULES))
304CHECKMODULES := $(filter-out MICROCERN,$(CHECKMODULES))
b9d0a01d 305
b934f194 306check-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,check-%,$(CHECKMODULES))
b9d0a01d 307
b934f194 308reveng-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,reveng-%,$(CHECKMODULES))
b9d0a01d 309
b934f194 310revdisp-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,revdisp-%,$(CHECKMODULES))
b9d0a01d 311
312clean-dicts:
313ifndef ALIQUIET
314 @echo "***** Cleaning up G__ files *****"
315endif
316 $(MUTE)rm -rf */tgt_$(ALICE_TARGET)/G__*
41f6cf69 317
b9d0a01d 318clean-modules:
319ifndef ALIQUIET
320 @echo "***** Cleaning up module.mk files *****"
321endif
b934f194 322 $(MUTE)rm -rf $(patsubst %,%/module.mk,$(MODULES))
41f6cf69 323
b9d0a01d 324clean-depend:
325ifndef ALIQUIET
326 @echo "***** Cleaning up dependencies *****"
327endif
328 $(MUTE)echo rm `find . -name "*.d"`
329
330clean-objects:
331ifndef ALIQUIET
332 @echo "***** Cleaning up .o files *****"
333endif
334 $(MUTE)echo rm `find . -name "*.o"`
335
336clean-libs:
337ifndef ALIQUIET
338 @echo "***** Cleaning up library files *****"
339endif
340 $(MUTE)rm -rf lib/tgt_$(ALICE_TARGET)/*
341
342clean-bins:
343ifndef ALIQUIET
344 @echo "***** Cleaning up binary files *****"
345endif
346 $(MUTE)rm -rf bin/tgt_$(ALICE_TARGET)
d7a221d0 347
b934f194 348clean-check-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,clean-check-%,$(CHECKMODULES))
ba546cfd 349
b934f194 350clean-reveng-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,clean-reveng-%,$(CHECKMODULES))
ba546cfd 351
d7a221d0 352htmldoc:
353 @rm -rf html/roothtml
354 @rm -f html/picts
355 @rm -f /tmp/macros
356 @cd html ;\
357 aliroot -q -b "mkhtml.C(0,1)" ;\
358 ls ../macros/*.C > /tmp/macros ;\
359 for i in $(ALIROOTMODULES) ; do \
360 ls ../$$i/*.C 2>/dev/null >> /tmp/macros ;\
361 done ;\
362 for i in `cat /tmp/macros` ; do \
363 echo $$i ; \
364 aliroot -b -q "mkhtml.C(\"$$i\")" > /dev/null ;\
365 done ;\
366 ./makeExampleList ;
367 @ln -s ../picts html/picts
368 @ln -s ../../picts html/roothtml/picts
369 @ln -s ../../../picts html/roothtml/src/picts
370 @ln -s ../../../picts html/roothtml/examples/picts