]>
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 | ||
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 | include build/Makefile.config | |
17 | ################################################################## | |
18 | # | |
19 | # Where to install libraries and binaries | |
20 | # and common header files | |
21 | ||
22 | LIBPATH=lib/tgt_$(ALICE_TARGET) | |
23 | BINPATH=bin/tgt_$(ALICE_TARGET) | |
24 | EXPORTDIR = $(ALICE_ROOT)/include | |
25 | ################################################################## | |
26 | ||
27 | ################################################################## | |
28 | # include machine dependent macros | |
29 | ||
30 | -include build/Makefile.$(ALICE_TARGET) | |
31 | ################################################################## | |
32 | ||
33 | ################################################################## | |
34 | # | |
35 | # Check if called with debug | |
36 | ||
37 | ifeq ($(ALIDEBUG),YES) | |
38 | override ALICE_TARGET:=$(ALICE_TARGET)DEBUG | |
39 | FFLAGS := -g $(filter-out -O%,$(FFLAGS)) | |
40 | CXXFLAGS := -g $(filter-out -O%,$(CXXLAGS)) | |
41 | CFLAGS := -g $(filter-out -O%,$(CLAGS)) | |
42 | SOFLAGS := -g $(filter-out -O%,$(SOFLAGS)) | |
43 | LDFLAGS := -g $(filter-out -O%,$(LDFLAGS)) | |
44 | endif | |
45 | ################################################################## | |
46 | ||
47 | ################################################################## | |
48 | # | |
49 | # Modules to build | |
50 | ||
51 | # COMMENTED OUT FOR TEST PURPOSES | |
52 | ||
53 | ALIROOTMODULES:= STEER \ | |
54 | TGeant3 PHOS TRD TPC ZDC MUON PMD FMD TOF ITS \ | |
55 | CRT RICH START STRUCT VZERO EVGEN RALICE ALIFAST \ | |
56 | THijing CONTAINERS MEVSIM TMEVSIM THbtp HBTP EMCAL HBTAN \ | |
57 | ||
58 | ||
59 | GEANT4MODULES:= TGeant4 AliGeant4 | |
60 | ifeq ($(MAKECMDGOALS),geant4) | |
61 | ALIROOTMODULES += $(GEANT4MODULES) | |
62 | endif | |
63 | ||
64 | CERNMODULES:= PDF PYTHIA PYTHIA6 GEANT321 MINICERN HIJING | |
65 | ||
66 | MODULES:=$(ALIROOTMODULES) $(CERNMODULES) | |
67 | ||
68 | ################################################################## | |
69 | ||
70 | MODULES += ALIROOT | |
71 | ||
72 | MODDIRS := MODULES | |
73 | ||
74 | ############################################################# | |
75 | # | |
76 | # Default include dirs for | |
77 | # C++, Fortran, Cint, and dependencies | |
78 | # The module directory will be added by each module | |
79 | # | |
80 | ||
81 | CXXFLAGS += -I$(ALICE_ROOT)/include | |
82 | CXXFLAGS += $(patsubst %,-I%,$(ROOTSYS)/include) | |
83 | ||
84 | CINTFLAGS += -I$(ALICE_ROOT)/include | |
85 | CINTFLAGS += $(patsubst %,-I%,$(ROOTSYS)/include) | |
86 | ||
87 | DEPINC += -I$(ALICE_ROOT)/include | |
88 | DEPINC += $(patsubst %,-I%,$(ROOTSYS)/include) | |
89 | ############################################################# | |
90 | ||
91 | ||
92 | ############################################################# | |
93 | # | |
94 | # Libraries to link binaries against | |
95 | # Libraries will be linked againstSHLIB | |
96 | LIBS := $(ROOTLIBS) $(SYSLIBS) $(GLIBS) | |
97 | ############################################################# | |
98 | ||
99 | ||
100 | # default target | |
101 | default: alilibs aliroot | |
102 | ||
103 | ||
104 | ############################################################# | |
105 | # | |
106 | # Each module will add to this | |
107 | ||
108 | ALLLIBS := | |
109 | ALLEXECS := | |
110 | INCLUDEFILES := | |
111 | BINLIBS := | |
112 | EXPORTFILES := | |
113 | ############################################################# | |
114 | ||
115 | BINLIBDIRS := -L$(ALICE_ROOT)/$(LIBPATH) | |
116 | ||
117 | ||
118 | #Dependencies of module.mk files | |
119 | ||
120 | include build/module.dep | |
121 | ||
122 | ############################################################# | |
123 | # | |
124 | # Check if module.mk is present for the library | |
125 | %.mk: build/module.tpl | |
126 | ifndef ALIQUIET | |
127 | @echo "***** Creating $@ file *****"; | |
128 | endif | |
129 | @share/alibtool mkmodule $(patsubst %/module.mk,%,$@) > $@; | |
130 | ############################################################# | |
131 | ||
132 | # ************************************************************************** | |
133 | # | |
134 | # If cleaning, do not include | |
135 | # dependencies or module.mk files. | |
136 | ||
137 | ifeq ($(findstring $(MAKECMDGOALS), clean clean-all clean-dicts clean-modules clean-depend clean-objects clean-libs clean-bins),) | |
138 | ||
139 | # If making modules, not not include | |
140 | # anything | |
141 | ||
142 | ifneq ($(findstring modules,$(MAKECMDGOALS)),modules) | |
143 | ||
144 | ############################################################# | |
145 | # | |
146 | # Include the modules | |
147 | -include $(patsubst %,%/module.mk,$(MODULES)) | |
148 | ############################################################# | |
149 | ||
150 | ############################################################# | |
151 | # | |
152 | # include dependencies if not making them! | |
153 | ifneq ($(MAKECMDGOALS),depend ) | |
154 | # Don't include if cleaning of any sort | |
155 | ifneq ($(findstring clean,$(MAKECMDGOALS)),clean) | |
156 | include $(INCLUDEFILES) | |
157 | endif | |
158 | endif | |
159 | ############################################################# | |
160 | ||
161 | endif | |
162 | endif | |
163 | # ************************************************************************** | |
164 | ||
165 | ############################################################# | |
166 | # | |
167 | # include dummy dependency file | |
168 | # *MUST* be last includefile | |
169 | include build/dummy.d | |
170 | ############################################################# | |
171 | ||
172 | ||
173 | # targets | |
174 | ||
175 | .PHONY: alilibs aliroot geant4 makedistr clean | |
176 | ||
177 | modules: $(patsubst %,%/module.mk,$(MODULES)) | |
178 | ||
179 | geant4modules: $(patsubst %,%/module.mk,$(GEANT4MODULES)) | |
180 | ||
181 | aliroot: $(BINPATH) $(ALLEXECS) alilibs bin | |
182 | ||
183 | geant4: aliroot | |
184 | ||
185 | alilibs: $(LIBPATH) $(ALLLIBS) lib modules | |
186 | ||
187 | # Single Makefile "distribution": Makefile + modules + mkdepend scripts | |
188 | makedistr: $(MODULES) | |
189 | tar -cvf MakeDistr.tar $(patsubst %,%/*.pkg,$(MODULES)) \ | |
190 | Makefile create build/* | |
191 | ||
192 | all: aliroot | |
193 | ||
194 | depend: $(INCLUDEFILES) | |
195 | ||
196 | debug: | |
197 | ifndef ALIQUIET | |
198 | @echo "***** Entering DEBUG mode. *****" | |
199 | endif | |
200 | @(export ALIDEBUG=YES && $(MAKE) -f Makefile.flat ) | |
201 | lib: | |
202 | @mkdir lib | |
203 | @mkdir lib/tgt_$(ALICE_TARGET) | |
204 | ||
205 | bin: | |
206 | @mkdir bin | |
207 | @mkdir bin/tgt_$(ALICE_TARGET) | |
208 | ||
209 | $(MODULES): | |
210 | ifndef ALIQUIET | |
211 | @echo "***** Making $@ *****" | |
212 | endif | |
213 | @mkdir -p $@ | |
214 | ||
215 | $(BINPATH): | |
216 | ifndef ALIQUIET | |
217 | @echo "***** Making $@ *****" | |
218 | endif | |
219 | @mkdir -p $@ | |
220 | ||
221 | $(LIBPATH): | |
222 | ifndef ALIQUIET | |
223 | @echo "***** Making $@ *****" | |
224 | endif | |
225 | @mkdir -p $@ | |
226 | ||
227 | build/dummy.d: $(EXPORTFILES) | |
228 | @(if [ ! -f $@ ] ; then \ | |
229 | touch $@; \ | |
230 | fi) | |
231 | ||
232 | clean: | |
233 | @echo "***** No targen clean, use one of these *****" | |
234 | @echo " clean-aliroot : Clean up all aliroot libraries" | |
235 | @echo " clean-MODULENAME : Clean everything from module MODULENAME" | |
236 | @echo " clean-all : Cleans up everything, including cern libraires" | |
237 | @echo " clean-modules : Clean all module.mk file in all modules" | |
238 | @echo " clean-libs : Clean all libraries (not object files)" | |
239 | @echo "********************************************" | |
240 | ||
241 | clean-all: clean-modules clean-libs clean-bins | |
242 | ifndef ALIQUIET | |
243 | @echo "***** Cleaning up everything ****" | |
244 | endif | |
245 | $(MUTE)rm -rf $(patsubst %,%/tgt_$(ALICE_TARGET),$(MODULES)) | |
246 | $(MUTE)rm -rf $(EXPORTDIR) | |
247 | ||
248 | #This cleans only libraries that are not CERN-libraries | |
249 | ||
250 | clean-aliroot: $(patsubst %,%/module.mk,$(ALIROOTMODULES)) $(patsubst %,clean-%,$(ALIROOTMODULES)) | |
251 | ||
252 | clean-dicts: | |
253 | ifndef ALIQUIET | |
254 | @echo "***** Cleaning up G__ files *****" | |
255 | endif | |
256 | $(MUTE)rm -rf */tgt_$(ALICE_TARGET)/G__* | |
257 | ||
258 | clean-modules: | |
259 | ifndef ALIQUIET | |
260 | @echo "***** Cleaning up module.mk files *****" | |
261 | endif | |
262 | $(MUTE)rm -rf $(patsubst %,%/module.mk,$(MODULES)) | |
263 | ||
264 | clean-depend: | |
265 | ifndef ALIQUIET | |
266 | @echo "***** Cleaning up dependencies *****" | |
267 | endif | |
268 | $(MUTE)echo rm `find . -name "*.d"` | |
269 | ||
270 | clean-objects: | |
271 | ifndef ALIQUIET | |
272 | @echo "***** Cleaning up .o files *****" | |
273 | endif | |
274 | $(MUTE)echo rm `find . -name "*.o"` | |
275 | ||
276 | clean-libs: | |
277 | ifndef ALIQUIET | |
278 | @echo "***** Cleaning up library files *****" | |
279 | endif | |
280 | $(MUTE)rm -rf lib/tgt_$(ALICE_TARGET)/* | |
281 | ||
282 | clean-bins: | |
283 | ifndef ALIQUIET | |
284 | @echo "***** Cleaning up binary files *****" | |
285 | endif | |
286 | $(MUTE)rm -rf bin/tgt_$(ALICE_TARGET) |