1 # Top level Makefile for AliRoot System
3 # Author: Jan-Erik Revsbech (revsbech@fys.ku.dk)
4 # Developed on idea of Boris Polichtchouk (Boris.Polichtchouk@cern.ch), 15/4/2001
7 ##### include general path/location macros #####
8 override ALICE_ROOT=$(shell pwd)
16 # IRST coding rule check
17 IRST_INSTALLDIR=$(ALICE)/local/IRST
18 CLASSPATH=$(IRST_INSTALLDIR)
19 export CLASSPATH IRST_INSTALLDIR
20 CODE_CHECK=java rules.ALICE.ALICERuleChecker
21 REV_ENG=$(IRST_INSTALLDIR)/scripts/revEng.sh
24 include build/Makefile.config
25 ##################################################################
27 # Where to install libraries and binaries
28 # and common header files
30 LIBPATH=lib/tgt_$(ALICE_TARGET)
31 BINPATH=bin/tgt_$(ALICE_TARGET)
32 EXPORTDIR = $(ALICE_ROOT)/include
33 ##################################################################
35 ##################################################################
36 # include machine dependent macros
38 -include build/Makefile.$(ALICE_TARGET)
39 ##################################################################
41 ##################################################################
43 # Check if called with debug
45 ifeq ($(ALIDEBUG),YES)
46 override ALICE_TARGET:=$(ALICE_TARGET)DEBUG
47 FFLAGS := -g $(filter-out -O%,$(FFLAGS))
48 CXXFLAGS := -g $(filter-out -O%,$(CXXLAGS))
49 CFLAGS := -g $(filter-out -O%,$(CLAGS))
50 SOFLAGS := -g $(filter-out -O%,$(SOFLAGS))
51 LDFLAGS := -g $(filter-out -O%,$(LDFLAGS))
53 ##################################################################
55 ##################################################################
59 # Uncomment to show some output
60 #$(warning MAKECMDGOALS=$(MAKECMDGOALS))
62 ALIROOTMODULES:= 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 \
65 THerwig TEPEMGEN EPEMGEN FASTSIM
67 CERNMODULES:= PDF PYTHIA PYTHIA6 HIJING MICROCERN HERWIG
69 MODULES:=$(ALIROOTMODULES) $(CERNMODULES)
71 ifeq ($(findstring TFluka,$(MAKECMDGOALS)),TFluka)
75 ifeq ($(findstring Flugg,$(MAKECMDGOALS)),Flugg)
79 ##################################################################
85 #############################################################
87 # Default include dirs for
88 # C++, Fortran, Cint, and dependencies
89 # The module directory will be added by each module
92 CXXFLAGS += -I$(ALICE_ROOT)/include
93 CXXFLAGS += $(patsubst %,-I%,$(ROOTSYS)/include)
95 CINTFLAGS += -I$(ALICE_ROOT)/include
96 CINTFLAGS += $(patsubst %,-I%,$(ROOTSYS)/include)
98 DEPINC += -I$(ALICE_ROOT)/include
99 DEPINC += $(patsubst %,-I%,$(ROOTSYS)/include)
100 #############################################################
103 #############################################################
105 # Libraries to link binaries against
106 # Libraries will be linked againstSHLIB
107 LIBS := $(GLIBS) $(ROOTLIBS) $(SYSLIBS)
108 #############################################################
112 default: alilibs aliroot
115 #############################################################
117 # Each module will add to this
124 #############################################################
126 BINLIBDIRS := -L$(ALICE_ROOT)/$(LIBPATH)
129 #Dependencies of module.mk files
131 include build/module.dep
133 #############################################################
135 # Check if module.mk is present for the library
136 %.mk: build/module.tpl
138 @echo "***** Creating $@ file *****";
140 @share/alibtool mkmodule $(patsubst %/module.mk,%,$@) > $@;
141 #############################################################
143 # **************************************************************************
145 # If cleaning, do not include
146 # dependencies or module.mk files.
148 ifeq ($(findstring $(MAKECMDGOALS), clean clean-all clean-dicts clean-modules clean-depend clean-objects clean-libs clean-bins),)
150 # If making modules, not not include
153 ifneq ($(findstring modules,$(MAKECMDGOALS)),modules)
155 #############################################################
157 # Include the modules
158 -include $(patsubst %,%/module.mk,$(MODULES))
162 #############################################################
164 #############################################################
166 # include dependencies if not making them!
167 ifneq ($(MAKECMDGOALS),depend )
168 # Don't include if cleaning of any sort
169 ifneq ($(findstring clean,$(MAKECMDGOALS)),clean)
170 #$(warning INCLUDEFILES=$(INCLUDEFILES))
171 include $(INCLUDEFILES)
174 #############################################################
178 # **************************************************************************
180 #############################################################
182 # include dummy dependency file
183 # *MUST* be last includefile
184 include build/dummy.d
185 #############################################################
190 .PHONY: alilibs aliroot makedistr clean htmldoc
192 modules: $(patsubst %,%/module.mk,$(MODULES))
195 aliroot: $(BINPATH) $(ALLEXECS) alilibs bin
197 alilibs: $(LIBPATH) $(ALLLIBS) lib modules
199 # Single Makefile "distribution": Makefile + modules + mkdepend scripts
200 makedistr: $(MODULES)
201 tar -cvf MakeDistr.tar $(patsubst %,%/*.pkg,$(MODULES)) \
202 Makefile create build/*
207 depend: $(INCLUDEFILES)
211 @echo "***** Entering DEBUG mode. *****"
213 @(export ALIDEBUG=YES && $(MAKE))
216 @mkdir lib/tgt_$(ALICE_TARGET)
220 @mkdir bin/tgt_$(ALICE_TARGET)
224 @echo "***** Making $@ *****"
230 @echo "***** Making $@ *****"
236 @echo "***** Making $@ *****"
240 build/dummy.d: $(EXPORTFILES)
241 @(if [ ! -f $@ ] ; then \
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 "********************************************"
254 clean-all: clean-modules clean-libs clean-bins
256 @echo "***** Cleaning up everything ****"
258 $(MUTE)rm -rf $(patsubst %,%/tgt_$(ALICE_TARGET),$(MODULES))
259 $(MUTE)rm -rf $(EXPORTDIR)
261 #This cleans only libraries that are not CERN-libraries
263 clean-aliroot: $(patsubst %,%/module.mk,$(ALIROOTMODULES)) $(patsubst %,clean-%,$(ALIROOTMODULES))
265 CHECKMODULES := $(ALIROOTMODULES)
266 CHECKMODULES := $(filter-out HBTP,$(CHECKMODULES))
267 CHECKMODULES := $(filter-out MEVSIM,$(CHECKMODULES))
268 CHECKMODULES := $(filter-out EPEMGEN,$(CHECKMODULES))
270 check-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,check-%,$(CHECKMODULES))
272 reveng-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,reveng-%,$(CHECKMODULES))
274 revdisp-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,revdisp-%,$(CHECKMODULES))
278 @echo "***** Cleaning up G__ files *****"
280 $(MUTE)rm -rf */tgt_$(ALICE_TARGET)/G__*
284 @echo "***** Cleaning up module.mk files *****"
286 $(MUTE)rm -rf $(patsubst %,%/module.mk,$(MODULES))
290 @echo "***** Cleaning up dependencies *****"
292 $(MUTE)echo rm `find . -name "*.d"`
296 @echo "***** Cleaning up .o files *****"
298 $(MUTE)echo rm `find . -name "*.o"`
302 @echo "***** Cleaning up library files *****"
304 $(MUTE)rm -rf lib/tgt_$(ALICE_TARGET)/*
308 @echo "***** Cleaning up binary files *****"
310 $(MUTE)rm -rf bin/tgt_$(ALICE_TARGET)
312 clean-check-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,clean-check-%,$(CHECKMODULES))
314 clean-reveng-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,clean-reveng-%,$(CHECKMODULES))
317 @rm -rf html/roothtml
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 ;\
326 for i in `cat /tmp/macros` ; do \
328 aliroot -b -q "mkhtml.C(\"$$i\")" > /dev/null ;\
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