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