-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
103 lines (84 loc) · 2.86 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
100
101
102
103
# **************************************************************************** #
# #
# :::::::: #
# Makefile :+: :+: #
# +:+ #
# By: maiadegraaf <[email protected]. +#+ #
# +#+ #
# Created: 2022/01/06 16:26:08 by maiadegraaf #+# #+# #
# Updated: 2022/01/06 16:26:12 by maiadegraaf ######## odam.nl #
# #
# **************************************************************************** #
NAME = so_long
SRCS = ./src/so_long.c \
./src/t_map_utils.c \
./src/generate_map.c \
./src/create_img.c \
./src/key_hook.c \
./src/tools_tools.c \
./src/my_mlx_pixel_put.c \
./src/t_bugs_utils.c \
./src/bugs.c \
./src/tarantula.c \
./src/loop.c \
./src/init_info.c \
./src/draw_info.c \
./src/img_utils.c \
./src/end_game.c \
./src/utils.c \
./src/find.c \
./src/check_err.c
BONUS_SRCS = ./bonus_src/bugs_bonus.c \
./bonus_src/check_err_bonus.c \
./bonus_src/create_img_bonus.c \
./bonus_src/draw_info_bonus.c \
./bonus_src/end_game_bonus.c \
./bonus_src/enemy_bonus.c \
./bonus_src/enemy_utils_bonus.c \
./bonus_src/find_bonus.c \
./bonus_src/generate_map_bonus.c \
./bonus_src/img_utils_bonus.c \
./bonus_src/init_info_bonus.c \
./bonus_src/initiate_enemy_bonus.c \
./bonus_src/key_hook_bonus.c \
./bonus_src/loop_bonus.c \
./bonus_src/my_mlx_pixel_put_bonus.c \
./bonus_src/so_long_bonus.c \
./bonus_src/t_bugs_utils_bonus.c \
./bonus_src/t_map_utils_bonus.c \
./bonus_src/tarantula_bonus.c \
./bonus_src/tools_tools_bonus.c \
./bonus_src/utils_bonus.c \
./bonus_src/utils_bonus_bonus.c
FLAGS = -Wall -Werror -Wextra -Imlx -g
LIBFT = libraries/libft/libft.a
MLX = libraries/mlx/libmlx.dylib
HEADER = includes/so_long.h
OBJS = $(SRCS:%.c=%.o)
BONUS_OBJS = $(BONUS_SRCS:%.c=%.o)
ifdef WITH_BONUS
ALL_OBJS = $(BONUS_OBJS)
else
ALL_OBJS = $(OBJS)
endif
all: $(LIBFT) $(MLX) $(NAME)
$(NAME): $(ALL_OBJS) $(LIBFT) $(MLX)
$(CC) -g $^ -o $(NAME)
bonus:
$(MAKE) WITH_BONUS=1
%.o: %.c $(HEADER)
$(CC) $(FLAGS) -c $< -o $@
$(LIBFT):
$(MAKE) -C libraries/libft
$(MLX):
$(MAKE) -C libraries/mlx && test -e libmlx.dylib || ln -sf libraries/mlx/libmlx.dylib libmlx.dylib
clean:
make fclean -C libraries/libft
make clean -C libraries/mlx
rm -f $(OBJS) $(BONUS_OBJS)
rm -f libmlx.dylib
fclean: clean
rm -f $(MLX)
rm -f $(LIBFT)
rm -f $(NAME)
re: fclean all