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