-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
35 lines (22 loc) · 845 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
CC = clang
CXX = clang++
CFLAGS := $(CFLAGS) -g -O3 -Wall -Wextra -pedantic -Werror -std=c18 -pthread -fsanitize=thread
CXXFLAGS := $(CXXFLAGS) -g -O3 -Wall -pedantic -Werror -std=c++20 -pthread -fsanitize=thread
BUILDDIR = build
SRCS = main.cpp engine.cpp io.cpp orderbook.cpp
all: engine client
engine: $(SRCS:%=$(BUILDDIR)/%.o)
$(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@
client: $(BUILDDIR)/client.cpp.o
$(LINK.cc) $^ $(LOADLIBES) $(LDLIBS) -o $@
.PHONY: clean
clean:
rm -rf $(BUILDDIR)
rm -f client engine
DEPFLAGS = -MT $@ -MMD -MP -MF $(BUILDDIR)/$<.d
COMPILE.cpp = $(CXX) $(DEPFLAGS) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
$(BUILDDIR)/%.cpp.o: %.cpp | $(BUILDDIR)
$(COMPILE.cpp) $(OUTPUT_OPTION) $<
$(BUILDDIR): ; @mkdir -p $@
DEPFILES := $(SRCS:%=$(BUILDDIR)/%.d) $(BUILDDIR)/client.cpp.d
-include $(DEPFILES)