]>
Commit | Line | Data |
---|---|---|
d48cca74 | 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 | ||
c3f3a995 | 10 | CxxFlags :=-O -g -W -Wall -fPIC -pipe -fmessage-length=0 -I$(ROOTSYS)/include -I$(ALICE_ROOT)/include |
d48cca74 | 11 | |
12 | ifdef ALIVERBOSE | |
13 | Mute := | |
14 | else | |
15 | Mute :=@ | |
16 | endif | |
17 | ||
18 | Headers := $(Sources:.cxx=.h) $(Module)LinkDef.h | |
19 | ||
20 | DictSource := $(OutputDir)/G__$(Module).cxx | |
21 | DictHeader := $(DictSource:.cxx=.h) | |
22 | DictObject := $(DictSource:.cxx=.o) | |
23 | ||
24 | ||
25 | Objects := $(patsubst %.cxx,$(OutputDir)/%.o,$(Sources)) $(DictObject) | |
26 | ||
27 | ||
28 | DepFile := $(OutputDir)/$(Module).d | |
29 | ||
30 | ##### TARGETS ##### | |
31 | ||
32 | $(SoLib): $(Objects) | |
33 | @echo "Creating $@" | |
34 | $(Mute)g++ -Wl,-soname,lib$(Module).so -shared -O -g $^ -o $@ | |
35 | ||
36 | $(DepFile): $(Headers) | |
37 | @[ -d $(OutputDir) ] || mkdir -p $(OutputDir) | |
38 | @touch $(DepFile) | |
39 | @echo "Generating dependency $@" | |
40 | $(Mute)rmkdepend -f$(DepFile) -p$(OutputDir)/ -- $(CxxFlags) -- $(Sources) 2>/dev/null | |
41 | ||
42 | $(DictSource): $(Headers) | |
43 | @echo "Generating $@" | |
44 | $(Mute)rootcint -f $@ -c $(filter -I%,$(CxxFlags)) $^ | |
45 | ||
46 | $(DictObject) : $(DictSource) | |
47 | @echo "Compiling $^" | |
48 | $(Mute)g++ $(CxxFlags) -I. -c $^ -o $@ | |
49 | ||
50 | show: | |
51 | @echo "Headers: $(Headers)" | |
52 | @echo "Sources: $(Sources)" | |
53 | @echo "Depend : $(DepFile)" | |
54 | @echo "Objects: $(Objects)" | |
55 | @echo "Library: $(SoLib)" | |
56 | ||
57 | spec: $(Sources) | |
58 | @echo $^ | |
59 | @echo $@ | |
60 | ||
61 | clean: | |
62 | @echo "Cleaning..." | |
63 | $(Mute)rm -rf $(Objects) $(DictSource) $(DictHeader) $(SoLib) $(DepFile) | |
64 | ||
65 | ############################ cxx rule ######################################### | |
66 | $(OutputDir)/%.o : %.cxx | |
67 | @echo $*.cxx | |
68 | $(Mute)g++ $(CxxFlags) -c $*.cxx -o $(OutputDir)/$*.o | |
69 | ############################ Dependencies ##################################### | |
70 | ||
71 | -include $(DepFile) |