-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
75 lines (56 loc) · 1.19 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
CXX = g++
NAME = gomoku
UNAME_S := $(shell uname -s)
RM = rm -rf
MKDIR = mkdir -p
CXXFLAGS += -I./$(INC_PATH)
CXXFLAGS += -Wall -Wextra -W -std=c++14 -O3 -flto
ifeq ($(UNAME_S),Linux)
LDFLAGS = -pthread
endif
LDFLAGS += -O3 -flto
# LDFLAGS = -ldl -pthread
# LDFLAGS += -L./lib
# LDFLAGS += -Wl,--rpath=./lib
LDFLAGS_GRAPHIC = -lsfml-system -lsfml-window -lsfml-graphics -lsfml-audio
SRC_PATH = src
SRC = main.cpp \
Map.cpp \
Referee.cpp \
Menu.cpp \
AGame.cpp \
Game.cpp \
APlayer.cpp \
Player.cpp \
AI.cpp \
Node.cpp \
State.cpp
OBJ_PATH = obj
OBJ = $(SRC:%.cpp=$(OBJ_PATH)/%.o)
INC_PATH = inc
INC = Map.hh \
Referee.hh \
AGame.hh \
Game.hh \
Menu.hh \
APlayer.hh \
Player.hh \
AI.hh \
Node.hh \
State.hpp
DEP = $(patsubst %,$(INC_PATH)/%,$(INC))
$(OBJ_PATH)/%.o: $(SRC_PATH)/%.cpp $(DEP)
@$(MKDIR) $(OBJ_PATH)
$(CXX) $(CXXFLAGS) -c $< -o $@
##
## Compile
##
$(NAME): $(OBJ)
$(CXX) $(OBJ) $(LDFLAGS) $(LDFLAGS_GRAPHIC) -o $(NAME)
all: $(NAME)
clean:
$(RM) $(OBJ_PATH)
fclean: clean
$(RM) $(NAME)
re: fclean all
.PHONY: re fclean clean all