]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - Makefile.flat
Support for Geant4 modules in the flat makefiles
[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 CASTOR RICH START STRUCT EVGEN RALICE ALIFAST \
56 THijing CONTAINERS MEVSIM TMEVSIM THbtp HBTP EMCAL HBTAN
57
58CERNMODULES:= PDF PYTHIA PYTHIA6 GEANT321 MINICERN HIJING
59
60MODULES:=$(ALIROOTMODULES) $(CERNMODULES)
61
62##################################################################
63
64MODULES += ALIROOT
65
66MODDIRS := MODULES
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
75CXXFLAGS += -I$(ALICE_ROOT)/include
76CXXFLAGS += $(patsubst %,-I%,$(ROOTSYS)/include)
77
78CINTFLAGS += -I$(ALICE_ROOT)/include
79CINTFLAGS += $(patsubst %,-I%,$(ROOTSYS)/include)
80
81DEPINC += -I$(ALICE_ROOT)/include
82DEPINC += $(patsubst %,-I%,$(ROOTSYS)/include)
83#############################################################
84
85
86#############################################################
87#
88# Libraries to link binaries against
89# Libraries will be linked againstSHLIB
90LIBS := $(ROOTLIBS) $(SYSLIBS) $(GLIBS)
91#############################################################
92
93
94# default target
95default: alilibs aliroot
96
97
98#############################################################
99#
100# Each module will add to this
101
102ALLLIBS :=
103ALLEXECS :=
104INCLUDEFILES :=
105BINLIBS :=
106EXPORTFILES :=
107#############################################################
108
109BINLIBDIRS := -L$(ALICE_ROOT)/$(LIBPATH)
110
111
112#Dependencies of module.mk files
113
114include build/module.dep
115
116#############################################################
117#
118# Check if module.mk is present for the library
119%.mk: build/module.tpl
120ifndef ALIQUIET
121 @echo "***** Creating $@ file *****";
122endif
123 @share/alibtool mkmodule $(patsubst %/module.mk,%,$@) > $@;
124#############################################################
125
126# **************************************************************************
127#
128# If cleaning, do not include
129# dependencies or module.mk files.
130
131ifeq ($(findstring $(MAKECMDGOALS), clean clean-all clean-dicts clean-modules clean-depend clean-objects clean-libs clean-bins),)
132
133# If making modules, not not include
134# anything
135
136ifneq ($(findstring modules,$(MAKECMDGOALS)),modules)
137
138#############################################################
139#
140# Include the modules
141-include $(patsubst %,%/module.mk,$(MODULES))
142#############################################################
143
144#############################################################
145#
146# include dependencies if not making them!
147ifneq ($(MAKECMDGOALS),depend )
148# Don't include if cleaning of any sort
149ifneq ($(findstring clean,$(MAKECMDGOALS)),clean)
150include $(INCLUDEFILES)
151endif
152endif
153#############################################################
154
155endif
156endif
157# **************************************************************************
158
159#############################################################
160#
161# include dummy dependency file
162# *MUST* be last includefile
163include build/dummy.d
164#############################################################
165
166
167# targets
168
169.PHONY: alilibs aliroot makedistr clean
170
171modules: $(patsubst %,%/module.mk,$(MODULES))
172
173aliroot: $(BINPATH) $(ALLEXECS) alilibs bin
174
175alilibs: $(LIBPATH) $(ALLLIBS) lib modules
176
177# Single Makefile "distribution": Makefile + modules + mkdepend scripts
178makedistr: $(MODULES)
179 tar -cvf MakeDistr.tar $(patsubst %,%/*.pkg,$(MODULES)) \
180 Makefile create build/*
181
182all: aliroot
183
184depend: $(INCLUDEFILES)
185
186debug:
187ifndef ALIQUIET
188 @echo "***** Entering DEBUG mode. *****"
189endif
190 @(export ALIDEBUG=YES && $(MAKE) -f Makefile.flat )
191lib:
192 @mkdir lib
193 @mkdir lib/tgt_$(ALICE_TARGET)
194
195bin:
196 @mkdir bin
197 @mkdir bin/tgt_$(ALICE_TARGET)
198
199$(MODULES):
200ifndef ALIQUIET
201 @echo "***** Making $@ *****"
202endif
203 @mkdir -p $@
204
205$(BINPATH):
206ifndef ALIQUIET
207 @echo "***** Making $@ *****"
208endif
209 @mkdir -p $@
210
211$(LIBPATH):
212ifndef ALIQUIET
213 @echo "***** Making $@ *****"
214endif
215 @mkdir -p $@
216
217build/dummy.d: $(EXPORTFILES)
218 @(if [ ! -f $@ ] ; then \
219 touch $@; \
220 fi)
221
222clean:
223 @echo "***** No targen clean, use one of these *****"
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
231clean-all: clean-modules clean-libs clean-bins
232ifndef ALIQUIET
233 @echo "***** Cleaning up everything ****"
234endif
235 $(MUTE)rm -rf $(patsubst %,%/tgt_$(ALICE_TARGET),$(MODULES))
236 $(MUTE)rm -rf $(EXPORTDIR)
237
238#This cleans only libraries that are not CERN-libraries
239
240clean-aliroot: $(patsubst %,%/module.mk,$(ALIROOTMODULES)) $(patsubst %,clean-%,$(ALIROOTMODULES))
241
242clean-dicts:
243ifndef ALIQUIET
244 @echo "***** Cleaning up G__ files *****"
245endif
246 $(MUTE)rm -rf */tgt_$(ALICE_TARGET)/G__*
247
248clean-modules:
249ifndef ALIQUIET
250 @echo "***** Cleaning up module.mk files *****"
251endif
252 $(MUTE)rm -rf $(patsubst %,%/module.mk,$(MODULES))
253
254clean-depend:
255ifndef ALIQUIET
256 @echo "***** Cleaning up dependencies *****"
257endif
258 $(MUTE)echo rm `find . -name "*.d"`
259
260clean-objects:
261ifndef ALIQUIET
262 @echo "***** Cleaning up .o files *****"
263endif
264 $(MUTE)echo rm `find . -name "*.o"`
265
266clean-libs:
267ifndef ALIQUIET
268 @echo "***** Cleaning up library files *****"
269endif
270 $(MUTE)rm -rf lib/tgt_$(ALICE_TARGET)/*
271
272clean-bins:
273ifndef ALIQUIET
274 @echo "***** Cleaning up binary files *****"
275endif
276 $(MUTE)rm -rf bin/tgt_$(ALICE_TARGET)