forked from hoytech/ephemerand
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (26 loc) · 873 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
W = -Wall
OPT = -O2 -g
STD = -std=c++17
CXXFLAGS = $(STD) $(OPT) $(W) -fPIC $(XCXXFLAGS)
INCS = -Iinclude -Iminiserial -Ihoytech-cpp
LDLIBS = -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -ldocopt -lb2
LDFLAGS = -flto $(XLDFLAGS)
SRCS = ephemerand.cpp util.cpp \
miniserial/serial.cpp hoytech-cpp/timer.cpp \
cmd_run.cpp cmd_reset.cpp
BIN = ephemerand
OBJS := $(SRCS:.cpp=.o)
DEPS := $(SRCS:.cpp=.d)
$(BIN): $(OBJS) $(DEPS)
$(CXX) $(OBJS) $(LDFLAGS) $(LDLIBS) -o $(BIN)
%.o : %.cpp %.d Makefile
$(CXX) $(CXXFLAGS) $(INCS) -MMD -MP -MT $@ -MF $*.d -c $< -o $@
-include *.d
%.d : ;
.PHONY: clean asan
clean:
rm -f $(BIN) *.o *.d miniserial/*.o miniserial/*.d hoytech-cpp/*.o hoytech-cpp/*.d
rm -rf build/
asan: XCXXFLAGS = -fsanitize=address
asan: XLDFLAGS = -fsanitize=address
asan: $(BIN)