-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·92 lines (70 loc) · 2.4 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: edecoste <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/11/09 13:51:30 by edecoste #+# #+# #
# Updated: 2023/04/03 17:11:28 by edecoste ### ########.fr #
# #
# **************************************************************************** #
NAME = so_long
NAME_B = so_long_bonus
FLAGSE = -fsanitize=address
FLAGS = -Wextra -Werror -Wall -I -g3 #${FLAGSE}
MLXFLAGS = -Imlx_linux -lXext -lX11 -lm -lz
SRCS = so_long.c \
check.c \
check_solvability.c \
utils.c \
imgs.c \
maps_funct.c \
render.c \
move.c
SRCS_BONUS = so_long.c \
animation.c \
check.c \
check_solvability.c \
utils.c \
enemy_funct.c \
imgs.c \
maps_funct.c \
render.c \
move.c
DIR_MLX = mlx_linux/
MLX = $(addprefix $(DIR_MLX), libmlx.a)
DIR_LIBFT = Libft/
LIBFT = $(addprefix $(DIR_LIBFT), libft.a)
OBJS = ${SRCS:%.c=./build/%.o}
OBJS_BONUS = ${SRCS_BONUS:%.c=./build_bonus/%.o}
HEADER = includes/so_long.h
BONUS_HEADER = includes_bonus/so_long.h
all: ${NAME}
${NAME}: ${OBJS} ${LIBFT} ${MLX}
${CC} $^ ${FLAGS} ${MLXFLAGS} -o ${NAME}
./build/%.o: ./sources/%.c ${HEADER}
@mkdir -p build
${CC} ${FLAGS} -Imlx_linux -c $< -o $@
./build_bonus/%.o: ./sources_bonus/%.c ${BONUS_HEADER}
@mkdir -p build_bonus
${CC} ${FLAGS} -Imlx_linux -c $< -o $@
${MLX}: FORCE
make -s -C ${DIR_MLX}
${LIBFT}: FORCE
make -s -C ${DIR_LIBFT}
bonus: $(NAME_B)
$(NAME_B): ${OBJS_BONUS} ${LIBFT} ${MLX}
${CC} $^ ${FLAGS} ${MLXFLAGS} -o $(NAME_B)
clean:
${RM} -r ./build
${RM} -r ./build_bonus
fclean: clean
${RM} ${NAME}
${RM} so_long_bonus
make -s -C ${DIR_MLX} clean
make -s -C ${DIR_LIBFT} clean
re: fclean
${MAKE} all
FORCE:
.PHONY: all clean fclean re FORCE