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