]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - Makefile.flat
Minor changes to make it work with new Top Makefile. Also have generated code separat...
[u/mrichter/AliRoot.git] / Makefile.flat
... / ...
CommitLineData
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 #####
8override ALICE_ROOT=$(shell pwd)
9
10ifdef ALIVERBOSE
11MUTE:=
12else
13MUTE:=@
14endif
15
16include build/Makefile.config
17##################################################################
18#
19# Where to install libraries and binaries
20# and common header files
21
22LIBPATH=lib/tgt_$(ALICE_TARGET)
23BINPATH=bin/tgt_$(ALICE_TARGET)
24EXPORTDIR = $(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
37ifeq ($(ALIDEBUG),YES)
38override ALICE_TARGET:=$(ALICE_TARGET)DEBUG
39FFLAGS := -g $(filter-out -O%,$(FFLAGS))
40CXXFLAGS := -g $(filter-out -O%,$(CXXLAGS))
41CFLAGS := -g $(filter-out -O%,$(CLAGS))
42SOFLAGS := -g $(filter-out -O%,$(SOFLAGS))
43LDFLAGS := -g $(filter-out -O%,$(LDFLAGS))
44endif
45##################################################################
46
47##################################################################
48#
49# Modules to build
50
51# COMMENTED OUT FOR TEST PURPOSES
52
53ALIROOTMODULES:= 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
59GEANT4MODULES:= TGeant4 AliGeant4
60ifeq ($(MAKECMDGOALS),geant4)
61ALIROOTMODULES += $(GEANT4MODULES)
62endif
63
64CERNMODULES:= PDF PYTHIA PYTHIA6 GEANT321 MINICERN HIJING
65
66MODULES:=$(ALIROOTMODULES) $(CERNMODULES)
67
68##################################################################
69
70MODULES += ALIROOT
71
72MODDIRS := 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
81CXXFLAGS += -I$(ALICE_ROOT)/include
82CXXFLAGS += $(patsubst %,-I%,$(ROOTSYS)/include)
83
84CINTFLAGS += -I$(ALICE_ROOT)/include
85CINTFLAGS += $(patsubst %,-I%,$(ROOTSYS)/include)
86
87DEPINC += -I$(ALICE_ROOT)/include
88DEPINC += $(patsubst %,-I%,$(ROOTSYS)/include)
89#############################################################
90
91
92#############################################################
93#
94# Libraries to link binaries against
95# Libraries will be linked againstSHLIB
96LIBS := $(ROOTLIBS) $(SYSLIBS) $(GLIBS)
97#############################################################
98
99
100# default target
101default: alilibs aliroot
102
103
104#############################################################
105#
106# Each module will add to this
107
108ALLLIBS :=
109ALLEXECS :=
110INCLUDEFILES :=
111BINLIBS :=
112EXPORTFILES :=
113#############################################################
114
115BINLIBDIRS := -L$(ALICE_ROOT)/$(LIBPATH)
116
117
118#Dependencies of module.mk files
119
120include build/module.dep
121
122#############################################################
123#
124# Check if module.mk is present for the library
125%.mk: build/module.tpl
126ifndef ALIQUIET
127 @echo "***** Creating $@ file *****";
128endif
129 @share/alibtool mkmodule $(patsubst %/module.mk,%,$@) > $@;
130#############################################################
131
132# **************************************************************************
133#
134# If cleaning, do not include
135# dependencies or module.mk files.
136
137ifeq ($(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
142ifneq ($(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!
153ifneq ($(MAKECMDGOALS),depend )
154# Don't include if cleaning of any sort
155ifneq ($(findstring clean,$(MAKECMDGOALS)),clean)
156include $(INCLUDEFILES)
157endif
158endif
159#############################################################
160
161endif
162endif
163# **************************************************************************
164
165#############################################################
166#
167# include dummy dependency file
168# *MUST* be last includefile
169include build/dummy.d
170#############################################################
171
172
173# targets
174
175.PHONY: alilibs aliroot geant4 makedistr clean
176
177modules: $(patsubst %,%/module.mk,$(MODULES))
178
179geant4modules: $(patsubst %,%/module.mk,$(GEANT4MODULES))
180
181aliroot: $(BINPATH) $(ALLEXECS) alilibs bin
182
183geant4: aliroot
184
185alilibs: $(LIBPATH) $(ALLLIBS) lib modules
186
187# Single Makefile "distribution": Makefile + modules + mkdepend scripts
188makedistr: $(MODULES)
189 tar -cvf MakeDistr.tar $(patsubst %,%/*.pkg,$(MODULES)) \
190 Makefile create build/*
191
192all: aliroot
193
194depend: $(INCLUDEFILES)
195
196debug:
197ifndef ALIQUIET
198 @echo "***** Entering DEBUG mode. *****"
199endif
200 @(export ALIDEBUG=YES && $(MAKE) -f Makefile.flat )
201lib:
202 @mkdir lib
203 @mkdir lib/tgt_$(ALICE_TARGET)
204
205bin:
206 @mkdir bin
207 @mkdir bin/tgt_$(ALICE_TARGET)
208
209$(MODULES):
210ifndef ALIQUIET
211 @echo "***** Making $@ *****"
212endif
213 @mkdir -p $@
214
215$(BINPATH):
216ifndef ALIQUIET
217 @echo "***** Making $@ *****"
218endif
219 @mkdir -p $@
220
221$(LIBPATH):
222ifndef ALIQUIET
223 @echo "***** Making $@ *****"
224endif
225 @mkdir -p $@
226
227build/dummy.d: $(EXPORTFILES)
228 @(if [ ! -f $@ ] ; then \
229 touch $@; \
230 fi)
231
232clean:
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
241clean-all: clean-modules clean-libs clean-bins
242ifndef ALIQUIET
243 @echo "***** Cleaning up everything ****"
244endif
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
250clean-aliroot: $(patsubst %,%/module.mk,$(ALIROOTMODULES)) $(patsubst %,clean-%,$(ALIROOTMODULES))
251
252clean-dicts:
253ifndef ALIQUIET
254 @echo "***** Cleaning up G__ files *****"
255endif
256 $(MUTE)rm -rf */tgt_$(ALICE_TARGET)/G__*
257
258clean-modules:
259ifndef ALIQUIET
260 @echo "***** Cleaning up module.mk files *****"
261endif
262 $(MUTE)rm -rf $(patsubst %,%/module.mk,$(MODULES))
263
264clean-depend:
265ifndef ALIQUIET
266 @echo "***** Cleaning up dependencies *****"
267endif
268 $(MUTE)echo rm `find . -name "*.d"`
269
270clean-objects:
271ifndef ALIQUIET
272 @echo "***** Cleaning up .o files *****"
273endif
274 $(MUTE)echo rm `find . -name "*.o"`
275
276clean-libs:
277ifndef ALIQUIET
278 @echo "***** Cleaning up library files *****"
279endif
280 $(MUTE)rm -rf lib/tgt_$(ALICE_TARGET)/*
281
282clean-bins:
283ifndef ALIQUIET
284 @echo "***** Cleaning up binary files *****"
285endif
286 $(MUTE)rm -rf bin/tgt_$(ALICE_TARGET)