-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (31 loc) · 1.12 KB
/
Makefile
File metadata and controls
46 lines (31 loc) · 1.12 KB
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
CXX = clang++
INCLUDES = -I ../cpp_fixed
# CXXFLAGS = -std=c++20 -Wall -O0 -fsanitize=address -fno-omit-frame-pointer -pedantic-errors -g ${INCLUDES}
# CXXFLAGS = -std=c++20 -Wall -pedantic-errors -g ${INCLUDES}
CXXFLAGS = -std=c++20 -O3 -Wall -pedantic-errors -g -fno-permissive ${INCLUDES}
# CXXFLAGS = -std=c++20 -O3 -fprofile-generate -Wall -pedantic-errors -g ${INCLUDES}
# CXXFLAGS = -std=c++20 -O3 -fprofile-use=default.profdata -Wall -pedantic-errors -g ${INCLUDES}
TEST_SRCS = ${wildcard *_test.cpp}
TEST_OBJS = $(addprefix bin/, $(TEST_SRCS:.cpp=.o))
TEST_MAINS = $(addprefix bin/, $(TEST_SRCS:.cpp=))
HEADERS = ${wildcard *.h}
SRCS = orderbook.cpp exchange.cpp
OBJS = $(addprefix bin/, $(SRCS:.cpp=.o))
LIB = bin/orderbook.a
.PRECIOUS: bin/%.o
all: $(TEST_MAINS) ${LIB}
@echo compile finished
test: ${TEST_MAINS}
run_tests: ${TEST_MAINS}
for main in $^ ; do \
$$main; \
done
${LIB}: ${OBJS}
ar r ${LIB} ${OBJS}
bin/%_test: bin/%_test.o ${LIB}
${CXX} ${LDFLAGS} ${CXXFLAGS} $@.o ${LIB} -o $@
bin/%.o: %.cpp ${HEADERS}
@ mkdir -p bin
${CXX} ${CXXFLAGS} -c $(notdir $(basename $@).cpp) -o $@
clean:
rm -rf bin *~.