-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (42 loc) · 1.27 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
54
include conandeps.mk # so far only tomlplusplus is included
SRC_DIR=src
LIB_DIR=lib
BUILD_DIR=build
BIN_DIR=bin
# compiler setup
CXX = g++
ROOTFLAGS :=`root-config --cflags` -I$(CONAN_INCLUDE_DIRS)
ROOTLIBS :=`root-config --libs`
# objects definition
LIB_OBJS = $(LIB_DIR)/routines.o $(LIB_DIR)/libosclec.o $(LIB_DIR)/libfit.o $(LIB_DIR)/libanalis.o $(LIB_DIR)/libinfn.o
SRC_INCS = $(SRC_DIR)/routines.cpp
SRC = $(SRC_DIR)/pmta.cpp
TARGET = $(BIN_DIR)/pmta
# create parrent path of the rule
dir_guard=@mkdir -p $(@D)
install: $(TARGET)
$(TARGET): $(SRC) $(LIB_OBJS) $(SRC_INCS)
$(dir_guard)
$(CXX) $(ROOTFLAGS) -o $@ $(SRC) $(LIB_OBJS) $(ROOTLIBS)
# add debug flag for compiler
debug: ROOTFLAGS += -DDEBUG -g
debug: $(TARGET)
# some run command for testing or debugind
test: $(TARGET)
# pmta mess/3peDR_analysis.root -c mess/cfg.toml
pmta -c mess/cfgtest.toml -r
# pmta -c mess/test_dr.toml
# pmta -c mess/tw.toml -r
# make all lib objects defined under $(LIB_OBJS)
build_libs: $(LIB_OBJS)
# compile lib object
$(LIB_DIR)/%.o: $(SRC_DIR)/%.cpp $(SRC_DIR)/routines.h
$(dir_guard)
$(CXX) $(ROOTFLAGS) -c $< -o $@ $(ROOTLIBS)
conandeps.mk:
conan install .
rm *conanbuild* *conanrun*
clean:
rm -f -r $(BUILD_DIR) $(BIN_DIR) $(LIB_DIR) conandeps.mk
clean_libs:
rm -f -r $(LIB_DIR)