]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RICH/Makefile
track counter implemented in ESD reader
[u/mrichter/AliRoot.git] / RICH / Makefile
index fce5d33aa75dbb941b584ec3a5569f2711299412..16c3f4b04ab66549574cfda0f865da977d103ae8 100644 (file)
@@ -1,87 +1,79 @@
-############################### RICH Makefile #################################
+Module                 :=RICH
 
-# Include machine specific definitions
+include        lib$(Module).pkg
 
-include $(ALICE_ROOT)/conf/GeneralDef
-include $(ALICE_ROOT)/conf/MachineDef.$(ALICE_TARGET)
+Sources        :=$(SRCS)
 
-PACKAGE = RICH
+OutputDir      :=$(KIR_DIR)/$(Module)
+SoLib          :=$(KIR_DIR)/lib$(Module).so
 
-# C++ sources
+ifeq ($(shell root-config --arch),linuxicc)
+ Compiler      :=icc
+ CompilerOptions:=-O0 -fpstkchk -I$(shell root-config --incdir) -I$(ALICE_ROOT)/include
+ SoOptions      := -Wl,-soname,lib$(Module).so -shared -O -g   
+else
+ Compiler       :=g++
+ CompilerOptions:=-O -g -W -Wall -fPIC -pipe -fmessage-length=0 -I$(shell root-config --incdir) -I$(ALICE_ROOT)/include
+ SoOptions      := -Wl,-soname,lib$(Module).so -shared -O -g   
+endif
 
-SRCS   = AliRICH.cxx AliRICHv0.cxx AliRICHv1.cxx AliRICHv2.cxx\
-        AliRICHDisplay.cxx AliRICHPoints.cxx AliRICHGeometry.cxx\
-        AliRICHHitMap.cxx AliRICHHitMapA1.cxx AliRICHSegmentation.cxx \
-        AliRICHSegmentationV0.cxx AliRICHTresholdMap.cxx\
-        AliRICHSegmentationV1.cxx AliRICHResponse.cxx AliRICHResponseV0.cxx \
-        AliRICHClusterFinder.cxx \
-        AliRICHChamber.cxx AliRICHDetect.cxx AliRICHPatRec.cxx \
-         AliRICHHit.cxx AliRICHCerenkov.cxx AliRICHPadHit.cxx \
-        AliRICHDigit.cxx AliRICHTransientDigit.cxx \
-        AliRICHRawCluster.cxx AliRICHRecHit.cxx AliRICHEllipse.cxx 
+ifdef ALIVERBOSE
+       Mute            :=
+else
+       Mute            :=@        
+endif        
 
-# C++ Headers
+Headers          := $(Sources:.cxx=.h)  $(Module)LinkDef.h
 
-HDRS          = $(SRCS:.cxx=.h) RICHLinkDef.h
+DictSource    := $(OutputDir)/G__$(Module).cxx
+DictHeader    := $(DictSource:.cxx=.h)
+DictObject    := $(DictSource:.cxx=.o)
 
-# Library dictionary
 
-DICT          = RICHCint.cxx
-DICTH         = $(DICT:.cxx=.h)
-DICTO         = $(patsubst %.cxx,tgt_$(ALICE_TARGET)/%.o,$(DICT))
+Objects         := $(patsubst %.cxx,$(OutputDir)/%.o,$(Sources)) $(DictObject)
 
-# FORTRAN Objectrs
 
-FOBJS         = $(patsubst %.f,tgt_$(ALICE_TARGET)/%.o,$(FSRCS))
-
-# C Objects
-
-COBJS         = $(patsubst %.c,tgt_$(ALICE_TARGET)/%.o,$(CSRCS))
-
-# C++ Objects
-
-OBJS          = $(patsubst %.cxx,tgt_$(ALICE_TARGET)/%.o,$(SRCS)) $(DICTO)
-
-# C++ compilation flags
-
-CXXFLAGS      = $(CXXOPTS) -I$(ROOTSYS)/include -I. -I$(ALICE_ROOT)/include/
-
-CXXFLAGS      += -I$(ALICE_ROOT)/TGeant3
-DEPINC        += -I$(ALICE_ROOT)/TGeant3
-# FORTRAN compilation flags
-
-FFLAGS      = $(FOPT)
+DepFile                := $(OutputDir)/$(Module).d
 
 ##### TARGETS #####
-# Target
-
-SLIBRARY       = $(LIBDIR)/libRICH.$(SL)
-ALIBRARY       = $(LIBDIR)/libRICH.a
-
-default:       $(SLIBRARY)
-
-$(LIBDIR)/libRICH.$(SL):               $(OBJS)
-
-$(DICT):                               $(HDRS)
-
-depend:                                        $(SRCS)
-
-TOCLEAN                = $(OBJS) *Cint.cxx *Cint.h
-
-CHECKS        = $(patsubst %.cxx,check/%.viol,$(SRCS))
-
-############################### General Macros ################################
-
-include $(ALICE_ROOT)/conf/GeneralMacros
 
+$(SoLib):       $(Objects)
+       @echo "Creating $@"
+       $(Mute)$(Compiler) $(SoOptions) $^ -o $@        
+
+$(DepFile):    $(Headers)
+       @[ -d $(OutputDir) ] || mkdir -p $(OutputDir)
+       @touch $(DepFile)
+       @echo "Generating dependency $@"
+       $(Mute)rmkdepend -f$(DepFile) -p$(OutputDir)/ -- $(CxxFlags) -- $(Sources) 2>/dev/null
+
+$(DictSource):  $(Headers)
+       @echo "Generating $@"
+       $(Mute)rootcint -f $@ -c $(filter -I%,$(CompilerOptions)) $^
+
+$(DictObject) : $(DictSource)
+       @echo "Compiling $^"        
+       $(Mute)$(Compiler) $(CompilerOptions) -I. -c $^ -o $@
+
+show:
+       @echo "Headers: $(Headers)"
+       @echo "Sources: $(Sources)"
+       @echo "Depend : $(DepFile)"
+       @echo "Objects: $(Objects)"
+       @echo "Library: $(SoLib)"
+
+spec:  $(Sources)
+       @echo $^
+       @echo $@
+                
+clean:
+       @echo "Cleaning..."
+       $(Mute)rm -rf $(Objects) $(DictSource) $(DictHeader) $(SoLib) $(DepFile)                  
+
+############################ cxx rule #########################################
+$(OutputDir)/%.o : %.cxx
+       @echo $*.cxx
+       $(Mute)$(Compiler) $(CompilerOptions) -c $*.cxx -o $(OutputDir)/$*.o
 ############################ Dependencies #####################################
 
--include tgt_$(ALICE_TARGET)/Make-depend 
-
-
-
-
-
-
+-include $(DepFile)