-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
88 lines (73 loc) · 2.36 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
# **************************************************************************** #
# #
# :::::::: #
# makefile :+: :+: #
# +:+ #
# By: bsomers <[email protected]> +#+ #
# +#+ #
# Created: 2022/09/22 14:52:38 by bsomers #+# #+# #
# Updated: 2022/12/14 17:16:49 by jaberkro ######## odam.nl #
# #
# **************************************************************************** #
NAME = miniRT
FLAGS = -Wall -Wextra -Werror -O3
INCLUDE = -I include -I ./MLX42/include/MLX42 -I ./libft
LIBFT_DIR = libft/
LIBFT = libft/libft.a
LIBMLX42 = libmlx42.a
SRC_DIR = src
BUILD_DIR = obj
SRC = main.c \
init.c \
threads.c \
error.c \
utils.c \
parser/parse.c \
parser/list_add.c \
parser/stod_atoi_map_elems.c \
parser/get_next_line.c \
parser/get_map.c \
parser/parsing_checks.c \
parser/malloc_checks.c \
tracer/antialias_color.c \
tracer/point_ray_get_color.c \
tracer/point_ray_utils.c \
tracer/put_color.c \
color/new_color.c \
color/color_math_basics.c \
point/new_point.c \
point/point_math_basics.c \
point/point_math_advanced.c \
hit/hit_cone.c \
hit/hit_cone_cap.c \
hit/hit_sphere.c \
hit/hit_anything.c \
hit/hit_plane.c \
hit/hit_cylinder_tube.c \
hit/hit_cylinder_cap.c \
hit/hit_utils.c
OBJ := $(addprefix $(BUILD_DIR)/, $(SRC:.c=.o))
SRC := $(addprefix $(SRC_DIR)/, $(SRC))
all: $(NAME)
$(NAME): $(LIBFT) $(OBJ) $(LIBMLX42)
$(CC) $^ $(FLAGS) $(INCLUDE) -lglfw3 -framework Cocoa -framework OpenGL -framework IOKit -L. -o $(NAME)
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.c
mkdir -p $(dir $@)
$(CC) -c $(INCLUDE) $(FLAGS) -o $@ $<
$(LIBFT):
@$(MAKE) bonus -C $(LIBFT_DIR)
@cp ./$(LIBFT) .
$(LIBMLX42):
@make -C ./MLX42
@cp ./MLX42/$(LIBMLX42) .
clean:
rm -rf $(BUILD_DIR)
@make clean -C $(LIBFT_DIR)
@make clean -C ./MLX42
fclean: clean
rm -f $(NAME)
rm -f libft.a
rm -f $(LIBMLX42)
@make fclean -C $(LIBFT_DIR)
re: fclean all
.PHONY: all clean fclean re