PAR: pass proper defines for certain ROOT features
[u/mrichter/AliRoot.git] / STAT / Makefile
CommitLineData
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
11SrcSuf = cxx
12HdrSuf = h
13ExeSuf =
14ObjSuf = o
15DllSuf = so
16OutPutOpt = -o
17
18CXX = g++
19LD = g++
4d61c301 20CXXFLAGS = -O -g -pg -fPIC -Wall -Weffc++
21LDFLAGS = -O -g -pg -fPIC -Wall -Weffc++
4b23a517 22SOFLAGS = -shared -g -pg -fPIC
f2040a8f 23
24ROOTCXX = $(shell root-config --cflags)
25ROOTLIBS = $(shell root-config --libs) -lMinuit
26
9fff023e 27MCCXX = -I$(ALICE_ROOT)/STEER
f2040a8f 28MCLIBS =
29
30CXXFLAGS += $(ROOTCXX) $(MCCXX) $(LOCALCXX)
31
32# define module specific variables
33FILE_LIST = $(shell ls -1 ./*.$(SrcSuf))
34FILES = $(basename $(FILE_LIST))
9fff023e 35DICTIONARIES = StatDict
f2040a8f 36OBJECTS = $(addsuffix .$(ObjSuf),$(FILES))
37OBJECTS += ./$(DICTIONARIES).$(ObjSuf)
38
39#define headers
40HDRS = $(addsuffix .$(HdrSuf),$(FILES))
41HEADERS = $(notdir $(HDRS))
42
43# define libs on which the main lib depends ! (this are defined in config/Makefile.flags)
44LIBSDEPEND = $(ROOTLIBS) $(MCLIBS)
45# define libs build by module
9fff023e 46LIBS = 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 $@
41f671ab 52
f2040a8f 53# rule for building libraries
54%.$(DllSuf): $(OBJECTS)
55 @echo -e "\E[31mBuild library: \E[1;31m$@\E[0m"
56 @$(LD) $(SOFLAGS) $(LIBSDEPEND) $^ -o $@
41f671ab 57
f2040a8f 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) $^
41f671ab 67
f2040a8f 68all: $(OBJECTS) $(LIBS) $(EXECS)
69
70headers:
71 @if [ "$(HEADERS)" != "" ]; then \
72 if [ ! -d include ]; then mkdir include; fi; \
73 cp -f $(HEADERS) include; \
74 fi
41f671ab 75
f2040a8f 76clean:
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
41f671ab 83 $(LD) $(SOFLAGS) $(LDFLAGS) $^ $(OutPutOpt) $@ $(EXPLLINKLIBS)