forked from kevlu8/PZChessBot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
31 lines (23 loc) · 642 Bytes
/
Copy pathMakefile
File metadata and controls
31 lines (23 loc) · 642 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
EXE ?= pzchessbot
EVALFILE ?= nnue.bin
CXX := g++
CXXFLAGS := -std=c++17 -march=native -DNNUE_PATH=\"$(EVALFILE)\"
RELEASEFLAGS = -O3
DEBUGFLAGS = -g -fsanitize=address,undefined
SRCS := $(wildcard engine/*.cpp engine/nnue/*.cpp)
HDRS := $(wildcard engine/*.hpp engine/nnue/*.hpp)
OBJS := $(SRCS:.cpp=.o)
.PHONY: release debug clean
release: CXXFLAGS += $(RELEASEFLAGS)
release: $(EXE)
debug: CXXFLAGS += $(DEBUGFLAGS)
debug: $(EXE)
$(EXE): $(OBJS)
$(CXX) $(CXXFLAGS) -o $@ $^
@echo "Build complete. Run with './$(EXE)'"
%.o: %.cpp $(HDRS)
$(CXX) $(CXXFLAGS) -c $< -o $@
clean:
@echo "Cleaning up..."
rm -f $(EXE)
rm -f $(OBJS)