-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
80 lines (64 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ayarmaya <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2024/01/18 17:27:18 by ayarmaya #+# #+# #
# Updated: 2024/02/27 03:36:51 by ayarmaya ### ########.fr #
# #
# **************************************************************************** #
NAME := so_long
NAME_B := so_long_bonus
CC := gcc
CFLAGS := -Wall -Wextra -Werror
RM := rm -f
LIBFT := libft/libft.a
MLX := mlx_linux/libmlx_Linux.a
MLX_FLAGS := -Lmlx_linux -lmlx_Linux -L/usr/lib -lXext -lX11 -lm -lz
HEADERS := -I./include -Ilibft/include -Imlx_linux
LIBS := $(LIBFT) $(MLX) $(MLX_FLAGS)
SRCS := src/ft_check_map.c \
src/ft_check_road.c \
src/ft_hook.c \
src/ft_init.c \
src/ft_load_map.c \
src/ft_main.c \
src/ft_moove.c \
src/ft_set_map.c \
src/ft_utils.c
SRCS_B := src/bonus/ft_check_map_bonus.c \
src/bonus/ft_check_road_bonus.c \
src/bonus/ft_hook_bonus.c \
src/bonus/ft_init_bonus.c \
src/bonus/ft_load_map_bonus.c \
src/bonus/ft_main_bonus.c \
src/bonus/ft_moove_bonus.c \
src/bonus/ft_set_map_bonus.c \
src/bonus/ft_set_map_2_bonus.c \
src/bonus/ft_set_water_bonus.c \
src/bonus/ft_utils_bonus.c
OBJS := $(SRCS:.c=.o)
OBJS_B := $(SRCS_B:.c=.o)
all: $(NAME)
bonus: $(NAME_B)
$(NAME): $(OBJS)
make -C libft
make -C mlx_linux
$(CC) $(OBJS) $(LIBS) -o $(NAME)
$(NAME_B): $(OBJS_B)
make -C libft
make -C mlx_linux
$(CC) $(OBJS_B) $(LIBS) -o $(NAME_B)
%.o: %.c
$(CC) $(CFLAGS) $(HEADERS) -c $< -o $@
clean:
$(RM) $(OBJS) $(OBJS_B)
make -C libft clean
make -C mlx_linux clean
fclean: clean
$(RM) $(NAME) $(NAME_B)
make -C libft fclean
re: fclean all
.PHONY: all bonus clean fclean re