-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
213 lines (198 loc) · 4.93 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
NAME = miniRT
CC = cc
FLAGS = -Wall -Werror -Wextra -g -MMD
LIB = -L $(addprefix lib/, mlx) -lmlx -lXext -lX11 -lm -L $(addprefix lib/, libft) -lft
HEADER = -I $(addprefix lib/, mlx) -I $(addprefix lib/, libft) -I includes -I src/parsing -I src/error -I src/window -I src/edit
OBJ = $(addsuffix .o, $(addprefix obj/, main \
$(addprefix parsing/, parsing \
$(addprefix check_, ambient \
camera \
coordinate \
cylinder \
float_construction \
light \
line_parsing \
plane \
texture \
rgb \
sphere) \
elem_structure \
fill_objs_system_1 \
open_and_store_content_rt \
fill_obj_systems \
setup_array_function \
split_on_function \
loop_check_coord_dir \
conversions \
convert_to_float \
convert_to_vect \
fill_structs \
fill_cylinder \
build_elems \
build_light \
fill_elems \
utils) \
$(addprefix error/, error \
fill_structs_utils \
free_objs) \
$(addprefix window/, loop_mlx \
render_window \
sphere \
plane \
cylinder \
specular \
resolve_equation \
cylinder_equation \
disc \
intersection \
raytracing_utils \
vector_operations_again \
vector_operations_bis \
solution_list \
raytracing \
vector_operations \
get_normal_vector \
equation \
$(addprefix color/, rgb \
rgb_utils \
get_pixel_color \
shadow_light \
check_light_shadow \
comput_rgb_from_angle \
intersec_self \
$(addsuffix _color, sp \
pl \
cy \
co))) \
$(addprefix edit/, edit_objs \
resize \
get_rotation_angle \
rotation \
edit_utils \
action_edit \
camera_edit \
cylinder_edit \
sphere_edit \
cones_edit \
light_edit \
plane_edit)))
BOBJ = $(addsuffix .o, $(addprefix obj_bonus/, main \
$(addprefix parsing/, parsing \
$(addprefix check_, ambient \
camera \
cones_bonus \
coordinate \
cylinder \
float_construction \
light \
line_parsing \
plane \
rgb \
texture \
sphere) \
elem_structure \
setup_array_function_bonus \
open_and_store_content_rt \
fill_obj_systems \
split_on_function \
loop_check_coord_dir \
conversions \
convert_to_float \
convert_to_vect \
fill_objs_system_bonus \
fill_structs_bonus \
fill_cones_bonus \
fill_cone_system_bonus \
fill_cylinder \
build_elems \
build_light \
build_cones_bonus \
fill_elems \
utils) \
$(addprefix error/, error \
fill_structs_utils \
free_objs_bonus) \
$(addprefix window/, loop_mlx \
render_window \
sphere \
plane \
cylinder \
specular \
cones_bonus \
resolve_equation_bonus \
get_quadra_cones_bonus \
cylinder_equation \
disc \
disc_cone_bonus \
intersection \
raytracing_utils \
vector_operations_again \
solution_list \
raytracing \
vector_operations \
vector_operations_bis \
get_normal_vector \
get_normal_vector_bonus \
equation \
$(addprefix color/, rgb \
rgb_utils \
get_pixel_color \
shadow_light \
check_light_shadow_bonus \
intersec_self_bonus \
comput_rgb_from_angle_bonus \
$(addsuffix _color, sp \
pl \
cy \
co))) \
$(addprefix edit/, edit_objs \
resize \
get_rotation_angle \
rotation \
edit_utils \
action_edit \
camera_edit \
cylinder_edit \
sphere_edit \
cones_edit \
light_edit \
plane_edit)))
OBJ_DIR = obj/
ifdef TEST
OBJ_DIR = obj_bonus/
OBJ = $(BOBJ)
NAME = miniRT_bonus
endif
D_LST = $(OBJ:.o=.d)
all : $(NAME)
bonus :
$(MAKE) TEST=1 all
$(NAME): $(OBJ)
make -s -C lib/mlx
make bonus -s -C lib/libft
$(CC) $(FLAGS) $(OBJ) $(LIB) -o $@
BOBO =
ifdef TEST
BOBO = -D BONUS=1
endif
$(OBJ_DIR)%.o : src/%.c | obj_rep
$(CC) $(FLAGS) $(BOBO) $(HEADER) -c $< -o $@
obj_rep:
@mkdir -p $(OBJ_DIR)
@mkdir -p $(OBJ_DIR)parsing/
@mkdir -p $(OBJ_DIR)error/
@mkdir -p $(OBJ_DIR)window/
@mkdir -p $(OBJ_DIR)edit/
@mkdir -p $(OBJ_DIR)window/color/
clean:
make clean -s -C lib/libft
make clean -s -C lib/mlx
fclean:
make fclean -s -C lib/libft
rm -f $(NAME)
rm -f miniRT_bonus
rm -rf obj/
rm -rf obj_bonus/
re: fclean all
.PHONY: all clean fclean re
-include $(D_LST)