-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
125 lines (96 loc) · 2.22 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
NAME = gomoku
# Directories
ROOT = ./
INC_FOLDER = inc/
SRC_FOLDER = src/
OBJ_FOLDER = obj/
INCPATH = $(ROOT)$(INC_FOLDER)
LOCAL = $(ROOT)$(SRC_FOLDER)
MODDIR = ./modules/
##
#
# Modules
#
# To use a module, all you need to do is append its
# name to the MODULE_DIRS variable.
#
# The module will then automatically be included by
# its make_module.mk file.
#
# You can find a template for make_module.mk file
# contents at the root of this repository called
# .make_module.mk
#
##
MODULE_DIRS = Game \
Goban \
Graphic \
Player \
Referee
MODULES = $(addsuffix /make_module.mk, $(addprefix $(MODDIR), $(MODULE_DIRS)))
# Sources
SRC = $(LOCAL)BitMask.cpp \
$(LOCAL)main.cpp \
$(LOCAL)AState.cpp \
$(LOCAL)ComponentFactory.cpp \
$(LOCAL)GameAction.cpp \
$(LOCAL)GameSpecificFactory.cpp \
$(LOCAL)GameState.cpp \
$(LOCAL)RenderSystem.cpp \
$(LOCAL)ResourceManager.cpp \
$(LOCAL)TextSystem.cpp \
$(LOCAL)TransformSystem.cpp \
$(LOCAL)World.cpp \
$(LOCAL)GUIPauseState.cpp \
$(LOCAL)GUIEndState.cpp \
$(LOCAL)GUIState.cpp \
$(LOCAL)Calcul.cpp
include $(MODULES)
OBJ = $(SRC:.cpp=.o)
##
#
# Debug
#
# Set DEBUG to anything other than false in
# your environment before calling make to
# build the project in debug mode.
#
##
DEBUG ?= false
ifeq ($(DEBUG), true)
CXXFLAGS += -g3
else
CXXFLAGS += -DNDEBUG
CXXFLAGS += -O3
endif
# Binary tools
CXX = g++
CP = cp
RM = rm -f
MV = mv
PRINTF ?= /usr/bin/printf
# Flags
CXXFLAGS += -std=gnu++11 \
-Wall \
-L./lib/ -lGLEW -Wl,-rpath=./lib \
-lsfml-graphics -lsfml-window -lsfml-system -lsfml-audio \
$(addprefix -I, $(INCPATH))
# Rules
$(NAME) : $(OBJ)
@ $(PRINTF) "\nCompiled with $(CXX) and following flags:\t\033[34m$(CXXFLAGS)\033[m\n"
@ $(PRINTF) "Binary name is: \033[36m $@\033[m\n"
@ $(CXX) -o $@ $(OBJ) $(CXXFLAGS)
@ $(MV) $(OBJ) $(ROOT)$(OBJ_FOLDER)
all : $(NAME)
clean :
@ $(PRINTF) "\033[36mRemoved all object files.\033[m\n"
@ $(RM) $(OBJ_FOLDER)/*.o
fclean : clean
@ $(PRINTF) "\033[36mRemoved binaries.\033[m\n"
@ $(RM) $(NAME)
re : fclean all
%.o : %.cpp
@ $(CXX) $(CXXFLAGS) -o $@ -c $<
@ $(PRINTF) "\033[32m[OK]\033[m --> $< \n"
.PHONY : all clean fclean re
.SUFFIXES :