X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=RICH%2FMakefile;h=16c3f4b04ab66549574cfda0f865da977d103ae8;hb=0cf7de2b564ce601cf7ccf80010d25f2e407c35d;hp=8bd07cbd073eef4062859cc095f811fcf92efccb;hpb=b762c2f6e9ccc6f54f3288b4c9081af2f6c76ba2;p=u%2Fmrichter%2FAliRoot.git diff --git a/RICH/Makefile b/RICH/Makefile index 8bd07cbd073..16c3f4b04ab 100644 --- a/RICH/Makefile +++ b/RICH/Makefile @@ -1,85 +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\ - AliRICHSegmentationV0.cxx AliRICHTresholdMap.cxx\ - AliRICHSegmentationV1.cxx AliRICHResponse.cxx AliRICHResponseV0.cxx \ - AliRICHClusterFinder.cxx AliRICHHitMapA1.cxx\ - AliRICHChamber.cxx AliRICHDetect.cxx AliRICHPatRec.cxx \ - AliRICHHit.cxx AliRICHCerenkov.cxx AliRICHSDigit.cxx \ - AliRICHDigit.cxx AliRICHTransientDigit.cxx \ - AliRICHRawCluster.cxx AliRICHRecHit1D.cxx AliRICHRecHit3D.cxx AliRICHEllipse.cxx \ - AliRICHMerger.cxx AliRICHDigitizer.cxx +ifdef ALIVERBOSE + Mute := +else + Mute :=@ +endif -# C++ Headers +Headers := $(Sources:.cxx=.h) $(Module)LinkDef.h -#HDRS = $(SRCS:.cxx=.h) $(ROOTSYS)/include/TClonesArray.h RICHLinkDef.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/ - -# 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)