]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - RICH/RichMake
Working version of the class for the TOF Trigger. For the time being,
[u/mrichter/AliRoot.git] / RICH / RichMake
index 61a95369f9d297f533e44d9ae7e77c3b248d515e..724e17f20cc32d96fbec0c483fa9703a5c083015 100644 (file)
@@ -1,21 +1,51 @@
 Module                 :=RICH
 
-include        lib$(Module).pkg
+include        lib$(Module)base.pkg
+SrcBase        :=$(SRCS)
 
-Sources        :=$(SRCS)
+include        lib$(Module)sim.pkg
+SrcSim         :=$(SRCS)
+
+include        lib$(Module)rec.pkg
+SrcRec         :=$(SRCS)
 
 RootTarget      :=$(shell root-config --arch)
-OutputDir      :=$(MY_LIB)/$(Module)
-SoLib          :=$(MY_LIB)/lib$(Module).so
+DirOut         :=/tmp/$(Module)_$(USER)
+LibBase                :=$(LIB_MY)/lib$(Module)base.so
+LibSim         :=$(LIB_MY)/lib$(Module)sim.so
+LibRec         :=$(LIB_MY)/lib$(Module)rec.so
+
+
+HdrBase       := $(SrcBase:.cxx=.h)  $(Module)baseLinkDef.h
+HdrSim        := $(SrcSim:.cxx=.h)   $(Module)simLinkDef.h
+HdrRec        := $(SrcRec:.cxx=.h)   $(Module)recLinkDef.h
+
+DictSrcBase   := $(DirOut)/Dict$(Module)base.cxx
+DictObjBase   := $(DictSrcBase:.cxx=.o)
+
+DictSrcSim    := $(DirOut)/Dict$(Module)sim.cxx
+DictObjSim    := $(DictSrcSim:.cxx=.o)
+
+DictSrcRec    := $(DirOut)/Dict$(Module)rec.cxx
+DictObjRec    := $(DictSrcRec:.cxx=.o)
+
+
+
+ObjBase       := $(patsubst %.cxx,$(DirOut)/%.o,$(SrcBase)) $(DictObjBase)
+ObjSim        := $(patsubst %.cxx,$(DirOut)/%.o,$(SrcSim))  $(DictObjSim)
+ObjRec        := $(patsubst %.cxx,$(DirOut)/%.o,$(SrcRec))  $(DictObjRec)
+
+
+DepFile              := $(DirOut)/$(Module).depend
 
 ifeq ($(RootTarget),linuxicc)
- Compiler      :=icc
- CompilerOptions:=-O0 -fpstkchk -I$(shell root-config --incdir) -I$(ALICE_ROOT)/include
- SoOptions      := -Wl,-soname,lib$(Module).so -shared -O -g   
+ Compiler    :=icc
+ CompilerOpt :=-O0 -fpstkchk -I$(shell root-config --incdir) -I$(ALICE_ROOT)/include
+ LibOpt      :=-g -shared -Wl
 else
- Compiler       :=g++
- CompilerOptions:=-g -W -Wall -Werror -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -I$(shell root-config --incdir) -I$(ALICE_ROOT)/include
- SoOptions      :=-O -g -shared -Wl,-soname,lib$(Module).so  
+ Compiler    :=g++
+ CompilerOpt :=-g -W -Wall -Woverloaded-virtual -fPIC -pipe -fmessage-length=0 -Wno-long-long -pedantic-errors -ansi -I$(shell root-config --incdir) -I$(ALICE_ROOT)/include
+ LibOpt      :=-g -shared -Wl
 endif
 
 ifdef ALIVERBOSE
@@ -24,57 +54,82 @@ else
        Mute            :=@        
 endif        
 
-Headers          := $(Sources:.cxx=.h)  $(Module)LinkDef.h
-
-DictSource    := $(OutputDir)/G__$(Module).cxx
-DictHeader    := $(DictSource:.cxx=.h)
-DictObject    := $(DictSource:.cxx=.o)
-
-
-Objects         := $(patsubst %.cxx,$(OutputDir)/%.o,$(Sources)) $(DictObject)
-
-
-DepFile                := $(OutputDir)/$(Module).d
-
 ##### TARGETS #####
 
-$(SoLib):       $(Objects)
+all:           $(LibBase) $(LibSim) $(LibRec)
+$(LibBase):    $(ObjBase)
        @echo "Creating $@"
-       $(Mute)$(Compiler) $(SoOptions) $^ -o $@        
+       $(Mute)$(Compiler) $(LibOpt) $^ -o $@   
 
-$(DepFile):    $(Headers)
-       @[ -d $(OutputDir) ] || mkdir -p $(OutputDir)
+$(LibSim):     $(ObjSim)
+       @echo "Creating $@"
+       $(Mute)$(Compiler) $(LibOpt) $^ -o $@   
+        
+$(LibRec):     $(ObjRec)
+       @echo "Creating $@"
+       $(Mute)$(Compiler) $(LibOpt) $^ -o $@   
+        
+$(DepFile):    $(HdrBase) $(HdrSim) $(HdrRec)
+       @[ -d $(DirOut) ] || mkdir -p $(DirOut)
+       @[ -d $(LIB_MY) ] || mkdir -p $(LIB_MY)
        @touch $(DepFile)
        @echo "Generating dependency $@"
-       $(Mute)rmkdepend -f$(DepFile) -p$(OutputDir)/ -- $(CxxFlags) -- $(Sources) 2>/dev/null
+       $(Mute)rmkdepend -f$(DepFile) -p$(DirOut)/ -- $(CompilerOpt) -- $(SrcBase) $(SrcSim) $(SrcRec) 2>/dev/null
 
-$(DictSource):  $(Headers)
+$(DictSrcBase):  $(HdrBase)
+       @echo "Generating $@"
+       $(Mute)rootcint -f $@ -c $(filter -I%,$(CompilerOpt)) $^
+        
+$(DictSrcSim):  $(HdrSim)
+       @echo "Generating $@"
+       $(Mute)rootcint -f $@ -c $(filter -I%,$(CompilerOpt)) $^
+        
+$(DictSrcRec):  $(HdrRec)
        @echo "Generating $@"
-       $(Mute)rootcint -f $@ -c $(filter -I%,$(CompilerOptions)) $^
+       $(Mute)rootcint -f $@ -c $(filter -I%,$(CompilerOpt)) $^
 
-$(DictObject) : $(DictSource)
+$(DictObjBase) : $(DictSrcBase)
+       @echo "Compiling $^"        
+       $(Mute)$(Compiler) $(CompilerOpt) -I. -c $^ -o $@
+        
+$(DictObjSim) : $(DictSrcSim)
+       @echo "Compiling $^"        
+       $(Mute)$(Compiler) $(CompilerOpt) -I. -c $^ -o $@
+        
+$(DictObjRec) : $(DictSrcRec)
        @echo "Compiling $^"        
-       $(Mute)$(Compiler) $(CompilerOptions) -I. -c $^ -o $@
+       $(Mute)$(Compiler) $(CompilerOpt) -I. -c $^ -o $@
 
 show:
-       @echo "Headers: $(Headers)"
-       @echo "Sources: $(Sources)"
-       @echo "Depend : $(DepFile)"
-       @echo "Objects: $(Objects)"
-       @echo "Library: $(SoLib)"
-
-spec:  $(Sources)
-       @echo $^
-       @echo $@
+       @echo    "Base Headers: $(HdrBase)"
+       @echo    "Base Sources: $(SrcBase)"
+       @echo    "Base Objects: $(ObjBase)"
+       @echo    "Base    Dict: $(DictSrcBase)"
+       @echo -e "Base Library: $(LibBase)\n"
+        
+       @echo    "Sim Headers: $(HdrSim)"
+       @echo    "Sim Sources: $(SrcSim)"
+       @echo    "Sim Objects: $(ObjSim)"
+       @echo -e "Sim Library: $(LibSim)\n"
+
+       @echo    "Rec Headers: $(HdrRec)"
+       @echo    "Rec Sources: $(SrcRec)"
+       @echo    "Rec Objects: $(ObjRec)"
+       @echo -e "Rec Library: $(LibRec)\n"
+
+spec:  $(SrcBase)
+       @echo "^ $^"
+       @echo "@ $@"
+       @echo "< $<"
                 
 clean:
        @echo "Cleaning..."
-       $(Mute)rm -rf $(Objects) $(DictSource) $(DictHeader) $(SoLib) $(DepFile)                  
+       $(Mute)rm -rf $(DirOut) $(LibBase) $(LibSim) $(LibRec)
 
 ############################ cxx rule #########################################
-$(OutputDir)/%.o : %.cxx
+$(DirOut)/%.o : %.cxx
        @echo $*.cxx
-       $(Mute)$(Compiler) $(CompilerOptions) -c $*.cxx -o $(OutputDir)/$*.o
+       $(Mute)$(Compiler) $(CompilerOpt) -c $*.cxx -o $(DirOut)/$*.o
 ############################ Dependencies #####################################
 
 -include $(DepFile)