-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
128 lines (99 loc) · 3.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ldinaut <ldinaut@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/11/22 15:01:19 by ldinaut #+# #+# #
# Updated: 2022/12/13 18:04:57 by ldinaut ### ########.fr #
# #
# **************************************************************************** #
NAME = cub3D
BNAME = cub3D_bonus
SRCS_FILES = main.c \
init_var.c \
init_mlx.c \
check_config_file.c \
check_map.c \
check_instr.c \
check_texture.c \
launch_game.c \
raycasting.c \
hook.c \
moves.c \
moves_cam.c \
draw.c \
textures.c \
display.c \
free_functions.c \
error_exit_functions.c \
get_next_line.c \
get_next_line_utils.c \
utils_parsing.c
BSRCS_FILES = main_bonus.c \
init_mlx_bonus.c \
init_var_bonus.c \
check_config_file_bonus.c \
check_map_bonus.c \
check_instr_bonus.c \
check_texture_bonus.c \
launch_game_bonus.c \
init_player_bonus.c \
raycasting_bonus.c \
hook_bonus.c \
moves_bonus.c \
moves_cam_bonus.c \
draw_bonus.c \
textures_bonus.c \
minimap_bonus.c \
anim_bonus.c \
doors_bonus.c \
display_bonus.c \
error_exit_functions_bonus.c \
free_functions_bonus.c \
free_functions_mlx_bonus.c \
get_next_line_bonus.c \
get_next_line_utils_bonus.c \
utils_parsing_bonus.c \
INC_FILES = cubed.h get_next_line.h
BINC_FILES = cubed_bonus.h get_next_line.h
SRCS = $(addprefix srcs/, $(SRCS_FILES))
BSRCS = $(addprefix srcs_bonus/, $(BSRCS_FILES))
INCS = $(addprefix includes/, $(INC_FILES))
BINCS = $(addprefix includes/, $(BINC_FILES))
CC = clang
CFLAGS = -Wall -Wextra -Werror -I./includes -g3
INCLUDES = -I. -Iminilibx-linux/.
LIB = -Lminilibx-linux -lmlx -lXext -lX11 -Llibft -lft -lm
OBJS_FILES = $(SRCS_FILES:%.c=%.o)
BOBJS_FILES = $(BSRCS_FILES:%.c=%.o)
OBJS = $(addprefix objs/, $(OBJS_FILES))
BOBJS = $(addprefix bobjs/, $(BOBJS_FILES))
DEP = $(OBJS:%.o=%.d)
all : $(NAME)
bonus : $(BNAME)
$(NAME) : $(OBJS)
make -C libft
make -C minilibx-linux
$(CC) $(CFLAGS) $(INCLUDES) -o $(NAME) $(OBJS) $(LIB)
$(BNAME) : $(BOBJS) ./includes/cubed_bonus.h
make -C libft
make -C minilibx-linux
$(CC) $(CFLAGS) $(INCLUDES) -o $(BNAME) $(BOBJS) $(LIB)
clean :
make -C libft clean
make -C minilibx-linux clean
rm -rf $(OBJS) $(BOBJS) $(DEP)
rm -rf objs/ bobjs/
fclean : clean
rm -rf $(NAME)
rm -rf $(BNAME)
re : fclean all
objs/%.o : srcs/%.c $(INCS)
mkdir -p objs
$(CC) $(CFLAGS) -MMD -o $@ -c $<
bobjs/%.o : srcs_bonus/%.c $(BINCS)
mkdir -p bobjs
$(CC) $(CFLAGS) -MMD -o $@ -c $<
.PHONY: all clean fclean re