2 # Makefile for main library - libKDTree.so
5 # Marian Ivanov [M.Ivanov@gsi.de]
6 # Alexandru Bercuci [A.Bercuci@gsi.de]
8 # version 0.0 [pre release]
20 CXXFLAGS = -O -g -pg -fPIC -Wall -Weffc++
21 LDFLAGS = -O -g -pg -fPIC -Wall -Weffc++
22 SOFLAGS = -shared -g -pg -fPIC
24 ROOTCXX = $(shell root-config --cflags)
25 ROOTLIBS = $(shell root-config --libs) -lMinuit
27 MCCXX = -I$(ALICE_ROOT)/STEER
30 CXXFLAGS += $(ROOTCXX) $(MCCXX) $(LOCALCXX)
32 # define module specific variables
33 FILE_LIST = $(shell ls -1 ./*.$(SrcSuf))
34 FILES = $(basename $(FILE_LIST))
35 DICTIONARIES = StatDict
36 OBJECTS = $(addsuffix .$(ObjSuf),$(FILES))
37 OBJECTS += ./$(DICTIONARIES).$(ObjSuf)
40 HDRS = $(addsuffix .$(HdrSuf),$(FILES))
41 HEADERS = $(notdir $(HDRS))
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
48 # rule for building executables
50 @echo -e "\E[31mBuild executable: \E[1;31m$@\E[0m"
51 @$(LD) $(LIBSDEPEND) $^ -o $@
53 # rule for building libraries
54 %.$(DllSuf): $(OBJECTS)
55 @echo -e "\E[31mBuild library: \E[1;31m$@\E[0m"
56 @$(LD) $(SOFLAGS) $(LIBSDEPEND) $^ -o $@
58 # rule for building objects
59 %.$(ObjSuf): %.$(SrcSuf)
60 @echo -e "\E[31mCompile : \E[1;31m$^\E[0m"
61 @$(CXX) $(CXXFLAGS) -c $< -o $@
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) $^
68 all: $(OBJECTS) $(LIBS) $(EXECS)
71 @if [ "$(HEADERS)" != "" ]; then \
72 if [ ! -d include ]; then mkdir include; fi; \
73 cp -f $(HEADERS) include; \
77 @rm -fv $(DICTIONARIES)
79 @find . -name "*~" -a -exec rm -fv \{} \;
80 @if [ "$(LIBS)" != "" ]; then rm -fv ./$(LIBS); fi
81 @if [ "$(EXECS)" != "" ]; then rm -fv ./$(EXECS); fi
83 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS)