-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
36 lines (25 loc) · 785 Bytes
/
Copy pathMakefile
File metadata and controls
36 lines (25 loc) · 785 Bytes
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
all: main clean-deps
CXX = clang++
override CXXFLAGS += -O3 -Wall -pedantic -pthread -std=c++20
SRCS = $(shell find . -name '.ccls-cache' -type d -prune -o -type f -name '*.cpp' -print | sed -e 's/ /\\ /g')
OBJS = $(SRCS:.cpp=.o) connect4/src-cc/connect4.so
DEPS = $(SRCS:.cpp=.d)
connect4/src-cc/connect4.so: c4_subsystem
c4_subsystem:
cd connect4/src-cc && $(MAKE) connect4.so
%.d: %.cpp
@set -e; rm -f "$@"; \
$(CXX) -MM $(CXXFLAGS) "$<" > "$@.$$$$"; \
sed 's,\([^:]*\)\.o[ :]*,\1.o \1.d : ,g' < "$@.$$$$" > "$@"; \
rm -f "$@.$$$$"
%.o: %.cpp
$(CXX) $(CXXFLAGS) -c "$<" -o "$@"
include $(DEPS)
main: $(OBJS)
$(CXX) $(CXXFLAGS) $(OBJS) -o "$@"
main-debug: $(OBJS)
$(CXX) $(CXXFLAGS) -O0 $(OBJS) -o "$@"
clean:
rm -f $(OBJS) $(DEPS) main
clean-deps:
rm -f $(DEPS)