-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
80 lines (66 loc) · 2.46 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
CXX = g++
FLAGS = -g -Wno-deprecated -fPIC -m64 -fno-inline -Wno-write-strings
# ROOT
DEPS += $(shell root-config --cflags)
LIBS += $(shell root-config --glibs)
# local libs
LIBS += -L${EIC_SHELL_PREFIX}/lib
LIBS += -lIRT -ledm4eic
DEPS += -I${EIC_SHELL_PREFIX}/include
DEPS += -I${EIC_SHELL_PREFIX}/include/IRT
DEPS += -Isrc
# image libs
LIBS += -L/opt/local/lib
LIBS += -lDDCore -lDDRec
LIBS += -lpodio -lpodioRootIO -ledm4hep
LIBS += -lfmt -lspdlog
LIBS += -lG4global -lG4materials -lG4geometry -lG4persistency
DEPS += -I/opt/local/include
FLAGS += -DSPDLOG_FMT_EXTERNAL
#--------------------------------------------
BIN_TARGET = bin
SOURCES := $(wildcard src/*.cpp)
EXECUTABLES := $(addprefix $(BIN_TARGET)/, $(basename $(notdir $(SOURCES))))
EICRECON_DIR = ${DRICH_DEV}/EICrecon/src/services/geometry/richgeo
DEPS += -I$(EICRECON_DIR)
LIB_TARGET = lib
RICHGEO_LIB_NAME = RichGeo
RICHGEO_LIB = $(LIB_TARGET)/lib$(RICHGEO_LIB_NAME).so
RICHGEO_ROOT = $(EICRECON_DIR)
RICHGEO_SOURCES := $(wildcard $(RICHGEO_ROOT)/IrtGeo*.cc) $(RICHGEO_ROOT)/ReadoutGeo.cc
RICHGEO_HEADERS := $(wildcard $(RICHGEO_ROOT)/IrtGeo*.h) $(RICHGEO_ROOT)/ReadoutGeo.h $(RICHGEO_ROOT)/RichGeo.h
PIXEL_GAP_SOURCE = src/test_pixel_gap_cuts.cpp
PIXEL_GAP_EXECUTABLE = $(BIN_TARGET)/test_pixel_gap_cuts
SOURCES := $(filter-out $(PIXEL_GAP_SOURCE), $(SOURCES))
EXECUTABLES := $(filter-out $(PIXEL_GAP_EXECUTABLE), $(EXECUTABLES))
#--------------------------------------------
all: $(EXECUTABLES) $(RICHGEO_LIB) $(PIXEL_GAP_EXECUTABLE)
$(EXECUTABLES): $(BIN_TARGET)/%: src/%.cpp
mkdir -p $(BIN_TARGET)
@echo "----- build [email protected] -----"
$(CXX) -c $< -o [email protected] $(FLAGS) $(DEPS)
@echo "--- make executable $@"
$(CXX) -o $@ [email protected] $(LIBS)
$(RM) [email protected]
$(RICHGEO_LIB): $(RICHGEO_HEADERS) $(RICHGEO_SOURCES)
ifeq ($(IRT_ROOT_DICT_FOUND),1)
mkdir -p $(LIB_TARGET)
@echo "----- build $@ -----"
$(CXX) $(RICHGEO_SOURCES) -shared -o $@ $(FLAGS) $(DEPS) $(LIBS)
else
@echo "WARNING: skip building $@ since IRT ROOT dict not found"
endif
$(PIXEL_GAP_EXECUTABLE): $(PIXEL_GAP_SOURCE) $(RICHGEO_LIB)
ifeq ($(IRT_ROOT_DICT_FOUND),1)
mkdir -p $(BIN_TARGET)
@echo "----- build [email protected] -----"
$(CXX) -c $< -o [email protected] $(FLAGS) $(DEPS)
@echo "--- make executable $@"
$(CXX) -o $@ [email protected] $(LIBS) -L$(LIB_TARGET) -l$(RICHGEO_LIB_NAME)
$(RM) [email protected]
else
@echo "WARNING: skip building $@ since IRT ROOT dict not found"
endif
clean:
@echo "CLEAN ======================================================"
$(RM) $(EXECUTABLES) $(PIXEL_GAP_EXECUTABLE) $(RICHGEO_LIB)