-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
44 lines (31 loc) · 821 Bytes
/
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
EXE = CAENdaq
WHICHMAKE = $(shell which make)
INSTALLOC = $(WHICHMAKE:/make=)
SRC_DIR = src
OBJ_DIR = include
SRC = $(wildcard $(SRC_DIR)/*.cc)
OBJ = $(SRC:$(SRC_DIR)/%.c=$(OBJ_DIR)/%.o)
ROOTCFLAGS := ""
ROOTLIBS := ""
ifneq (, $(shell which root-config))
ROOTCFLAGS := $(shell root-config --cflags) -Wl,--no-as-needed
ROOTLIBS := $(shell root-config --glibs) -lTreePlayer
endif
CPPFLAGS += -Iinclude
CPPFLAGS += -Wall -O2 $(ROOTCFLAGS)
CPPFLAGS += -lCAENDigitizer
CPPFLAGS += -DLINUX
CPPFLAGS += -DNOTIFY
CFLAGS += -Wall
LDFLAGS += -Llib
LDLIBS += -lm
LDLIBS += $(ROOTLIBS)
.PHONY: all clean
all: $(EXE)
$(EXE): $(OBJ)
$(CXX) $(LDFLAGS) $^ $(LDLIBS) -o $@ $(CPPFLAGS)
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.c
$(CXX) $(CPPFLAGS) $(CFLAGS) -c $< -o $@
.PHONY: install
install:
@cp $(EXE) $(INSTALLOC)