# Top level Makefile for AliRoot System # # Author: Jan-Erik Revsbech (revsbech@fys.ku.dk) # Developed on idea of Boris Polichtchouk (Boris.Polichtchouk@cern.ch), 15/4/2001 ##### include general path/location macros ##### override ALICE_ROOT=$(shell pwd) include build/Makefile.config ################################################################## # # Where to install libraries and binaries # and common header files LIBPATH=lib/tgt_$(ALICE_TARGET) BINPATH=bin/tgt_$(ALICE_TARGET) EXPORTDIR = $(ALICE_ROOT)/include ################################################################## ################################################################## # include machine dependent macros include build/Makefile.$(ALICE_TARGET) ################################################################## ################################################################## # # Check if called with debug ifeq ($(ALIDEBUG),YES) override ALICE_TARGET:=$(ALICE_TARGET)DEBUG FFLAGS := -g $(filter-out -O%,$(FFLAGS)) CXXFLAGS := -g $(filter-out -O%,$(CXXLAGS)) CFLAGS := -g $(filter-out -O%,$(CLAGS)) endif ################################################################## ################################################################## # # Modules to build MODULES:=PDF PYTHIA PYTHIA6 GEANT321 MINICERN STEER HIJING\ TGeant3 PHOS TRD TPC ZDC MUON PMD FMD TOF ITS \ CASTOR RICH START STRUCT EVGEN RALICE ALIFAST \ THijing CONTAINERS MEVSIM TMEVSIM THbtp HBTP ################################################################## MODULES += ALIROOT MODDIRS := MODULES ############################################################# # # Default include dirs for # C++, Fortran, Cint, and dependencies # The module directory will be added by each module # CXXFLAGS += $(patsubst %,-I%,$(ALICE_ROOT)) CXXFLAGS += -I$(ALICE_ROOT)/include CXXFLAGS += $(patsubst %,-I%,$(ROOTSYS)/include) FFLAGS += $(patsubst %,-I%,$(ALICE_ROOT)) FFLAGS += -I$(ALICE_ROOT)/include FFLAGS += $(patsubst %,-I%,$(ROOTSYS)/include) CINTFLAGS += $(patsubst %,-I%,$(ALICE_ROOT)) CINTFLAGS += -I$(ALICE_ROOT)/include CINTFLAGS += $(patsubst %,-I%,$(ROOTSYS)/include) DEPINC += $(patsubst %,-I%,$(ALICE_ROOT)) DEPINC += -I$(ALICE_ROOT)/include DEPINC += $(patsubst %,-I%,$(ROOTSYS)/include) ############################################################# ############################################################# # # Libraries to link binaries against # Libraries will be linked againstSHLIB LIBS := $(ROOTLIBS) $(SYSLIBS) $(GLIBS) ############################################################# # default target default: alilibs aliroot ############################################################# # # Each module will add to this ALLLIBS := ALLEXECS := INCLUDEFILES := BINLIBS := EXPORTFILES := ############################################################# BINLIBDIRS := -L$(ALICE_ROOT)/$(LIBPATH) .PHONY: alilibs aliroot makedistr #Dependencies of module.mk files include build/module.dep ############################################################# # # Check if module.mk is present for the library %.mk: @echo "***** Creating $@ file *****"; share/alibtool mkmodule $(patsubst %/module.mk,%,$@) > $@; ############################################################# # ************************************************************************** # # If cleaning, do not include # dependencies or module.mk files. ifneq ($(findstring clean,$(MAKECMDGOALS)),clean) ############################################################# # # Include the modules include $(patsubst %,%/module.mk,$(MODULES)) ############################################################# ############################################################# # # include dependencies if not making them! ifneq ($(MAKECMDGOALS),depend) include $(INCLUDEFILES) endif ############################################################# endif # ************************************************************************** # targets aliroot: $(BINPATH) $(ALLEXECS) bin alilibs: $(LIBPATH) $(ALLLIBS) lib # Single Makefile "distribution": Makefile + modules + mkdepend scripts makedistr: $(MODULES) tar -cvf MakeDistr.tar $(patsubst %,%/*.pkg,$(MODULES)) \ Makefile create build/* all: aliroot depend: $(INCLUDEFILES) debug: @echo "***** Entering DEBUG mode. *****" @(export ALIDEBUG=YES && $(MAKE) -f Makefile.flat ) lib: @mkdir lib @mkdir lib/tgt_$(ALICE_TARGET) bin: @mkdir bin @mkdir bin/tgt_$(ALICE_TARGET) $(MODULES): @echo "***** Making $@ *****" mkdir -p $@ $(BINPATH): @echo "***** Making $@ *****" mkdir -p $@ $(LIBPATH): @echo "***** Making $@ *****" mkdir -p $@ cleanall: clean-modules @echo "***** Cleaning up everything ****" rm -rf $(patsubst %,%/module.mk,$(MODULES)) rm -rf $(patsubst %,%/tgt_$(ALICE_TARGET),$(MODULES)) rm -rf lib/tgt_$(ALICE_TARGET) rm -rf bin/tgt_$(ALICE_TARGET) rm -rf $(EXPORTDIR) clean: clean-modules clean-objects clean-libs clean-bins clean-ditcs clead-dicts: @echo "***** Cleaning up G__ files *****" rm -rf */tgt_$(ALICE_TARGET)/G__* clean-modules: @echo "***** Cleaning up module.mk files *****" rm -rf $(patsubst %,%/module.mk,$(MODULES)) clean-depend: @echo "***** Cleaning up dependencies *****" rm -rf */tgt_$(ALICE_TARGET)/*.d rm -rf */tgt_$(ALICE_TARGET)/*/*.d rm -rf */tgt_$(ALICE_TARGET)/*/*/*.d rm -rf */tgt_$(ALICE_TARGET)/*/*/*/*.d clean-objects: @echo "***** Cleaning up .o files *****" rm -rf */tgt_$(ALICE_TARGET)/*.o rm -rf */tgt_$(ALICE_TARGET)/*/*.o rm -rf */tgt_$(ALICE_TARGET)/*/*/*.o rm -rf */tgt_$(ALICE_TARGET)/*/*/*/*.o clean-libs: @echo "***** Cleaning up library files *****" rm -rf lib/tgt_$(ALICE_TARGET)/* clean-bins: @echo "***** Cleaning up binary files *****" rm -rf bin/tgt_$(ALICE_TARGET)