##################################################################
# include machine dependent macros
-include build/Makefile.$(ALICE_TARGET)
+-include build/Makefile.$(ALICE_TARGET)
##################################################################
##################################################################
# 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
+ THijing CONTAINERS MEVSIM TMEVSIM THbtp HBTP EMCAL HBTAN
+
+#ALIROOTMODULES:= HBTP
+
+CERNMODULES:= PDF PYTHIA PYTHIA6 GEANT321 MINICERN HIJING
+
-# MODULES:=STEER HBTP PHOS
+MODULES:=$(ALIROOTMODULES) $(CERNMODULES)
##################################################################
MODULES += ALIROOT
MODDIRS := MODULES
-
#############################################################
#
BINLIBDIRS := -L$(ALICE_ROOT)/$(LIBPATH)
-.PHONY: alilibs aliroot makedistr headers
+
#Dependencies of module.mk files
# 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)
@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))
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 *****"