]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - Makefile
Simplifying calling test, explicite functions for each type of test
[u/mrichter/AliRoot.git] / Makefile
index f1c702c66d30f73ae9c50e766f94e3aee6c2f6d6..590a18f32a91888d4b99ab7d9607fb55f0043f62 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@
 # Author: Jan-Erik Revsbech (revsbech@fys.ku.dk)
 #         Developed on idea of Boris Polichtchouk (Boris.Polichtchouk@cern.ch), 15/4/2001
 
+# /* $Id$ */
 
 ifdef ALIVERBOSE
 MUTE:=
@@ -10,7 +11,11 @@ else
 MUTE:=@
 endif
 
+CLEAN=$(findstring clean,$(MAKECMDGOALS))
+
+#-------------------------------------------------------------------------------
 # IRST coding rule check
+
 IRST_INSTALLDIR=$(ALICE)/local/IRST
 IRST_CONFIG_DIR=$(IRST_INSTALLDIR)/userConfig/ALICE
 CLASSPATH=$(IRST_INSTALLDIR)
@@ -18,41 +23,25 @@ export CLASSPATH IRST_INSTALLDIR IRST_CONFIG_DIR
 CODE_CHECK=java rules.ALICE.ALICERuleChecker
 REV_ENG=$(IRST_INSTALLDIR)/scripts/revEng.sh
 
-
-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 machine dependent macros
 
 -include build/Makefile.$(ALICE_TARGET)
-##################################################################
 
-##################################################################
-#
-#               Check if called with debug
+#-------------------------------------------------------------------------------
+# 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))
+CXXFLAGS := -g $(filter-out -O%,$(CXXFLAGS))
+CFLAGS   := -g $(filter-out -O%,$(CFLAGS))
 SOFLAGS  := -g $(filter-out -O%,$(SOFLAGS))
 LDFLAGS  := -g $(filter-out -O%,$(LDFLAGS))
 endif
-##################################################################
 
-##################################################################
-#
-#               Check if called with profile
+#-------------------------------------------------------------------------------
+# Check if called with profile
 
 ifeq ($(ALIPROFILE),YES)
 override ALICE_TARGET := $(ALICE_TARGET)PROF
@@ -62,170 +51,166 @@ CFLAGS   += -pg
 SOFLAGS  += -pg
 LDFLAGS  += -pg
 endif
-##################################################################
 
-##################################################################
-#
-#               check if DATE is installed
+#-------------------------------------------------------------------------------
+# Check if DATE is installed
 
 ifdef DATE_ROOT
-DATEFLAGS  = -DALI_DATE -D${DATE_SYS} -DDATE_SYS=${DATE_SYS} -Dlong32=${DATE_LONG32} -Dlong64=${DATE_LONG64} -DdatePointer=${DATE_POINTER}
+DATEFLAGS  = -DALI_DATE -D${DATE_SYS} -DDATE_SYS=${DATE_SYS} -Dlong32=${DATE_LONG32} \
+             -Dlong64='${DATE_LONG64}' -DdatePointer=${DATE_POINTER} -I${DATE_COMMON_DEFS}
 CXXFLAGS  += $(DATEFLAGS)
 CFLAGS    += $(DATEFLAGS)
 CINTFLAGS += $(DATEFLAGS)
 DEPINC    += $(DATEFLAGS)
 endif
-##################################################################
 
-##################################################################
-#
-#                   Modules to build
+#-------------------------------------------------------------------------------
+# Location where to install libraries and binaries and common header files
+
+LIBPATH      := lib/tgt_$(ALICE_TARGET)
+BINPATH      := bin/tgt_$(ALICE_TARGET)
+EXPORTDIR    := $(ALICE_ROOT)/include
+BINLIBDIRS   := -L$(ALICE_ROOT)/$(LIBPATH)
+
+#-------------------------------------------------------------------------------
+# Modules to build
 
-# Uncomment to show some output
-#$(warning MAKECMDGOALS=$(MAKECMDGOALS))
+ifeq (ALIVERBOSE,2)
+$(warning MAKECMDGOALS=$(MAKECMDGOALS))
+endif
 
 ALIROOTMODULES := STEER PHOS TRD TPC ZDC MUON PMD FMD TOF ITS \
       CRT RICH START STRUCT EVGEN RALICE ALIFAST VZERO \
-      THijing CONTAINERS MEVSIM TMEVSIM THbtp HBTP EMCAL HBTAN \
+      THijing MEVSIM TMEVSIM THbtp HBTP EMCAL HBTAN \
       THerwig TEPEMGEN EPEMGEN FASTSIM TPHIC RAW MONITOR DISPLAY ANALYSIS \
-      JETAN HLT TFluka
-
-CERNMODULES := PDF PYTHIA6 HIJING MICROCERN HERWIG
-
-MODULES := $(ALIROOTMODULES) $(CERNMODULES)
+      JETAN HLT LHC
 
 ifeq ($(findstring TFluka,$(MAKECMDGOALS)),TFluka)
-MODULES += TFluka
+ALIROOTMODULES += TFluka
 endif
 
 ifeq ($(findstring Flugg,$(MAKECMDGOALS)),Flugg)
-MODULES += Flugg
+ALIROOTMODULES += Flugg
 endif
 
-##################################################################
+CERNMODULES := PDF PYTHIA6 HIJING MICROCERN HERWIG
 
-MODULES += ALIROOT
+MODULES := $(ALIROOTMODULES) $(CERNMODULES) ALIROOT
 
 MODDIRS := $(MODULES)
 
-#############################################################
-#
-#               Default include dirs for
-#          C++, Fortran, Cint, and dependencies
-#      The module directory will be added by each module
-#
+#-------------------------------------------------------------------------------
+# Default include dirs for C++, Fortran, Cint, and dependencies
+# The module directory will be added by each module
 
 GENINC     := -I$(ALICE_ROOT)/include -I$(shell root-config --incdir)
-
 CXXFLAGS   += $(GENINC)
 CXXFLAGSNO += $(GENINC)
 CINTFLAGS  += $(GENINC)
 DEPINC     += $(GENINC)
 
-#############################################################
+#-------------------------------------------------------------------------------
+# Libraries to link binaries against
+# Libraries will be linked against SHLIB
+# ROOT libraries 
 
+ROOTCLIBS     := $(shell root-config --glibs) -lThread -lMinuit -lHtml -lVMC -lEG -lGeom
 
-#############################################################
-#
-#             Libraries to link binaries against
-#            Libraries will be linked againstSHLIB
-LIBS := $(GLIBS) $(ROOTLIBS) $(SYSLIBS)
-#############################################################
+ROOTPLIBS     := -lEGPythia6
+
+ALILIBS              := -L$(LIBDIR) -lMUON -lTPC -lPMD -lTRD -lFMD -lTOF \
+                -lITS -lPHOS -lCRT -lRICH -lVZERO -lZDC -lSTRUCT \
+                -lSTART -lEVGEN -lSTEER
 
+LIBS := $(ROOTCLIBS) $(ROOTPLIBS) $(SYSLIBS)
 
+#-------------------------------------------------------------------------------
 # default target
-default:     alilibs  aliroot
 
+default:
+       $(MUTE)$(MAKE) aliroot
 
-#############################################################
-#
-#            Each module will add to this
+FORCE:
+
+#-------------------------------------------------------------------------------
+# Each module will add to these macros
 
 ALLLIBS      :=
 ALLEXECS     :=
 INCLUDEFILES :=
 BINLIBS      :=
 EXPORTFILES  :=
-#############################################################
 
-BINLIBDIRS   := -L$(ALICE_ROOT)/$(LIBPATH)
-
-
-#Dependencies of module.mk files
+#-------------------------------------------------------------------------------
+# Dependencies of module.mk files if not cleaning
 
+ifeq ($(CLEAN),)
 include build/module.dep
+endif
 
-#############################################################
-#
-#        Check if module.mk is present for the library
-%.mk: build/module.tpl
+#-------------------------------------------------------------------------------
+# Check if module.mk is present for the library
+
+%.mk: build/module.tpl build/header.tpl build/clean.tpl share/alibtool
 ifndef ALIQUIET
        @echo "***** Creating $@ file *****";
 endif
        @share/alibtool mkmodule  $(patsubst %/module.mk,%,$@) > $@;
-#############################################################
-
-# **************************************************************************
-#
-#               If cleaning, do not include
-#             dependencies or module.mk files.
 
-ifeq ($(findstring $(MAKECMDGOALS), clean distclean clean-all clean-dicts clean-modules clean-depend clean-objects clean-libs clean-bins),)
+#-------------------------------------------------------------------------------
+# If making modules, not not include anything
 
-#            If making modules, not not include
-#                       anything
+ifeq ($(findstring modules,$(MAKECMDGOALS)),)
 
-ifneq ($(findstring modules,$(MAKECMDGOALS)),modules)
+#-------------------------------------------------------------------------------
+# Include the modules
 
-#############################################################
-#
-#                Include the modules
 -include $(patsubst %,%/module.mk,$(MODULES))
 
-#
-#
-#############################################################
+#-------------------------------------------------------------------------------
+# If cleaning, do not include dependencies or module.mk files.
 
-#############################################################
-#
-#          include dependencies if not making them!
-ifneq ($(MAKECMDGOALS),depend )
-#           Don't include if cleaning of any sort
-ifneq ($(findstring clean,$(MAKECMDGOALS)),clean)
-#$(warning INCLUDEFILES=$(INCLUDEFILES))
+ifeq ($(CLEAN),)
+
+#-------------------------------------------------------------------------------
+# Include dependencies if not making them!
+
+ifneq ($(MAKECMDGOALS),depend)
+ifneq ($(MAKECMDGOALS),)
+
+ifeq (ALIVERBOSE,2)
+$(warning INCLUDEFILES=$(INCLUDEFILES))
+endif
 -include $(INCLUDEFILES)
+
 endif
 endif
-#############################################################
-
 endif
 endif
-# **************************************************************************
 
-#############################################################
-#
-#              include dummy dependency file
-#               *MUST* be last includefile
+#-------------------------------------------------------------------------------
+# Include dummy dependency file *MUST* be last includefile
+
 include build/dummy.d
-#############################################################
 
 
-# targets
+#-------------------------------------------------------------------------------
+# Targets
 
 .PHONY:                alilibs aliroot makedistr clean distclean clean-all \
-               htmldoc profile
+               htmldoc profile modules depend
 
 modules: $(patsubst %,%/module.mk,$(MODULES)) 
 
-
-aliroot: $(BINPATH) $(ALLEXECS) alilibs bin
-
 ifeq ($(ALIPROFILE),YES)
-alilibs: $(LIBPATH) $(ALLLIBS) $(ALLALIBS) lib modules
+alilibs: $(LIBPATH) modules $(ALLLIBS) $(ALLALIBS)
 else
-alilibs: $(LIBPATH) $(ALLLIBS) lib modules
+alilibs: $(LIBPATH) modules $(ALLLIBS)
 endif
 
+aliroot: alilibs $(BINPATH) $(ALLEXECS) 
+
+#-------------------------------------------------------------------------------
 # Single Makefile "distribution": Makefile + modules + mkdepend scripts
 makedistr: $(MODULES)
         tar -cvf MakeDistr.tar $(patsubst %,%/*.pkg,$(MODULES)) \
@@ -233,28 +218,19 @@ makedistr: $(MODULES)
 
 all: aliroot
 
-
 depend: $(INCLUDEFILES)
 
 debug:
 ifndef ALIQUIET
        @echo "***** Entering DEBUG mode. *****"
 endif
-       @(export ALIDEBUG=YES && $(MAKE))
+       @(export ALIDEBUG=YES && $(MAKE) aliroot)
 
 profile:
 ifndef ALIQUIET
        @echo "***** Entering PROFILE mode. *****"
 endif
-       @(export ALIPROFILE=YES && $(MAKE))
-
-lib:
-       @mkdir lib
-       @mkdir lib/tgt_$(ALICE_TARGET)
-
-bin:
-       @mkdir bin
-       @mkdir bin/tgt_$(ALICE_TARGET)
+       @(export ALIPROFILE=YES && $(MAKE) aliroot)
 
 $(MODULES):
 ifndef ALIQUIET
@@ -299,7 +275,8 @@ endif
 distclean: clean-all
        $(MUTE)rm -rf */tgt_* bin lib
 
-#This cleans only libraries that are not CERN-libraries
+#-------------------------------------------------------------------------------
+# This cleans only libraries that are not CERN-libraries
 
 clean-aliroot:   $(patsubst %,%/module.mk,$(ALIROOTMODULES)) $(patsubst %,clean-%,$(ALIROOTMODULES))