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