-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
51 lines (41 loc) · 1.47 KB
/
GNUmakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# GNU makefile for RooConstrainedFit
# S. Kluth 9/2012
LD = $(CXX)
CXXFLAGS = -Wall -fPIC -g
LIBFILES = Constraints.cc ClsqSolver.cc parspec.cc
TESTLIBFILES = Dodo.cc LinearConstraintFunction.cc
TESTFILE = testConstraints.cc testClsqSolver.cc testparspec.cc
TESTEXE = $(basename $(TESTFILE) )
LIBOBJS = $(LIBFILES:.cc=.o)
TESTLIBOBJS = $(TESTLIBFILES:.cc=.o)
LIB = libRooConstrainedFit.so
TESTLIB = libRooConstrainedFitTest.so
DEPS = $(LIBFILES:.cc=.d) $(TESTFILE:.cc=.d)
PROJECTPATH = $(shell echo $${PWD%/*} )
CPPFLAGS = -I $(PROJECTPATH)/RooAverageTools
LDFLAGS = -L $(PROJECTPATH)/RooAverageTools
LDLIBS = -lRooAverageTools -lMatrix -lCore
ifdef HEPROOT
CPPFLAGS += -I $(HEPROOT)/include -I $(HEPROOT)/include/boost-1_48/ -g
LDFLAGS += -L $(HEPROOT)/lib64
LDLIBS += -lboost_unit_test_framework-gcc46-mt-1_48
else
CPPFLAGS += -I $(ROOTSYS)/include -g
LDFLAGS += -L $(ROOTSYS)/lib
LDLIBS += -lboost_unit_test_framework
endif
LD_LIBRARY_PATH := $(LD_LIBRARY_PATH):$(PROJECTPATH)/RooAverageTools:$(PROJECTPATH)/INIParser
.INTERMEDIATE: $(LIBOBJS) $(TESTLIBOBJS) $(TESTFILE:.cc=.o)
all: $(TESTEXE)
$(DEPS): %.d: %.cc
$(CXX) $(CPPFLAGS) -MM $< -MF $@
-include $(DEPS)
$(LIB): $(LIBOBJS)
$(LD) -shared -o $@ $^ $(LDFLAGS) $(LDLIBS)
$(TESTLIB): $(TESTLIBOBJS)
$(LD) -shared -o $@ $^ $(LDFLAGS) $(LDLIBS)
$(TESTEXE): %: %.o $(LIB) $(TESTLIB)
$(LD) -o $@ $^ $(LDFLAGS) $(LDLIBS) -g
LD_LIBRARY_PATH=$(LD_LIBRARY_PATH): ./$@ --log_level=message
clean:
rm -f $(DEPS) $(TESTEXE) $(LIB) $(TESTLIB)