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