-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
82 lines (52 loc) · 2.35 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
#******************************************************************************#
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ftaffore <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2013/11/20 15:15:50 by ftaffore #+# #+# #
# Updated: 2015/01/18 16:24:19 by chery ### ########.fr #
# #
#******************************************************************************#
CC = g++
RM = rm -rf
CFLAGS = -Werror -Wall -Wextra
CFLAGS_LIB = -dynamiclib
NAME = Nibbler
NAME_NCURSE = libncurses.dylib
NAME_SDL = libsdl.dylib
INCLUDES = -I includes
INCLUDES_NCURSES = -I includes
INCLUDES_SDL = -I includes \
-I $(HOME)/Library/Frameworks/SDL2.framework/Headers \
-I $(HOME)/Library/Frameworks/SDL2_image.framework/Headers \
-I $(HOME)/Library/Frameworks/SDL2_ttf.framework/Headers
LIBS =
LIBS_NCURSE = -lncurses
LIBS_SDL = $(HOME)/Library/Frameworks/SDL2.framework/SDL2 \
$(HOME)/Library/Frameworks/SDL2_image.framework/SDL2_image \
$(HOME)/Library/Frameworks/SDL2_ttf.framework/SDL2_ttf \
-framework GLUT -framework OpenGL -framework Cocoa
SRCS = srcs/main.cpp \
srcs/Nibbler.cpp \
srcs/Game.cpp \
srcs/Snake.cpp
SRCS_NCURSE = srcs/LibraryNcurses.cpp
SRCS_SDL = srcs/LibrarySdl.cpp
OBJS = $(SRCS:.cpp=.o)
all : $(NAME) $(NAME_NCURSE) $(NAME_SDL)
$(NAME) : $(OBJS)
$(CC) -o $@ $(CFLAGS) $(OBJS) $(LIBS) $(INCLUDES)
$(NAME_NCURSE) : $(SRCS_NCURSE)
$(CC) -o $@ $(CFLAGS_LIB) $(SRCS_NCURSE) $(LIBS_NCURSE) $(INCLUDES_NCURSES)
$(NAME_SDL) : $(SRCS_SDL)
$(CC) -o $@ $(CFLAGS_LIB) $(SRCS_SDL) $(INCLUDES_SDL) $(LIBS_SDL)
.cpp.o :
$(CC) -o $@ $(CFLAGS) $(INCLUDES) -c $<
clean :
$(RM) $(OBJS)
fclean : clean
$(RM) $(NAME) $(NAME_NCURSE) $(NAME_SDL)
re : fclean all
.PHONY : all clean fclean re