-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (35 loc) · 1.4 KB
/
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
39
40
41
42
43
44
45
46
CXX = g++
CXXFLAGS = -Wall -std=c++17 -Iprophet-nnue/nnue/include -Ofast -march=native -mtune=native -pthread
RUSTFLAGS = -C target-cpu=native
LDLIBS = -lboost_thread -lboost_fiber -ldl -lbz2
HEADERS = $(shell find . -name "*.h" -o -name "*.hpp")
OBJDIR = obj
OBJS = $(OBJDIR)/main.o $(OBJDIR)/util.o $(OBJDIR)/evaluation.o $(OBJDIR)/search.o $(OBJDIR)/nnue.o
TARGET = orca
PREFIX = /usr/local
$(TARGET): $(OBJS) prophet-nnue/target/release/libprophet.a
$(CXX) $^ $(CXXFLAGS) $(LDLIBS) -o $@
$(OBJDIR)/main.o: main.cpp $(HEADERS)
mkdir -p $(OBJDIR)
$(CXX) -c $< $(CXXFLAGS) "-DORCA_TIMESTAMP=\"$(shell date -u)\"" "-DORCA_COMPILER=\"$(CXX) $(shell $(CXX) -dumpversion)\"" -o $@
prophet-nnue/target/release/libprophet.a: prophet-nnue/nnue/Cargo.toml $(shell find prophet-nnue/nnue/src -name "*.rs") prophet-nnue/nnue/nnue.npz
cd prophet-nnue/nnue && RUSTFLAGS="$(RUSTFLAGS)" cargo build --release
$(OBJDIR)/util.o: util.cpp $(HEADERS)
mkdir -p $(OBJDIR)
$(CXX) -c $< $(CXXFLAGS) -o $@
$(OBJDIR)/evaluation.o: evaluation.cpp $(HEADERS)
mkdir -p $(OBJDIR)
$(CXX) -c $< $(CXXFLAGS) -o $@
$(OBJDIR)/search.o: search.cpp $(HEADERS)
mkdir -p $(OBJDIR)
$(CXX) -c $< $(CXXFLAGS) -o $@
$(OBJDIR)/nnue.o: nnue.cpp $(HEADERS)
mkdir -p $(OBJDIR)
$(CXX) -c $< $(CXXFLAGS) -o $@
.PHONY: clean install age
clean:
rm -rf $(TARGET) $(TARGET)_old $(OBJDIR)
install:
cp $(TARGET) $(PREFIX)/bin/
age:
mv $(TARGET) $(TARGET)_old