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