]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG1/TRD/info/Makefile
copy TRD performance train to PWG1
[u/mrichter/AliRoot.git] / PWG1 / TRD / info / Makefile
1 SrcSuf        = cxx
2 HdrSuf        = h
3 ExeSuf        =
4 ObjSuf        = o
5 DllSuf        = so
6 OutPutOpt     = -o
7
8 CXX           = g++
9 LD            = g++
10 CXXFLAGS      = -O -fPIC
11 LDFLAGS       = -O -fPIC
12 SOFLAGS       = -shared
13
14 ROOTCXX       = $(shell root-config --cflags)
15 ROOTLIBS      = $(shell root-config --libs)
16
17 ALICXX        = -I$(ALICE_ROOT)/include -I$(ALICE_ROOT)/TRD 
18
19 CXXFLAGS     += $(ROOTCXX) $(ALICXX)
20
21 # define module specific variables
22 FILE_LIST =  $(shell ls -1 ./*.$(SrcSuf))
23 FILES = $(basename $(FILE_LIST))
24 DICTIONARIES = trdTrackInfoDict
25 OBJECTS = $(addsuffix .$(ObjSuf),$(FILES))
26 OBJECTS += ./$(DICTIONARIES).$(ObjSuf)
27
28 #define headers
29 HDRS = $(addsuffix .$(HdrSuf),$(FILES)) 
30 HEADERS = $(notdir $(HDRS))
31
32 # define libs on which the main lib depends ! (this are defined in config/Makefile.flags)
33 LIBSDEPEND = $(ROOTLIBS) $(ALILIBS)
34 # define libs build by module
35 LIBS = libTRDtrackInfo.so
36
37
38 # rule for building executables
39 $(EXECS):       $(OBJECTS)
40         @echo -e "\E[31mBuild executable: \E[1;31m$@\E[0m"
41         @$(LD) $(LIBSDEPEND) $^ -o $@
42         
43 # rule for building libraries
44 %.$(DllSuf):    $(OBJECTS)
45         @echo -e "\E[31mBuild library: \E[1;31m$@\E[0m"
46         @$(LD) $(SOFLAGS) $(LIBSDEPEND) $^ -o $@
47         
48 # rule for building objects
49 %.$(ObjSuf):    %.$(SrcSuf)
50         @echo -e "\E[31mCompile : \E[1;31m$^\E[0m"
51         @$(CXX) $(CXXFLAGS) -c $< -o $@
52
53 #rule for building dictionary
54 %Dict.$(SrcSuf): %LinkDef.h
55         @echo -e "\E[31mGenerate dictionary : \E[1;31m$@\E[0m"
56         @rootcint -f $@ -c $(CXXFLAGS) $(HEADERS) $^
57
58 all: $(OBJECTS) $(LIBS) $(EXECS)
59
60 clean:
61         @rm -fv $(DICTIONARIES)
62         @rm -fv $(OBJECTS)
63         @rm -fv $(LIBS)
64         @rm -fv $(EXECS)
65         @if [ "$(LIBS)" != "" ]; then rm -fv lib/$(LIBS); fi
66         @if [ "$(EXECS)" != "" ]; then rm -fv bin/$(EXECS); fi
67         
68