-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
80 lines (63 loc) · 1.71 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
vpath
TARGET = rtv1
#Sources
SRC_NAME = main.c set_object.c print_tp3d.c calc_tp3d.c calc_tp3d_annexe.c \
ray.c color.c parse.c set_env.c calc.c event.c tools.c set_tp3d.c set.c \
calc_normal.c vecteur.c set_annexe.c blink.c reset.c light.c rotate.c \
manage.c
SRC_PATH = ./srcs/
SRCS = $(addprefix $(SRC_PATH),$(SRC_NAME))
###############
#Objects
OBJ_PATH = ./objs/
OBJ = $(addprefix $(OBJ_PATH),$(SRC_NAME:.c=.o))
LIBFT_PATH = ./Libft/
LIBMLX_PATH = ./minilibx/
##############
#Includes
INC_RT = -I./includes/
INC_LIBFT = -I./Libft/includes/
INC_LIBMLX = -I./minilibx/
##############
#Librarys
LIBFT = -L./Libft/ -lft
LIBFT_NAME = ./Libft/libft.a
LIBMLX = -L./minilibx/ -lmlx
#############
#Frameworks
APPKIT = -framework Appkit
OPENGL = -framework Opengl
############
#Flags
CFLAGS = -Wall -Wextra -Werror
CC = gcc
#############
all: $(TARGET)
.PHONY: all clean fclean re
$(TARGET): $(OBJ)
@echo "\x1b[32m\n######## 1/3 libft ########\x1b[0m"
@make -C $(LIBFT_PATH)
@echo "\x1b[32m\n########################\x1b[0m"
@echo "\x1b[32m\n######## 2/3 libmlx ########\x1b[0m"
@make -C $(LIBMLX_PATH)
@echo "\x1b[32m\n########################\x1b[0m"
@echo "\x1b[32m\n######## 3/3 Rt_v1 ########\x1b[0m"
$(CC) $(CFLAGS) $(OBJ) $(LIBFT) $(LIBMLX) $(APPKIT) $(OPENGL) -o $(TARGET)
@echo "\x1b[32m\n########################\x1b[0m"
$(addprefix $(OBJ_PATH),%.o) : $(addprefix $(SRC_PATH),%.c)
@mkdir -p $(OBJ_PATH) 2> /dev/null
@$(CC) $(CFLAGS) -c $< $(INC_RT) $(INC_LIBFT) $(INC_LIBMLX) -o $@
clean:
@make clean -C Libft
@make clean -C minilibx
@rm -rf $(OBJ_PATH)
fclean: clean
@make fclean -C Libft
@rm -rf $(TARGET)
re: fclean all
r:
@rm -rf $(OBJ_PATH)
@rm -rf $(TARGET)
@make
norme:
@norminette $(SRC_PATH) $(INC_PATH)