-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
131 lines (104 loc) · 4.1 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
os = $(shell uname -s)
INCFLAGS = -I$(ROOTSYS)/include -I$(FASTJETDIR)/include -I$(PYTHIA8DIR)/include -I$(PYTHIA8DIR)/include/Pythia8/ -I$(PYTHIA8DIR)/include/Pythia8Plugins/ -I$(STARPICOPATH)
INCFLAGS += -I$(JAPATH)/src
INCFLAGS += -I./src
ifeq ($(os),Linux)
CXXFLAGS = -O2 -fPIC -pipe -Wall -std=c++11
CXXFLAGS += -Wno-unused-variable
CXXFLAGS += -Wno-unused-but-set-variable
CXXFLAGS += -Wno-sign-compare
# # for gprof -- cannot combine with -g!
# CXXFLAGS += -pg
# # for valgrind, gdb
# CXXFLAGS += -g
else
CXXFLAGS = -O -fPIC -pipe -Wall -Wno-deprecated-writable-strings -Wno-unused-variable -Wno-unused-private-field -Wno-gnu-static-float-init
CXXFLAGS += -Wno-return-type-c-linkage
## for debugging:
# CXXFLAGS = -g -O0 -fPIC -pipe -Wall -Wno-deprecated-writable-strings -Wno-unused-variable -Wno-unused-private-field -Wno-gnu-static-float-init
endif
ifeq ($(os),Linux)
LDFLAGS =
# # for gprof -- cannot combine with -g!
# LDFLAGS += -pg
# # for valgrind, gdb
# LDFLAGS += -g
LDFLAGSS = --shared
else
LDFLAGS = -O -Xlinker -bind_at_load -flat_namespace
LDFLAGSS = -flat_namespace -undefined suppress
LDFLAGSSS = -bundle
endif
ifeq ($(os),Linux)
CXX = g++
else
CXX = clang
endif
# # uncomment for debug info in the library
# CXXFLAGS += -g
ROOTLIBS = $(shell root-config --libs)
LIBPATH = $(ROOTLIBS) -L$(FASTJETDIR)/lib -L$(PYTHIA8DIR)/lib -L$(STARPICOPATH)
LIBPATH += -L$(JAPATH)/lib -L$(FASTJETDIR)/lib -L$(PYTHIA8DIR)/lib -L$(STARPICOPATH)
LIBS = -lMyJetlib
LIBS += -lfastjet -lfastjettools -lpythia8 -lTStarJetPico -lRecursiveTools
LIBS += -lConstituentSubtractor
## fun with pythia :-/
## make is a horrible horrible tool. Do not touch these lines, any whitespace will make it break
dummy := "$(shell find $(PYTHIA8DIR)/lib/ -name liblhapdfdummy\*)"
ifneq ("",$(dummy))
LIBS += -llhapdfdummy
endif
# for cleanup
SDIR = src
ODIR = src/obj
BDIR = bin
###############################################################################
################### Remake when these headers are touched #####################
###############################################################################
#INCS = $(SDIR)/JetAnalyzer.hh $(SDIR)/AjParameters.hh
INCS = $(SDIR)/PpZgParameters.hh $(SDIR)/PpZgAnalysis.hh
###############################################################################
# standard rules
$(ODIR)/%.o : $(SDIR)/%.cxx $(INCS)
@echo
@echo COMPILING
$(CXX) $(CXXFLAGS) $(INCFLAGS) -c $< -o $@
$(BDIR)/% : $(ODIR)/%.o
@echo
@echo LINKING
$(CXX) $(LDFLAGS) $(LIBPATH) $^ $(LIBS) -o $@
###############################################################################
###############################################################################
############################# Main Targets ####################################
###############################################################################
all : $(BDIR)/RunPpZg \
$(BDIR)/MakeSmallerTrees
# doxy
$(SDIR)/dict.cxx : $(SDIR)/ktTrackEff.hh
cd $(SDIR); rootcint -f dict.cxx -c -I. ./ktTrackEff.hh
$(ODIR)/dict.o : $(SDIR)/dict.cxx
$(ODIR)/ktTrackEff.o : $(SDIR)/ktTrackEff.cxx $(SDIR)/ktTrackEff.hh
$(ODIR)/PpZgAnalysis.o : $(SDIR)/PpZgAnalysis.cxx $(INCS) $(SDIR)/PpZgAnalysis.hh
# bin
#$(BDIR)/RunPpZg : $(ODIR)/RunPpZg.o $(ODIR)/PpZgAnalysis.o lib/libMyJetlib.so
$(BDIR)/RunPpZg : $(ODIR)/RunPpZg.o $(ODIR)/PpZgAnalysis.o
$(BDIR)/MakeSmallerTrees : $(ODIR)/MakeSmallerTrees.o
###############################################################################
##################################### MISC ####################################
###############################################################################
doxy: html/index.html
html/index.html : $(INCS) src/* Doxyfile
# doxygen
@echo
@echo Updating documentation
( cat Doxyfile ; echo "QUIET=YES" ) | doxygen -
clean :
@echo
@echo CLEANING
rm -vf $(ODIR)/*.o
rm -rvf $(BDIR)/*dSYM
rm -rvf lib/*dSYM
rm -vf $(BDIR)/*
rm -vf lib/*
rm -vf $(SDIR)/dict.cxx $(SDIR)/dict.h
.PHONY : clean doxy