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