]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - Makefile.flat
Add special treatment for TPC and TRD, they use different trees than other detectors
[u/mrichter/AliRoot.git] / Makefile.flat
index af12e697cae549619eb9d87ac4b55c5bcc20b8eb..f2f7acd579531de2f9ce8db65c19c523399af6de 100644 (file)
@@ -21,7 +21,7 @@ EXPORTDIR = $(ALICE_ROOT)/include
 ##################################################################
 # include machine dependent macros 
 
-include build/Makefile.$(ALICE_TARGET)
+-include build/Makefile.$(ALICE_TARGET)
 ##################################################################
 
 ##################################################################
@@ -41,19 +41,24 @@ endif
 #                   Modules to build 
 
 # COMMENTED OUT FOR TEST PURPOSES
-MODULES:=PDF PYTHIA PYTHIA6 GEANT321 MINICERN STEER HIJING\
+
+ALIROOTMODULES:= STEER \
         TGeant3 PHOS TRD TPC ZDC MUON PMD FMD TOF ITS \
          CASTOR RICH START STRUCT EVGEN RALICE ALIFAST \
         THijing CONTAINERS MEVSIM TMEVSIM THbtp HBTP EMCAL
 
-# MODULES:=STEER HBTP PHOS
+#ALIROOTMODULES:= HBTP
+
+CERNMODULES:= PDF PYTHIA PYTHIA6 GEANT321 MINICERN HIJING
+
+
+MODULES:=$(ALIROOTMODULES) $(CERNMODULES)
 
 ##################################################################
 
 MODULES += ALIROOT 
 
 MODDIRS := MODULES
-                
 
 #############################################################
 # 
@@ -105,7 +110,7 @@ EXPORTFILES :=
 
 BINLIBDIRS := -L$(ALICE_ROOT)/$(LIBPATH)
 
-.PHONY:                alilibs aliroot makedistr headers
+
 
 #Dependencies of module.mk files
 
@@ -124,42 +129,54 @@ include build/module.dep
 #               If cleaning, do not include 
 #             dependencies or module.mk files.
 
-ifneq ($(findstring clean,$(MAKECMDGOALS)),clean)
+ifeq ($(findstring $(MAKECMDGOALS), clean clean-all clean-dicts clean-modules clean-depend clean-objects clean-libs clean-bins),)
+#ifneq ($(findstring clean,$(MAKECMDGOALS)),clean)
 
 #            If makeing modules, not not include
 #                       anything
 
 ifneq ($(findstring modules,$(MAKECMDGOALS)),modules)
 
-
 #############################################################
 # 
 #                Include the modules
-include $(patsubst %,%/module.mk,$(MODULES))
+-include $(patsubst %,%/module.mk,$(MODULES))
 #############################################################
 
 #############################################################
 #
 #          include dependencies if not making them!
-ifneq ($(MAKECMDGOALS),depend)
+ifneq ($(MAKECMDGOALS),depend )
+#           Don't include if cleaning of any sort
+ifneq ($(findstring clean,$(MAKECMDGOALS)),clean)
 include $(INCLUDEFILES)
 endif
+endif
 #############################################################
 
 endif
 endif
 # **************************************************************************
 
+#############################################################
+#
+#              include dummy dependency file
+#               *MUST* be last includefile
+include build/dummy.d
+#############################################################
+
 
 # targets
 
+.PHONY:                alilibs aliroot makedistr clean
+
 modules: $(patsubst %,%/module.mk,$(MODULES))  
 
-aliroot: $(BINPATH) $(ALLEXECS) alilibs bin headers
+aliroot: $(BINPATH) $(ALLEXECS) alilibs bin
 
-headers: $(EXPORTFILES)
+#haders: $(EXPORTFILES)
 
-alilibs: $(LIBPATH) $(ALLLIBS) lib headers modules
+alilibs: $(LIBPATH) $(ALLLIBS) lib modules
 
 # Single Makefile "distribution": Makefile + modules + mkdepend scripts
 makedistr: $(MODULES)   
@@ -193,8 +210,21 @@ $(LIBPATH):
        @echo "***** Making $@ *****"
        mkdir -p $@
 
-
-cleanall: clean-modules
+build/dummy.d: $(EXPORTFILES)
+       @(if [ ! -f $@ ] ; then \
+          touch $@; \
+       fi)
+
+clean:
+       @echo "***** No targen clean, use on of these *****"
+       @echo " clean-aliroot     : Clean up all aliroot libraries"
+       @echo " clean-MODULENAME  : Clean everything from module MODULENAME"
+       @echo " clean-all         : Cleans up everything, including cern libraires"
+       @echo " clean-modules     : Clean all module.mk file in all modules"
+       @echo " clean-libs        : Clean all libraries (not object files)"
+       @echo "********************************************"
+
+clean-all: clean-modules
        @echo "***** Cleaning up everything ****"
        rm -rf $(patsubst %,%/module.mk,$(MODULES)) 
        rm -rf $(patsubst %,%/tgt_$(ALICE_TARGET),$(MODULES))
@@ -202,7 +232,9 @@ cleanall: clean-modules
        rm -rf bin/tgt_$(ALICE_TARGET)
        rm -rf $(EXPORTDIR)
 
-clean: clean-modules  clean-objects clean-libs clean-bins clean-ditcs
+#This cleans only libraries that are not CERN-libraries
+
+clean-aliroot:   $(patsubst %,%/module.mk,$(ALIROOTMODULES)) $(patsubst %,clean-%,$(ALIROOTMODULES))
 
 clean-dicts:
        @echo "***** Cleaning up G__ files *****"