-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
58 lines (49 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
47
48
49
50
51
52
53
54
55
56
57
58
# _____ __ ______
# / ___ \ / / /___ /
# / /__/ /___ ____ __/ /_______/ / ____ ____
# / _____/ __ \/ __ \/_ _/ __ / / / __ \/ __ \
# / / / ___/ / / / / /_/ /_/ / /____/ ___/ / / /
# /_/ \____/_/ /_/ /___/\__,_/______/\____/_/ /_/
#
# PentaZen, a Gomoku/Renju playing engine developed by Sun Yuliang.
#
# User settings
debug = no
target = pentazen
# Global settings
CXX = g++
CXXFLAGS = -Wall -Wextra -pedantic -static -std=c++17
BINDIR = .\bin
# Target
ifeq ($(target), pattern)
CPPS = line.cpp main.cpp
EXE = pattern.exe
SRCDIR = .\src\pattern
SRCS = $(addprefix $(SRCDIR)\, $(CPPS))
OBJS = $(addprefix $(SRCDIR)\, $(notdir $(SRCS:.cpp=.o)))
TARGET = $(addprefix $(BINDIR)\, $(EXE))
endif
ifeq ($(target), pentazen)
CPPS = board.cpp main.cpp misc.cpp movegen.cpp protocol.cpp search.cpp thread.cpp tt.cpp
EXE = pbrain-PentaZen.exe
SRCDIR = .\src
SRCS = $(addprefix $(SRCDIR)\, $(CPPS))
OBJS = $(addprefix $(SRCDIR)\, $(notdir $(SRCS:.cpp=.o)))
TARGET = $(addprefix $(BINDIR)\, $(EXE))
endif
# Compile flags
ifeq ($(debug), no)
CXXFLAGS += -DNDEBUG -O3 -fno-rtti -fno-exceptions
else
CXXFLAGS += -g
endif
%.o: %.cpp
$(CXX) $(CXXFLAGS) -o $@ -c $<
$(TARGET): $(OBJS)
$(CXX) $(CXXFLAGS) -o $(TARGET) $(OBJS)
@move $(SRCDIR)\*.o $(BINDIR)
all:
$(TARGET)
clean:
@del .\bin\*.exe .\bin\*.o .\src\*.o .\src\pattern\*.o
.PHONY: all clean