forked from eic/drich-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
53 lines (41 loc) · 1.43 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
CXX = g++
FLAGS = -g -Wno-deprecated -fPIC -m64 -fno-inline -Wno-write-strings
# ROOT
DEPS += $(shell root-config --cflags)
LIBS += $(shell root-config --glibs)
# PODIO
LIBS += -L/usr/local/lib -lDD4pod -lpodio -lpodioRootIO -ledm4hep
#--------------------------------------------
INSTALL_PREFIX = bin
SRC_MAIN := $(basename $(notdir $(wildcard src/*.cpp)))
SRC_EXAMPLES := $(basename $(notdir $(wildcard src/examples/*.cpp)))
#--------------------------------------------
all:
@echo ""
@echo "BUILDING SOURCES ==========================================="
@echo "$(SRC_MAIN)"
@echo "============================================================"
make main
@echo ""
@echo "BUILDING EXAMPLES =========================================="
@echo "$(SRC_EXAMPLES)"
@echo "============================================================"
make examples
main: $(SRC_MAIN)
examples: $(SRC_EXAMPLES)
clean:
@echo "CLEAN ======================================================"
$(RM) $(addprefix $(INSTALL_PREFIX)/, $(SRC_MAIN))
$(RM) $(addprefix $(INSTALL_PREFIX)/, $(SRC_EXAMPLES))
#--------------------------------------------
%: %.o
@echo "--- make executable $(INSTALL_PREFIX)/$@"
$(CXX) -o $(INSTALL_PREFIX)/$@ $< $(LIBS)
%.o: src/%.cpp
mkdir -p $(INSTALL_PREFIX)
@echo "----- build $@ -----"
$(CXX) -c $^ -o $@ $(FLAGS) $(DEPS)
%.o: src/examples/%.cpp
mkdir -p $(INSTALL_PREFIX)
@echo "----- build $@ -----"
$(CXX) -c $^ -o $@ $(FLAGS) $(DEPS)