-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
53 lines (36 loc) · 1.16 KB
/
Makefile
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
ROOTCFLAGS = $(shell root-config --cflags)
ROOTLIBS = $(shell root-config --libs)
ROOTGLIBS = $(shell root-config --glibs)
INCLUDES = -I./include
CXX = g++
CXXFLAGS = -fPIC -fno-var-tracking -Wno-deprecated -D_GNU_SOURCE -O2 $(INCLUDES)
CXXFLAGS += $(ROOTCFLAGS)
LD = g++
LDFLAGS =
SOFLAGS = -O -shared -fPIC #-flat_namespace
LIBS = $(ROOTLIBS)
GLIBS = $(ROOTGLIBS) -lMinuit -lTreePlayer -lTMVA
SRCS = src/main.cc src/Analyzer_DisplacedMuon.cc
OBJS = $(patsubst %.C,%.o,$(SRCS:.cc=.o))
LIB=lib/main.so
.SUFFIXES: .cc,.C,.hh,.h
# Rules ====================================
all: $(LIB) RunAll
lib : $(LIB)
$(LIB): $(OBJS)
@echo "Creating library $(LIB)"
mkdir -p lib
$(LD) $(LDFLAGS) $(GLIBS) $(SOFLAGS) $(OBJS) -o $(LIB)
@echo "$(LIB) successfully compiled!"
RunAll : src/main.cc $(LIB)
mkdir -p bin
$(CXX) $(CXXFLAGS) -ldl $(LDFLAGS) -o $@ $^ $(GLIBS)
clean:
$(RM) $(OBJS)
$(RM) $(LIB)
$(RM) RunAll
purge:
$(RM) $(OBJS)
deps: $(SRCS)
makedepend $(INCLUDES) $^
# DO NOT DELETE THIS LINE -- make depend needs it