-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (56 loc) · 1.52 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
NAME = cub3D
SRCS_DIR = srcs
OBJS_DIR = .objs
LIBFT_DIR = libft
LIBFT = $(LIBFT_DIR)/libft.a
MLX_DIR = minilibx-linux
MLX = $(MLX_DIR)/libmlx.a
SRCS = $(SRCS_DIR)/main.c \
$(SRCS_DIR)/get_next_line.c \
$(SRCS_DIR)/geometry_line.c \
$(SRCS_DIR)/geometry_rect.c \
$(SRCS_DIR)/input_check_args.c \
$(SRCS_DIR)/input_read_n_validate.c \
$(SRCS_DIR)/input_parse_identif.c \
$(SRCS_DIR)/input_parse_map.c \
$(SRCS_DIR)/vars_create_1.c \
$(SRCS_DIR)/vars_create_2.c \
$(SRCS_DIR)/game.c \
$(SRCS_DIR)/key_update.c \
$(SRCS_DIR)/raycast.c \
$(SRCS_DIR)/raycast_intercept.c \
$(SRCS_DIR)/render_2d.c \
$(SRCS_DIR)/render_3d.c \
$(SRCS_DIR)/sprite.c \
$(SRCS_DIR)/auxiliar_funct.c \
$(SRCS_DIR)/free_info.c \
$(SRCS_DIR)/error.c \
$(SRCS_DIR)/save_bmp_file.c
OBJS = $(patsubst $(SRCS_DIR)%.c, $(OBJS_DIR)%.o, $(SRCS))
CC = clang
HEAD = -I./include -I./$(LIBFT_DIR) -I./$(MLX_DIR)
CFLAGS = -Wall -Werror -Wextra -g -fsanitize=address
LFLAGS = -lbsd -lm -lX11 -lXext \
-L ./$(LIBFT_DIR) -lft \
-L ./$(MLX_DIR) -lmlx
RM = /bin/rm -rf
all: $(NAME)
$(NAME): $(OBJS) $(LIBFT) $(MLX)
$(CC) $(OBJS) $(HEAD) $(CFLAGS) $(LFLAGS) -o $@
$(OBJS_DIR)/%.o: $(SRCS_DIR)/%.c
mkdir -p $(OBJS_DIR)
$(CC) $(CFLAGS) $(HEAD) -c $< -o $@
$(LIBFT):
make -C $(LIBFT_DIR)
$(MLX):
make -C $(MLX_DIR)
clean:
make clean -C $(LIBFT_DIR)
make clean -C $(MLX_DIR)
$(RM) $(OBJS_DIR)
fclean: clean
make fclean -C $(LIBFT_DIR)
$(RM) $(NAME)
$(RM) *.bmp
re: fclean all
.PONY: all clean fclean re