-
Notifications
You must be signed in to change notification settings - Fork 13
/
Makefile.libBinnedValues
56 lines (43 loc) · 1.63 KB
/
Makefile.libBinnedValues
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
51
52
53
54
55
56
## adapted from plotIt/Makefile
ObjSuf = o
SrcSuf = cc
DllSuf = so
ROOTCFLAGS = $(shell root-config --cflags)
ROOTLIBS = $(shell root-config --noldflags --libs)
BOOST_ROOT = $(shell scram tool tag boost BOOST_BASE)
CXXFLAGS = -g -Wall -fPIC --std=c++11 -O3 -DSTANDALONE_SCALEFACTORS
LD = $(CXX)
LDDIR = -L$(shell root-config --libdir) -L$(BOOST_ROOT)/lib/
LDFLAGS = -fPIC $(shell root-config --ldflags) $(LDDIR)
SOFLAGS =
AR = ar
ARFLAGS = -cq
CXXFLAGS += $(ROOTCFLAGS) $(INCLUDES) -I../.. -I$(shell echo $(BOOST_ROOT))/include ## assume to be in cp3_llbb/Framework
LIBS = $(ROOTLIBS) ## TODO get the right ones from boost
STATIC_LIBS =
#------------------------------------------------------------------------------
SOURCES = src/BinnedValues.cc src/BinnedValuesJSONParser.cc
OBJECTS = $(SOURCES:.$(SrcSuf)=.$(ObjSuf))
DEPENDS = $(SOURCES:.$(SrcSuf)=.d)
.SUFFIXES: .$(SrcSuf) .$(ObjSuf)
###
all: print_deps libBinnedValues.$(DllSuf)
print_deps:
@echo "Building BinnedValuseJSONParser library with Boost and ROOT from current CMSSW environment..."
@echo "Using ROOT from $(shell root-config --prefix)"
@echo "Using Boost from $(shell scram tool tag boost BOOST_BASE)"
clean:
@rm -f $(OBJECTS);
@rm -f $(DEPENDS);
libBinnedValues.$(DllSuf): $(OBJECTS)
@echo "Linking $@..."
@$(LD) -shared $(SOFLAGS) $(LDFLAGS) $+ -o $@ -Wl,-Bstatic $(STATIC_LIBS) -Wl,-Bdynamic $(LIBS)
%.o: %.cc
@echo "Compiling $<..."
@$(CXX) $(CXXFLAGS) -c -o $@ $<
# Make the dependencies
%.d: %.cc
@ $(CXX) $(CXXFLAGS) -MM $< | sed -e 's@^\(.*\)\.o:@src/\1.d src/\1.o:@' > $@
ifneq ($(MAKECMDGOALS), clean)
-include $(DEPENDS)
endif