Extended Global2Local to include slice as input
[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
efaab2ef 24include 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
f347de98 44MODULES:=PDF PYTHIA PYTHIA6 GEANT321 MINICERN STEER HIJING\
45 TGeant3 PHOS TRD TPC ZDC MUON PMD FMD TOF ITS \
46 CASTOR RICH START STRUCT EVGEN RALICE ALIFAST \
1cd01d78 47 THijing CONTAINERS MEVSIM TMEVSIM THbtp HBTP EMCAL
896cb507 48
49# MODULES:=STEER HBTP PHOS
50
f347de98 51##################################################################
efaab2ef 52
53MODULES += ALIROOT
54
55MODDIRS := MODULES
56
f347de98 57
58#############################################################
59#
60# Default include dirs for
61# C++, Fortran, Cint, and dependencies
62# The module directory will be added by each module
63#
64
efaab2ef 65CXXFLAGS += $(patsubst %,-I%,$(ALICE_ROOT))
f347de98 66CXXFLAGS += -I$(ALICE_ROOT)/include
efaab2ef 67CXXFLAGS += $(patsubst %,-I%,$(ROOTSYS)/include)
68
69FFLAGS += $(patsubst %,-I%,$(ALICE_ROOT))
f347de98 70FFLAGS += -I$(ALICE_ROOT)/include
efaab2ef 71FFLAGS += $(patsubst %,-I%,$(ROOTSYS)/include)
72
73CINTFLAGS += $(patsubst %,-I%,$(ALICE_ROOT))
f347de98 74CINTFLAGS += -I$(ALICE_ROOT)/include
efaab2ef 75CINTFLAGS += $(patsubst %,-I%,$(ROOTSYS)/include)
76
77DEPINC += $(patsubst %,-I%,$(ALICE_ROOT))
f347de98 78DEPINC += -I$(ALICE_ROOT)/include
efaab2ef 79DEPINC += $(patsubst %,-I%,$(ROOTSYS)/include)
f347de98 80#############################################################
efaab2ef 81
82
f347de98 83#############################################################
84#
85# Libraries to link binaries against
86# Libraries will be linked againstSHLIB
efaab2ef 87LIBS := $(ROOTLIBS) $(SYSLIBS) $(GLIBS)
f347de98 88#############################################################
efaab2ef 89
90
91# default target
92default: alilibs aliroot
93
f347de98 94
95#############################################################
96#
97# Each module will add to this
98
efaab2ef 99ALLLIBS :=
100ALLEXECS :=
101INCLUDEFILES :=
102BINLIBS :=
f347de98 103EXPORTFILES :=
104#############################################################
efaab2ef 105
106BINLIBDIRS := -L$(ALICE_ROOT)/$(LIBPATH)
107
896cb507 108.PHONY: alilibs aliroot makedistr headers
efaab2ef 109
110#Dependencies of module.mk files
111
112include build/module.dep
113
f347de98 114#############################################################
115#
116# Check if module.mk is present for the library
efaab2ef 117%.mk:
118 @echo "***** Creating $@ file *****";
896cb507 119 @share/alibtool mkmodule $(patsubst %/module.mk,%,$@) > $@;
f347de98 120#############################################################
121
122# **************************************************************************
123#
124# If cleaning, do not include
125# dependencies or module.mk files.
efaab2ef 126
efaab2ef 127ifneq ($(findstring clean,$(MAKECMDGOALS)),clean)
128
896cb507 129# If makeing modules, not not include
130# anything
131
132ifneq ($(findstring modules,$(MAKECMDGOALS)),modules)
133
134
f347de98 135#############################################################
136#
137# Include the modules
efaab2ef 138include $(patsubst %,%/module.mk,$(MODULES))
f347de98 139#############################################################
efaab2ef 140
f347de98 141#############################################################
142#
143# include dependencies if not making them!
efaab2ef 144ifneq ($(MAKECMDGOALS),depend)
145include $(INCLUDEFILES)
146endif
f347de98 147#############################################################
efaab2ef 148
149endif
896cb507 150endif
f347de98 151# **************************************************************************
152
efaab2ef 153
154# targets
155
896cb507 156modules: $(patsubst %,%/module.mk,$(MODULES))
157
158aliroot: $(BINPATH) $(ALLEXECS) alilibs bin headers
efaab2ef 159
896cb507 160headers: $(EXPORTFILES)
efaab2ef 161
896cb507 162alilibs: $(LIBPATH) $(ALLLIBS) lib headers modules
efaab2ef 163
164# Single Makefile "distribution": Makefile + modules + mkdepend scripts
165makedistr: $(MODULES)
166 tar -cvf MakeDistr.tar $(patsubst %,%/*.pkg,$(MODULES)) \
167 Makefile create build/*
168
169all: aliroot
170
f347de98 171depend: $(INCLUDEFILES)
efaab2ef 172
173debug:
174 @echo "***** Entering DEBUG mode. *****"
175 @(export ALIDEBUG=YES && $(MAKE) -f Makefile.flat )
176lib:
177 @mkdir lib
178 @mkdir lib/tgt_$(ALICE_TARGET)
179
180bin:
181 @mkdir bin
182 @mkdir bin/tgt_$(ALICE_TARGET)
183
184$(MODULES):
185 @echo "***** Making $@ *****"
186 mkdir -p $@
187
188$(BINPATH):
189 @echo "***** Making $@ *****"
190 mkdir -p $@
191
192$(LIBPATH):
193 @echo "***** Making $@ *****"
194 mkdir -p $@
195
196
f347de98 197cleanall: clean-modules
efaab2ef 198 @echo "***** Cleaning up everything ****"
199 rm -rf $(patsubst %,%/module.mk,$(MODULES))
200 rm -rf $(patsubst %,%/tgt_$(ALICE_TARGET),$(MODULES))
201 rm -rf lib/tgt_$(ALICE_TARGET)
202 rm -rf bin/tgt_$(ALICE_TARGET)
f347de98 203 rm -rf $(EXPORTDIR)
efaab2ef 204
f347de98 205clean: clean-modules clean-objects clean-libs clean-bins clean-ditcs
efaab2ef 206
896cb507 207clean-dicts:
f347de98 208 @echo "***** Cleaning up G__ files *****"
209 rm -rf */tgt_$(ALICE_TARGET)/G__*
efaab2ef 210clean-modules:
211 @echo "***** Cleaning up module.mk files *****"
212 rm -rf $(patsubst %,%/module.mk,$(MODULES))
213
214clean-depend:
215 @echo "***** Cleaning up dependencies *****"
216 rm -rf */tgt_$(ALICE_TARGET)/*.d
217 rm -rf */tgt_$(ALICE_TARGET)/*/*.d
218 rm -rf */tgt_$(ALICE_TARGET)/*/*/*.d
219 rm -rf */tgt_$(ALICE_TARGET)/*/*/*/*.d
220
221clean-objects:
222 @echo "***** Cleaning up .o files *****"
223 rm -rf */tgt_$(ALICE_TARGET)/*.o
224 rm -rf */tgt_$(ALICE_TARGET)/*/*.o
225 rm -rf */tgt_$(ALICE_TARGET)/*/*/*.o
226 rm -rf */tgt_$(ALICE_TARGET)/*/*/*/*.o
227
228clean-libs:
229 @echo "***** Cleaning up library files *****"
230 rm -rf lib/tgt_$(ALICE_TARGET)/*
231
232clean-bins:
233 @echo "***** Cleaning up binary files *****"
234 rm -rf bin/tgt_$(ALICE_TARGET)
235
236
237
238
239
240
241