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