-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
97 lines (84 loc) · 2.16 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
NAME := so_long
CC := gcc
CFLAGS := -Wall -Wextra -Werror -I includes/ -g
SRC := main.c \
$(addprefix utils/, \
ft_free_game.c \
ft_free_map.c \
ft_close_window.c \
ft_move_window.c) \
$(addprefix 42-gnl/, \
get_next_line.c \
get_next_line_utils.c) \
$(addprefix utils/map/, \
ft_put_walls.c \
ft_make_map.c \
ft_read_map.c \
ft_exit_map.c) \
$(addprefix utils/validations/, \
ft_check_args.c \
ft_map_format.c \
ft_valid_map.c \
ft_max_resolution.c \
ft_validate_map_str.c \
ft_error_handler.c) \
$(addprefix utils/sprites/, \
ft_img_init.c) \
$(addprefix utils/movements/, \
ft_key_input.c \
ft_move_player.c \
ft_collect_item.c)
BONUS_SRC := main_bonus.c \
$(addprefix utils_bonus/, \
ft_free_game_bonus.c \
ft_free_map_bonus.c \
ft_close_window_bonus.c \
ft_move_window_bonus.c) \
$(addprefix 42-gnl/, \
get_next_line.c \
get_next_line_utils.c) \
$(addprefix utils_bonus/map/, \
ft_put_walls_bonus.c \
ft_make_map_bonus.c \
ft_read_map_bonus.c \
ft_exit_map_bonus.c) \
$(addprefix utils_bonus/validations/, \
ft_check_args_bonus.c \
ft_map_format_bonus.c \
ft_valid_map_bonus.c \
ft_max_resolution_bonus.c \
ft_validate_map_str_bonus.c \
ft_error_handler_bonus.c) \
$(addprefix utils_bonus/sprites/, \
ft_img_init_bonus.c) \
$(addprefix utils_bonus/movements/, \
ft_key_input_bonus.c \
ft_move_player_bonus.c \
ft_collect_item_bonus.c \
ft_move_enemy_bonus.c) \
$(addprefix utils_bonus/animations/, \
ft_animate_player_bonus.c \
ft_animate_enemy_bonus.c \
ft_animations_bonus.c \
ft_delay_bonus.c)
OBJ := $(SRC:%.c=%.o)
BONUS_OBJ := $(BONUS_SRC:%.c=%.o)
LIB := -L ./minilibx-linux -lmlx -lXext -lX11 -L ./42-libft -lft
all: $(NAME)
$(NAME): $(OBJ)
$(MAKE) -C ./minilibx-linux
$(MAKE) -C ./42-libft
$(CC) $(CFLAGS) $(OBJ) $(LIB) -o $(NAME)
bonus: $(BONUS_OBJ)
$(MAKE) -C ./minilibx-linux
$(MAKE) -C ./42-libft
$(CC) $(CFLAGS) $(BONUS_OBJ) $(LIB) -o $(NAME)
clean:
$(MAKE) -C ./42-libft clean
rm -rf $(OBJ)
rm -rf $(BONUS_OBJ)
fclean: clean
$(MAKE) -C ./minilibx-linux clean
$(MAKE) -C ./42-libft fclean
rm -rf $(NAME)
re: fclean all