-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
99 lines (80 loc) · 2.69 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: younhwan <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/07/08 16:03:07 by younhwan #+# #+# #
# Updated: 2022/08/18 17:10:51 by younhwan ### ########.fr #
# #
# **************************************************************************** #
NAME = so_long
CC = cc
CFLAGS = -Wall -Wextra -Werror
AR = ar rcs
RM = rm -f
INCS_DIR = ./includes
FT_PRINTF_DIR = ./libs/ft_printf
GNL_DIR = ./libs/get_next_line
LIBS = ./libs/ft_printf/libftprintf.a\
./libs/get_next_line/libgnl.a
LIB_MLX = libmlx.dylib
MLX_DIR = ./mlx
MLX_FLAS = -lmlx -framework OpenGL -framework AppKit
SRCS_DIR = ./srcs
OBJS_DIR = ./objs
SRCS = main_bonus.c\
game/draw_images_bonus.c\
game/end_game_bonus.c\
game/init_game_bonus.c\
game/key_pressed_bonus.c\
game/move_to_bonus.c\
game/render_game_bonus.c\
game/reset_bonus.c\
img/init_imgs_bonus.c\
img/init_collect_imgs_bonus.c\
img/init_exit_imgs_bonus.c\
img/init_ghost_imgs_bonus.c\
img/init_player_imgs_bonus.c\
img/init_player_down_imgs_bonus.c\
img/init_player_left_imgs_bonus.c\
img/init_player_right_imgs_bonus.c\
img/init_player_up_imgs_bonus.c\
map/init_map_bonus.c\
map/read_map_file_bonus.c\
map/validate_file_name_bonus.c\
map/validate_map_bonus.c\
player/init_player_bonus.c
SRCS := ${addprefix ${SRCS_DIR}/, ${SRCS}}
OBJS = ${SRCS:${SRCS_DIR}/%.c=${OBJS_DIR}/%.o}
all: ${NAME}
bonus:
make all
${OBJS_DIR}:
mkdir -p objs
mkdir -p objs/game
mkdir -p objs/img
mkdir -p objs/map
mkdir -p objs/player
${OBJS}: %.o: ${addsuffix .c,${subst obj,src,${%}}} | ${OBJS_DIR}
${CC} ${CFLAGS} -g -c ${patsubst %.o,%.c,${subst obj,src,$@}} -o $@ -I ${INCS_DIR}
${NAME}: ${OBJS}
make -C ${FT_PRINTF_DIR}
make -C ${GNL_DIR}
make -C ${MLX_DIR}
${CC} -g -o ${NAME} ${OBJS} ${LIBS} -I ${INCS_DIR} -L ${MLX_DIR} ${MLX_FLAS}
cp ${MLX_DIR}/${LIB_MLX} .
clean:
make -C ${FT_PRINTF_DIR} clean
make -C ${GNL_DIR} clean
make -C ${MLX_DIR} clean
rm -rf ${OBJS_DIR}
fclean: clean
make -C ${FT_PRINTF_DIR} fclean
make -C ${GNL_DIR} fclean
${RM} ${NAME} ${LIB_MLX}
re:
make fclean
make all
.PHONY: all clean fclean re bonus