]>
Commit | Line | Data |
---|---|---|
f2040a8f | 1 | # AliRoot stat project |
2 | # Makefile for main library - libKDTree.so | |
3 | # | |
4 | # Authors | |
5 | # Marian Ivanov [M.Ivanov@gsi.de] | |
6 | # Alexandru Bercuci [A.Bercuci@gsi.de] | |
7 | # Data 01.08.2007 | |
8 | # version 0.0 [pre release] | |
9 | # | |
10 | ||
11 | SrcSuf = cxx | |
12 | HdrSuf = h | |
13 | ExeSuf = | |
14 | ObjSuf = o | |
15 | DllSuf = so | |
16 | OutPutOpt = -o | |
17 | ||
18 | CXX = g++ | |
19 | LD = g++ | |
4d61c301 | 20 | CXXFLAGS = -O -g -pg -fPIC -Wall -Weffc++ |
21 | LDFLAGS = -O -g -pg -fPIC -Wall -Weffc++ | |
4b23a517 | 22 | SOFLAGS = -shared -g -pg -fPIC |
f2040a8f | 23 | |
24 | ROOTCXX = $(shell root-config --cflags) | |
25 | ROOTLIBS = $(shell root-config --libs) -lMinuit | |
26 | ||
9fff023e | 27 | MCCXX = -I$(ALICE_ROOT)/STEER |
f2040a8f | 28 | MCLIBS = |
29 | ||
30 | CXXFLAGS += $(ROOTCXX) $(MCCXX) $(LOCALCXX) | |
31 | ||
32 | # define module specific variables | |
33 | FILE_LIST = $(shell ls -1 ./*.$(SrcSuf)) | |
34 | FILES = $(basename $(FILE_LIST)) | |
9fff023e | 35 | DICTIONARIES = StatDict |
f2040a8f | 36 | OBJECTS = $(addsuffix .$(ObjSuf),$(FILES)) |
37 | OBJECTS += ./$(DICTIONARIES).$(ObjSuf) | |
38 | ||
39 | #define headers | |
40 | HDRS = $(addsuffix .$(HdrSuf),$(FILES)) | |
41 | HEADERS = $(notdir $(HDRS)) | |
42 | ||
43 | # define libs on which the main lib depends ! (this are defined in config/Makefile.flags) | |
44 | LIBSDEPEND = $(ROOTLIBS) $(MCLIBS) | |
45 | # define libs build by module | |
9fff023e | 46 | LIBS = libSTAT.so |
f2040a8f | 47 | |
48 | # rule for building executables | |
49 | $(EXECS): $(OBJECTS) | |
50 | @echo -e "\E[31mBuild executable: \E[1;31m$@\E[0m" | |
51 | @$(LD) $(LIBSDEPEND) $^ -o $@ | |
52 | ||
53 | # rule for building libraries | |
54 | %.$(DllSuf): $(OBJECTS) | |
55 | @echo -e "\E[31mBuild library: \E[1;31m$@\E[0m" | |
56 | @$(LD) $(SOFLAGS) $(LIBSDEPEND) $^ -o $@ | |
57 | ||
58 | # rule for building objects | |
59 | %.$(ObjSuf): %.$(SrcSuf) | |
60 | @echo -e "\E[31mCompile : \E[1;31m$^\E[0m" | |
61 | @$(CXX) $(CXXFLAGS) -c $< -o $@ | |
62 | ||
63 | #rule for building dictionary | |
64 | %Dict.$(SrcSuf): %LinkDef.h | |
65 | @echo -e "\E[31mGenerate dictionary : \E[1;31m$@\E[0m" | |
66 | @rootcint -f $@ -c $(CXXFLAGS) $(HEADERS) $^ | |
67 | ||
68 | all: $(OBJECTS) $(LIBS) $(EXECS) | |
69 | ||
70 | headers: | |
71 | @if [ "$(HEADERS)" != "" ]; then \ | |
72 | if [ ! -d include ]; then mkdir include; fi; \ | |
73 | cp -f $(HEADERS) include; \ | |
74 | fi | |
75 | ||
76 | clean: | |
77 | @rm -fv $(DICTIONARIES) | |
78 | @rm -fv $(OBJECTS) | |
79 | @find . -name "*~" -a -exec rm -fv \{} \; | |
80 | @if [ "$(LIBS)" != "" ]; then rm -fv ./$(LIBS); fi | |
81 | @if [ "$(EXECS)" != "" ]; then rm -fv ./$(EXECS); fi | |
82 | ||
83 | ||
84 | ||
85 |