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