]> git.uio.no Git - u/mrichter/AliRoot.git/blob - RICH/Makefile
Moving lib*.pkg
[u/mrichter/AliRoot.git] / RICH / Makefile
1 Module          :=RICH
2
3 include lib$(Module).pkg
4
5 Sources         :=$(SRCS)
6
7 OutputDir       :=$(KIR_DIR)/$(Module)
8 SoLib           :=$(KIR_DIR)/lib$(Module).so
9
10 ifeq ($(shell root-config --arch),linuxicc)
11  Compiler       :=icc
12  CompilerOptions:=-O0 -fpstkchk -I$(shell root-config --incdir) -I$(ALICE_ROOT)/include
13  SoOptions      := -Wl,-soname,lib$(Module).so -shared -O -g    
14 else
15  Compiler       :=g++
16  CompilerOptions:=-O -g -W -Wall -fPIC -pipe -fmessage-length=0 -I$(shell root-config --incdir) -I$(ALICE_ROOT)/include
17  SoOptions      := -Wl,-soname,lib$(Module).so -shared -O -g    
18 endif
19
20 ifdef ALIVERBOSE
21         Mute            :=
22 else
23         Mute            :=@        
24 endif        
25
26 Headers          := $(Sources:.cxx=.h)  $(Module)LinkDef.h
27
28 DictSource    := $(OutputDir)/G__$(Module).cxx
29 DictHeader    := $(DictSource:.cxx=.h)
30 DictObject    := $(DictSource:.cxx=.o)
31
32
33 Objects         := $(patsubst %.cxx,$(OutputDir)/%.o,$(Sources)) $(DictObject)
34
35
36 DepFile         := $(OutputDir)/$(Module).d
37
38 ##### TARGETS #####
39
40 $(SoLib):        $(Objects)
41         @echo "Creating $@"
42         $(Mute)$(Compiler) $(SoOptions) $^ -o $@        
43
44 $(DepFile):     $(Headers)
45         @[ -d $(OutputDir) ] || mkdir -p $(OutputDir)
46         @touch $(DepFile)
47         @echo "Generating dependency $@"
48         $(Mute)rmkdepend -f$(DepFile) -p$(OutputDir)/ -- $(CxxFlags) -- $(Sources) 2>/dev/null
49
50 $(DictSource):  $(Headers)
51         @echo "Generating $@"
52         $(Mute)rootcint -f $@ -c $(filter -I%,$(CompilerOptions)) $^
53
54 $(DictObject) : $(DictSource)
55         @echo "Compiling $^"        
56         $(Mute)$(Compiler) $(CompilerOptions) -I. -c $^ -o $@
57
58 show:
59         @echo "Headers: $(Headers)"
60         @echo "Sources: $(Sources)"
61         @echo "Depend : $(DepFile)"
62         @echo "Objects: $(Objects)"
63         @echo "Library: $(SoLib)"
64
65 spec:   $(Sources)
66         @echo $^
67         @echo $@
68                 
69 clean:
70         @echo "Cleaning..."
71         $(Mute)rm -rf $(Objects) $(DictSource) $(DictHeader) $(SoLib) $(DepFile)                  
72
73 ############################ cxx rule #########################################
74 $(OutputDir)/%.o : %.cxx
75         @echo $*.cxx
76         $(Mute)$(Compiler) $(CompilerOptions) -c $*.cxx -o $(OutputDir)/$*.o
77 ############################ Dependencies #####################################
78
79 -include $(DepFile)