-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
63 lines (48 loc) · 2.4 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: aouhadou <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/09/23 10:28:09 by aouhadou #+# #+# #
# Updated: 2022/09/26 14:06:19 by aouhadou ### ########.fr #
# #
# **************************************************************************** #
HEADER = includes/minirt.h
NAME=miniRT
NAME_B=miniRT_bonus
M_SRCS= mandatory/main.c mandatory/get_next_line.c mandatory/allocation.c\
mandatory/tools.c mandatory/parse_element.c mandatory/parse.c\
mandatory/split.c mandatory/vector.c mandatory/normal_vector.c\
mandatory/vector2.c mandatory/ray_tracing.c mandatory/parse_objects.c\
mandatory/Garbage_Collector.c mandatory/intersection.c mandatory/mlx_func.c\
mandatory/camera.c mandatory/color.c mandatory/surface_normale.c\
mandatory/world.c mandatory/split_utils.c mandatory/shading.c
B_SRCS= bonus/main.c bonus/get_next_line.c bonus/allocation.c\
bonus/tools.c bonus/parse_element.c bonus/parse.c\
bonus/split.c bonus/vector.c bonus/normal_vector.c\
bonus/vector2.c bonus/ray_tracing.c bonus/parse_objects.c\
bonus/Garbage_Collector.c bonus/intersection.c bonus/mlx_func.c\
bonus/camera.c bonus/color.c bonus/surface_normale.c\
bonus/world.c bonus/split_utils.c bonus/cone_intersection.c\
bonus/specular.c bonus/shading.c
CFLAGS= -Wall -Wextra -Werror
CC= gcc
OBJS_M=$(M_SRCS:.c=.o)
OBJS_B=$(B_SRCS:.c=.o)
all: $(NAME)
bonus: $(NAME_B)
$(NAME):$(OBJS_M) $(HEADER)
@$(CC) -lmlx -framework OpenGL -framework AppKit $(CFLAGS) $(OBJS_M) -o $(NAME)
$(NAME_B):$(OBJS_B) $(HEADER)
@$(CC) -lmlx -framework OpenGL -framework AppKit $(CFLAGS) $(OBJS_B) -o $(NAME_B)
%.o:%.c
@$(CC) $(CFLAGS) -c $< -o $@
clean :
@rm -rf $(OBJS_M) $(OBJS_B)
fclean : clean
@rm -rf $(NAME) $(NAME_B)
re : fclean $(NAME) clean
re_b : fclean $(NAME_B) clean
.PHONY: all $(NAME) $(NAME_B) clean fclean re