]> git.uio.no Git - u/mrichter/AliRoot.git/blame - Makefile
removed iostream
[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 \
65 THerwig
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
261CHECKMODULES := $(filter-out HBTP,$(filter-out MEVSIM,$(ALIROOTMODULES)))
262
263check-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,check-%,$(CHECKMODULES))
264
265reveng-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,reveng-%,$(CHECKMODULES))
266
267revdisp-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,revdisp-%,$(CHECKMODULES))
268
269clean-dicts:
270ifndef ALIQUIET
271 @echo "***** Cleaning up G__ files *****"
272endif
273 $(MUTE)rm -rf */tgt_$(ALICE_TARGET)/G__*
41f6cf69 274
b9d0a01d 275clean-modules:
276ifndef ALIQUIET
277 @echo "***** Cleaning up module.mk files *****"
278endif
279 $(MUTE)rm -rf $(patsubst %,%/module.mk,$(MODULES))
41f6cf69 280
b9d0a01d 281clean-depend:
282ifndef ALIQUIET
283 @echo "***** Cleaning up dependencies *****"
284endif
285 $(MUTE)echo rm `find . -name "*.d"`
286
287clean-objects:
288ifndef ALIQUIET
289 @echo "***** Cleaning up .o files *****"
290endif
291 $(MUTE)echo rm `find . -name "*.o"`
292
293clean-libs:
294ifndef ALIQUIET
295 @echo "***** Cleaning up library files *****"
296endif
297 $(MUTE)rm -rf lib/tgt_$(ALICE_TARGET)/*
298
299clean-bins:
300ifndef ALIQUIET
301 @echo "***** Cleaning up binary files *****"
302endif
303 $(MUTE)rm -rf bin/tgt_$(ALICE_TARGET)
d7a221d0 304
ba546cfd 305clean-check-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,clean-check-%,$(CHECKMODULES))
306
307clean-reveng-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,clean-reveng-%,$(CHECKMODULES))
308
d7a221d0 309htmldoc:
310 @rm -rf html/roothtml
311 @rm -f html/picts
312 @rm -f /tmp/macros
313 @cd html ;\
314 aliroot -q -b "mkhtml.C(0,1)" ;\
315 ls ../macros/*.C > /tmp/macros ;\
316 for i in $(ALIROOTMODULES) ; do \
317 ls ../$$i/*.C 2>/dev/null >> /tmp/macros ;\
318 done ;\
319 for i in `cat /tmp/macros` ; do \
320 echo $$i ; \
321 aliroot -b -q "mkhtml.C(\"$$i\")" > /dev/null ;\
322 done ;\
323 ./makeExampleList ;
324 @ln -s ../picts html/picts
325 @ln -s ../../picts html/roothtml/picts
326 @ln -s ../../../picts html/roothtml/src/picts
327 @ln -s ../../../picts html/roothtml/examples/picts