forked from leggat/tqZ2012Code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmakefile
74 lines (56 loc) · 2.42 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
LIBRARY_SOURCES = $(wildcard src/common/*.cpp)
LIBRARY_OBJECT_FILES = $(patsubst src/common/%.cpp,obj/%.o,${LIBRARY_SOURCES})
LIBRARY = lib/libTQZanalysisTools.so
EXECUTABLE_SOURCES = $(wildcard src/common/*.cxx)
EXECUTABLE_OBJECT_FILES = $(patsubst src/common/%.cxx,obj/%.o,${EXECUTABLE_SOURCES})
EXECUTABLES = $(patsubst src/common/%.cxx,bin/%.exe,${EXECUTABLE_SOURCES})
LIBRARY_PATH = -L$(shell root-config --libdir) \
-L/scratch/shared/lib \
-L/usr/lib64/boost148 \
-Llib \
LIBRARIES = $(shell root-config --libs) \
-lLHAPDF \
-lTMVA \
-lconfig++ \
-lz \
-lboost_system-mt \
-lboost_filesystem-mt \
INCLUDE_PATH = -Iinclude \
-isystem/scratch/shared/include \
-isystem/usr/include/boost148 \
-I/usr/include \
-isystem$(shell root-config --incdir) \
CFLAGS = -std=c++14 -march=native -mtune=native -g -O2 -pipe -Wall -Wextra \
-Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wformat=2 -Winit-self \
-Wlogical-op -Wmissing-include-dirs -Wnoexcept -Wold-style-cast \
-Woverloaded-virtual -Wredundant-decls -Wshadow \
-Wstrict-null-sentinel -Wuseless-cast -Wzero-as-null-pointer-constant \
-pedantic -MMD -MP -m64 -fPIC -pthread -fdiagnostics-color=auto \
${INCLUDE_PATH}
LINK_LIBRARY_FLAGS = -shared -g -O2 -rdynamic ${LIBRARY_PATH} ${LIBRARIES}
LINK_EXECUTABLE_FLAGS = -g -O2 -rdynamic ${LIBRARY_PATH} ${LIBRARIES} \
-lTQZanalysisTools \
-Wl,-R/scratch/shared/lib,-Rlib,--enable-new-dtags
.PHONY: all _all clean _cleanall build _buildall install _installall rpm _rpmall test _testall spec_update
default: build
clean: _cleanall
_cleanall:
rm -rf obj
rm -rf bin
rm -rf lib
all: _all
build: _all
buildall: _all
_all: ${LIBRARY} ${EXECUTABLES}
${LIBRARY}: ${LIBRARY_OBJECT_FILES}
g++ ${LINK_LIBRARY_FLAGS} ${LIBRARY_OBJECT_FILES} -o $@
${LIBRARY_OBJECT_FILES}: obj/%.o : src/common/%.cpp
mkdir -p {bin,obj,lib}
g++ -c ${CFLAGS} $< -o $@
-include $(LIBRARY_OBJECT_FILES:.o=.d)
${EXECUTABLES}: bin/%.exe: obj/%.o ${EXECUTABLE_OBJECT_FILES}
g++ ${LINK_EXECUTABLE_FLAGS} $(LHAP) $< -o $@
${EXECUTABLE_OBJECT_FILES}: obj/%.o : src/common/%.cxx
mkdir -p {bin,obj,lib}
g++ -c ${CFLAGS} $< -o $@
-include $(EXECUTABLE_OBJECT_FILES:.o=.d)