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