]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - Makefile
Mapping files of bending PCBs of station345
[u/mrichter/AliRoot.git] / Makefile
... / ...
CommitLineData
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
5
6# /* $Id$ */
7
8ifdef ALIVERBOSE
9MUTE:=
10else
11MUTE:=@
12endif
13
14#-------------------------------------------------------------------------------
15# IRST coding rule check
16
17IRST_INSTALLDIR=$(ALICE)/local/IRST
18IRST_CONFIG_DIR=$(IRST_INSTALLDIR)/userConfig/ALICE
19CLASSPATH=$(IRST_INSTALLDIR)
20export CLASSPATH IRST_INSTALLDIR IRST_CONFIG_DIR
21CODE_CHECK=java rules.ALICE.ALICERuleChecker
22REV_ENG=$(IRST_INSTALLDIR)/scripts/revEng.sh
23
24#-------------------------------------------------------------------------------
25# Include library definition
26
27include build/Makefile.config
28
29#-------------------------------------------------------------------------------
30# Location where to install libraries and binaries and common header files
31
32LIBPATH := lib/tgt_$(ALICE_TARGET)
33BINPATH := bin/tgt_$(ALICE_TARGET)
34EXPORTDIR := $(ALICE_ROOT)/include
35BINLIBDIRS := -L$(ALICE_ROOT)/$(LIBPATH)
36
37#-------------------------------------------------------------------------------
38# Include machine dependent macros
39
40-include build/Makefile.$(ALICE_TARGET)
41
42#-------------------------------------------------------------------------------
43# Check if called with debug
44
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
54#-------------------------------------------------------------------------------
55# Check if called with profile
56
57ifeq ($(ALIPROFILE),YES)
58override ALICE_TARGET := $(ALICE_TARGET)PROF
59FFLAGS += -pg
60CXXFLAGS += -pg
61CFLAGS += -pg
62SOFLAGS += -pg
63LDFLAGS += -pg
64endif
65
66#-------------------------------------------------------------------------------
67# Check if DATE is installed
68
69ifdef DATE_ROOT
70DATEFLAGS = -DALI_DATE -D${DATE_SYS} -DDATE_SYS=${DATE_SYS} -Dlong32=${DATE_LONG32} \
71 -Dlong64=${DATE_LONG64} -DdatePointer=${DATE_POINTER}
72CXXFLAGS += $(DATEFLAGS)
73CFLAGS += $(DATEFLAGS)
74CINTFLAGS += $(DATEFLAGS)
75DEPINC += $(DATEFLAGS)
76endif
77
78#-------------------------------------------------------------------------------
79# Modules to build
80
81ifdef ALIVERBOSE
82$(warning MAKECMDGOALS=$(MAKECMDGOALS))
83endif
84
85ALIROOTMODULES := STEER PHOS TRD TPC ZDC MUON PMD FMD TOF ITS \
86 CRT RICH START STRUCT EVGEN RALICE ALIFAST VZERO \
87 THijing CONTAINERS MEVSIM TMEVSIM THbtp HBTP EMCAL HBTAN \
88 THerwig TEPEMGEN EPEMGEN FASTSIM TPHIC RAW MONITOR DISPLAY ANALYSIS \
89 JETAN HLT
90
91ifeq ($(findstring TFluka,$(MAKECMDGOALS)),TFluka)
92ALIROOTMODULES += TFluka
93endif
94
95ifeq ($(findstring Flugg,$(MAKECMDGOALS)),Flugg)
96ALIROOTMODULES += Flugg
97endif
98
99CERNMODULES := PDF PYTHIA6 HIJING MICROCERN HERWIG
100
101MODULES := $(ALIROOTMODULES) $(CERNMODULES) ALIROOT
102
103MODDIRS := $(MODULES)
104
105#-------------------------------------------------------------------------------
106# Default include dirs for C++, Fortran, Cint, and dependencies
107# The module directory will be added by each module
108
109GENINC := -I$(ALICE_ROOT)/include -I$(shell root-config --incdir)
110CXXFLAGS += $(GENINC)
111CXXFLAGSNO += $(GENINC)
112CINTFLAGS += $(GENINC)
113DEPINC += $(GENINC)
114
115#-------------------------------------------------------------------------------
116# Libraries to link binaries against
117# Libraries will be linked against SHLIB
118
119LIBS := $(GLIBS) $(ROOTLIBS) $(SYSLIBS)
120
121#-------------------------------------------------------------------------------
122# default target
123
124default: aliroot
125
126#-------------------------------------------------------------------------------
127# Each module will add to these macros
128
129ALLLIBS :=
130ALLEXECS :=
131INCLUDEFILES :=
132BINLIBS :=
133EXPORTFILES :=
134
135#-------------------------------------------------------------------------------
136# Dependencies of module.mk files
137
138include build/module.dep
139
140#-------------------------------------------------------------------------------
141# Check if module.mk is present for the library
142
143%.mk: build/module.tpl
144ifndef ALIQUIET
145 @echo "***** Creating $@ file *****";
146endif
147 @share/alibtool mkmodule $(patsubst %/module.mk,%,$@) > $@;
148
149#-------------------------------------------------------------------------------
150# If cleaning, do not include dependencies or module.mk files.
151
152ifeq ($(findstring $(MAKECMDGOALS), clean distclean clean-all clean-dicts \
153clean-modules clean-depend clean-objects clean-libs clean-bins \
154clean-check-all),)
155
156#-------------------------------------------------------------------------------
157# If making modules, not not include anything
158
159ifneq ($(findstring modules,$(MAKECMDGOALS)),modules)
160
161#-------------------------------------------------------------------------------
162# Include the modules
163
164-include $(patsubst %,%/module.mk,$(MODULES))
165
166#-------------------------------------------------------------------------------
167# Include dependencies if not making them!
168
169ifneq ($(MAKECMDGOALS),depend)
170ifneq ($(MAKECMDGOALS),)
171
172ifdef ALIVERBOSE
173$(warning INCLUDEFILES=$(INCLUDEFILES))
174endif
175-include $(INCLUDEFILES)
176
177endif
178endif
179endif
180endif
181
182#-------------------------------------------------------------------------------
183# Include dummy dependency file *MUST* be last includefile
184
185include build/dummy.d
186
187
188#-------------------------------------------------------------------------------
189# Targets
190
191.PHONY: alilibs aliroot makedistr clean distclean clean-all \
192 htmldoc profile modules depend
193
194modules: $(patsubst %,%/module.mk,$(MODULES))
195
196ifeq ($(ALIPROFILE),YES)
197alilibs: $(LIBPATH) modules $(ALLLIBS) $(ALLALIBS)
198else
199alilibs: $(LIBPATH) modules $(ALLLIBS)
200endif
201
202aliroot: $(BINPATH) $(ALLEXECS) alilibs
203
204#-------------------------------------------------------------------------------
205# Single Makefile "distribution": Makefile + modules + mkdepend scripts
206makedistr: $(MODULES)
207 tar -cvf MakeDistr.tar $(patsubst %,%/*.pkg,$(MODULES)) \
208 Makefile create build/*
209
210all: aliroot
211
212depend: $(INCLUDEFILES)
213
214debug:
215ifndef ALIQUIET
216 @echo "***** Entering DEBUG mode. *****"
217endif
218 @(export ALIDEBUG=YES && $(MAKE))
219
220profile:
221ifndef ALIQUIET
222 @echo "***** Entering PROFILE mode. *****"
223endif
224 @(export ALIPROFILE=YES && $(MAKE))
225
226$(MODULES):
227ifndef ALIQUIET
228 @echo "***** Making $@ *****"
229endif
230 @mkdir -p $@
231
232$(BINPATH):
233ifndef ALIQUIET
234 @echo "***** Making $@ *****"
235endif
236 @mkdir -p $@
237
238$(LIBPATH):
239ifndef ALIQUIET
240 @echo "***** Making $@ *****"
241endif
242 @mkdir -p $@
243
244build/dummy.d: $(EXPORTFILES)
245 @(if [ ! -f $@ ] ; then \
246 touch $@; \
247 fi)
248
249clean:
250 @echo "***** No target clean, use one of these *****"
251 @echo " clean-aliroot : Clean up all aliroot libraries"
252 @echo " clean-MODULENAME : Clean everything from module MODULENAME"
253 @echo " clean-all : Cleans up everything, including cern libraires"
254 @echo " distclean : Like clean-all + clean all tgt_*'s"
255 @echo " clean-modules : Clean all module.mk files in all modules"
256 @echo " clean-libs : Clean all libraries (not object files)"
257 @echo "********************************************"
258
259clean-all: clean-modules clean-libs clean-bins
260ifndef ALIQUIET
261 @echo "***** Cleaning up everything ****"
262endif
263 $(MUTE)rm -rf $(patsubst %,%/tgt_$(ALICE_TARGET),$(MODULES))
264 $(MUTE)rm -rf $(EXPORTDIR)
265
266distclean: clean-all
267 $(MUTE)rm -rf */tgt_* bin lib
268
269#-------------------------------------------------------------------------------
270# This cleans only libraries that are not CERN-libraries
271
272clean-aliroot: $(patsubst %,%/module.mk,$(ALIROOTMODULES)) $(patsubst %,clean-%,$(ALIROOTMODULES))
273
274CHECKMODULES := $(MODULES)
275CHECKMODULES := $(filter-out HBTP,$(CHECKMODULES))
276CHECKMODULES := $(filter-out MEVSIM,$(CHECKMODULES))
277CHECKMODULES := $(filter-out EPEMGEN,$(CHECKMODULES))
278CHECKMODULES := $(filter-out TPHIC,$(CHECKMODULES))
279CHECKMODULES := $(filter-out PDF,$(CHECKMODULES))
280CHECKMODULES := $(filter-out MICROCERN,$(CHECKMODULES))
281
282check-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,check-%,$(CHECKMODULES))
283
284reveng-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,reveng-%,$(CHECKMODULES))
285
286revdisp-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,revdisp-%,$(CHECKMODULES))
287
288clean-dicts:
289ifndef ALIQUIET
290 @echo "***** Cleaning up G__ files *****"
291endif
292 $(MUTE)rm -rf */tgt_$(ALICE_TARGET)/G__*
293
294clean-modules:
295ifndef ALIQUIET
296 @echo "***** Cleaning up module.mk files *****"
297endif
298 $(MUTE)rm -rf $(patsubst %,%/module.mk,$(MODULES))
299
300clean-depend:
301ifndef ALIQUIET
302 @echo "***** Cleaning up dependencies *****"
303endif
304 $(MUTE)echo rm `find . -name "*.d"`
305
306clean-objects:
307ifndef ALIQUIET
308 @echo "***** Cleaning up .o files *****"
309endif
310 $(MUTE)echo rm `find . -name "*.o"`
311
312clean-libs:
313ifndef ALIQUIET
314 @echo "***** Cleaning up library files *****"
315endif
316 $(MUTE)rm -rf lib/tgt_$(ALICE_TARGET)/*
317
318clean-bins:
319ifndef ALIQUIET
320 @echo "***** Cleaning up binary files *****"
321endif
322 $(MUTE)rm -rf bin/tgt_$(ALICE_TARGET)
323
324clean-check-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,clean-check-%,$(CHECKMODULES))
325
326clean-reveng-all: $(patsubst %,%/module.mk,$(CHECKMODULES)) $(patsubst %,clean-reveng-%,$(CHECKMODULES))
327
328htmldoc:
329 @rm -rf html/roothtml
330 @rm -f html/picts
331 @rm -f /tmp/macros
332 @cd html ;\
333 aliroot -q -b "mkhtml.C(0,1)" ;\
334 ls ../macros/*.C > /tmp/macros ;\
335 for i in $(ALIROOTMODULES) ; do \
336 ls ../$$i/*.C 2>/dev/null >> /tmp/macros ;\
337 done ;\
338 for i in `cat /tmp/macros` ; do \
339 echo $$i ; \
340 aliroot -b -q "mkhtml.C(\"$$i\")" > /dev/null ;\
341 done ;\
342 ./makeExampleList ;
343 @ln -s ../picts html/picts
344 @ln -s ../../picts html/roothtml/picts
345 @ln -s ../../../picts html/roothtml/src/picts
346 @ln -s ../../../picts html/roothtml/examples/picts