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