-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
94 lines (72 loc) · 2.8 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: acesar-l <acesar-l@student.42sp.org.br> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/12/28 20:37:12 by acesar-l #+# #+# #
# Updated: 2022/07/14 19:14:16 by acesar-l ### ########.fr #
# #
# **************************************************************************** #
NAME = so_long
NAME_BONUS = so_long_bonus
GREEN = \033[0;32m
RED = \033[0;31m
RESET = \033[0m
LIBFT = ./libraries/Libft/libft.a
CC = clang
STANDARD_FLAGS = -Wall -Werror -Wextra
MINILIBX_FLAGS = -lmlx -lXext -lX11
VALGRIND = @valgrind --leak-check=full --show-leak-kinds=all \
--track-origins=yes --quiet --tool=memcheck --keep-debuginfo=yes
REMOVE = rm -f
SRCS_DIR = ./sources/
BONUS_SRCS_DIR = ./bonus_sources/
SRCS = $(addprefix $(SRCS_DIR),\
so_long.c \
ft_check_map.c \
ft_close_game.c \
ft_free_memory.c \
ft_handle_input.c \
ft_init_game.c \
ft_init_map.c \
ft_render_map.c \
ft_utils.c)
SRCS_BONUS = $(addprefix $(BONUS_SRCS_DIR),\
so_long_bonus.c \
ft_check_map_bonus.c \
ft_close_game_bonus.c \
ft_free_memory_bonus.c \
ft_handle_input_bonus.c \
ft_init_game_bonus.c \
ft_init_map_bonus.c \
ft_render_map_bonus.c \
ft_utils_bonus.c)
all: ${LIBFT} ${NAME}
${NAME}:
${CC} ${SRCS} ${LIBFT} ${STANDARD_FLAGS} ${MINILIBX_FLAGS} -o ${NAME}
@echo "$(NAME): $(GREEN)$(NAME) was compiled.$(RESET)"
@echo
bonus: ${LIBFT} ${NAME_BONUS}
${NAME_BONUS}:
${CC} ${SRCS_BONUS} ${LIBFT} ${STANDARD_FLAGS} ${MINILIBX_FLAGS} -o ${NAME_BONUS}
@echo "\n$(NAME): $(GREEN)$(NAME) was compiled with Bonus.$(RESET)"
@echo
${LIBFT}:
@echo
make bonus -C libraries/Libft
clean:
make clean -C libraries/Libft
@echo
fclean:
${REMOVE} ${NAME} ${NAME_BONUS}
@echo "${NAME}: ${RED}${NAME} and ${NAME_BONUS} were deleted${RESET}"
@echo
re: fclean all
rebonus: fclean ${NAME_BONUS}
run: ${NAME}
${VALGRIND} ./${NAME} assets/maps/valid/map4.ber
run_bonus: ${NAME_BONUS}
${VALGRIND} ./${NAME_BONUS} assets/maps/valid/bonus/map5.ber
.PHONY: all clean fclean re rebonus valgrind run run_bonus