-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
81 lines (64 loc) · 2.68 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: jesuserr <jesuserr@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/05/19 13:35:34 by jesuserr #+# #+# #
# Updated: 2023/06/16 12:59:44 by jesuserr ### ########.fr #
# #
# **************************************************************************** #
LIBFT_DIR = libft/
LIBX_DIR = minilibx_macos/
NAME = fdf
NAME_BONUS = fdf_bonus
SRCS = errors.c graphics.c hooks.c hooks_mouse.c main.c map_utils.c moves.c \
projections.c rotations.c z_utils.c
OBJS = $(SRCS:.c=.o)
DEPS = $(SRCS:.c=.d)
INCLUDE = -I./ -I./minilibx_macos/ -I./libft/includes/
RM = rm -f
CFLAGS = -O3 -Wall -Wextra -Werror
NORM = ${SRCS} fdf.h controls.h
GREEN = "\033[0;92m"
RED = "\033[0;91m"
BLUE = "\033[0;94m"
NC = "\033[37m"
LIBX = -lmlx -framework OpenGL -framework Appkit -Lminilibx_macos/
all: makelibft makelibx $(NAME)
makelibft:
@make --no-print-directory -C $(LIBFT_DIR)
@echo ${GREEN}"Libft Compiled!\n"${NC};
makelibx:
@make --no-print-directory -C $(LIBX_DIR) 2> ERRORS
@rm ERRORS
@echo ${GREEN}"MiniLibx Compiled!\n"${NC};
%.o: %.c
$(CC) $(CFLAGS) -MMD $(INCLUDE) -c $< -o $@
$(NAME): $(OBJS) $(LIBFT_DIR)libft.a $(LIBX_DIR)libmlx.a
$(CC) $(CFLAGS) $(OBJS) $(LIBFT_DIR)libft.a $(LIBX) -o $@
@echo ${GREEN}"fdf Compiled!\n"${NC};
-include $(DEPS)
bonus: makelibft makelibx $(NAME_BONUS)
$(NAME_BONUS): $(OBJS) $(LIBFT_DIR)libft.a $(LIBX_DIR)libmlx.a
$(CC) $(CFLAGS) $(OBJS) $(LIBFT_DIR)libft.a $(LIBX) -o $@
@echo ${GREEN}"fdf_bonus Compiled!\n"${NC};
-include $(DEPS)
clean:
@make clean --no-print-directory -C $(LIBFT_DIR)
@make clean --no-print-directory -C $(LIBX_DIR)
$(RM) $(OBJS) $(DEPS)
fclean:
@make fclean --no-print-directory -C $(LIBFT_DIR)
@make clean --no-print-directory -C $(LIBX_DIR)
$(RM) $(OBJS) $(DEPS)
$(RM) $(NAME)
$(RM) $(NAME_BONUS)
norm:
@echo ${BLUE}"\nChecking Norminette..."${NC}
@if norminette $(NORM); then echo ${GREEN}"Norminette OK!\n"${NC}; \
else echo ${RED}"Norminette KO!\n"${NC}; \
fi
re: fclean all
.PHONY: all clean fclean re makelibft norm makelibx bonus