-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
86 lines (68 loc) · 1.53 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
NAME = cub3d
CC = gcc
FLAGS = -Wall -Werror -Wextra #-g -fsanitize=address
INCL = -I ./includes/\
-I ./minilibx-linux/\
-I ./libft/
SRCDIR = ./srcs/
SRC = main.c\
parse.c\
debug.c\
checkers.c\
vector.c\
image.c\
raycast.c\
raycast_draw.c\
key_hooks.c\
movement.c\
movement_utils.c\
render.c\
depth_buffer.c\
door.c\
minimap.c\
setup.c\
checkers_utils.c\
textures.c\
textures_utils.c\
textures_utils_2.c
SRCS = $(addprefix $(SRCDIR), $(SRC))
OBJDIR = ./objects/
OBJ = $(SRC:.c=.o)
OBJS = $(addprefix $(OBJDIR), $(OBJ))
# Minilibx
MLX_PATH = mlx/
MLX_NAME = libmlx.a
MLX = $(MLX_PATH)$(MLX_NAME)
# Libft
LIBFT_PATH = libft/
LIBFT_NAME = libft.a
LIBFT = $(LIBFT_PATH)$(LIBFT_NAME)
# Colours
GREEN = \e[0;32m
YELLOW = \e[0;33m
CYAN = \e[0;36m
RESET = \e[0m
all : $(OBJDIR) $(MLX) $(LIBFT) $(NAME)
@printf "$(GREEN) | Cub3d executable created $(RESET)\n"
$(OBJDIR):
@mkdir -p $(OBJDIR)
$(OBJDIR)%.o: $(SRCDIR)%.c
@$(CC) $(FLAGS) -c $< -o $@ $(INCL)
$(NAME) : $(OBJS)
@$(CC) $(FLAGS) $(OBJS) -o $@ $(INCL) $(LIBFT) -lm -Lmlx -lmlx -lm -framework OpenGL -framework AppKit
@printf "$(YELLOW) | Compiling... $(RESET)\n"
$(LIBFT):
@make -sC $(LIBFT_PATH)
$(MLX):
@make -sC $(MLX_PATH)
clean :
@rm -rf $(OBJDIR)
@make -C $(LIBFT_PATH) clean
@make -C $(MLX_PATH) clean
@printf "$(CYAN) | Cleaned objects $(RESET)\n"
fclean : clean
@rm -f $(NAME)
@make -C $(LIBFT_PATH) fclean
@printf "$(CYAN) | Cleaned executable $(RESET)\n"
re : fclean all
.PHONY : all clean fclean re