-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
100 lines (79 loc) · 3.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
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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: acesar-l <acesar-l@student.42sp.org.br> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/01/24 19:07:14 by acesar-l #+# #+# #
# Updated: 2023/01/28 03:02:33 by acesar-l ### ########.fr #
# #
# **************************************************************************** #
NAME = cub3D
COMPILER = clang
CFLAGS = -Wall -Wextra -Werror
MLX_FLAGS = -lmlx -lXext -lX11
MATH_LIB = -lm
CLEANUP = rm -rf
LIBFT_PATH = ./libraries/Libft
LIBFT = ./libraries/Libft/libft.a
SRCS_PATH = ./sources
INCLUDES = -I ./includes
SRCS = $(SRCS_PATH)/main.c \
$(SRCS_PATH)/data_operations/clear.c \
$(SRCS_PATH)/data_operations/create.c \
$(SRCS_PATH)/data_operations/setup.c \
$(SRCS_PATH)/error/error_manager.c \
$(SRCS_PATH)/error/error_messages.c \
$(SRCS_PATH)/hooks/movements.c \
$(SRCS_PATH)/hooks/handle_key.c \
$(SRCS_PATH)/hooks/setup.c \
$(SRCS_PATH)/images/setup.c \
$(SRCS_PATH)/colors/colors.c \
$(SRCS_PATH)/map/get_content.c \
$(SRCS_PATH)/map/utils.c \
$(SRCS_PATH)/MiniLibx/setup.c \
$(SRCS_PATH)/render/cast_ray.c \
$(SRCS_PATH)/render/pixel_put.c \
$(SRCS_PATH)/render/raycasting.c \
$(SRCS_PATH)/render/distance_to_wall.c \
$(SRCS_PATH)/validate/file_validate.c \
$(SRCS_PATH)/validate/arguments_validation.c \
$(SRCS_PATH)/validate/color_validation.c \
$(SRCS_PATH)/validate/color_validation2.c \
$(SRCS_PATH)/validate/cubfile_validation.c \
$(SRCS_PATH)/validate/texture_validation.c \
$(SRCS_PATH)/validate/map_validation.c \
$(SRCS_PATH)/validate/map_validate_edges.c \
$(SRCS_PATH)/validate/utils.c
GREEN = \033[0;32m
RED = \033[0;31m
RESET = \033[0m
all: $(NAME)
$(NAME): $(LIBFT)
@$(COMPILER) $(INCLUDES) $(SRCS) $(CFLAGS) $(MLX_FLAGS) $(MATH_LIB) -o $(NAME) $(LIBFT)
@echo "$(NAME): $(GREEN)$(NAME) was generated$(RESET)"
${LIBFT}:
@make --no-print-directory bonus -C $(LIBFT_PATH)
clean:
@make --no-print-directory clean -C $(LIBFT_PATH)
fclean:
@$(CLEANUP) $(NAME)
@echo "$(NAME): $(RED)$(NAME) was deleted$(RESET)"
@make --no-print-directory fclean -C $(LIBFT_PATH)
re: fclean $(NAME)
run:
@./cub3D maps/map1.cub
run2:
@./cub3D maps/map2.cub
run3:
@./cub3D maps/map3.cub
val:
@valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --quiet --tool=memcheck --keep-debuginfo=yes ./cub3D maps/map1.cub
val2:
@valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --quiet --tool=memcheck --keep-debuginfo=yes ./cub3D maps/map2.cub
val3:
@valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --quiet --tool=memcheck --keep-debuginfo=yes ./cub3D maps/map3.cub
seg-clean:
@$(CLEANUP) vgcore*
.PHONY: all clean fclean re run run2 run3 val val2 val3 seg-clean