-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
85 lines (71 loc) · 3.22 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: tbeauman <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2016/03/07 11:45:04 by wwatkins #+# #+# #
# Updated: 2016/05/02 18:50:26 by tbeauman ### ########.fr #
# #
# **************************************************************************** #
SRC_PATH = ./src/
OBJ_PATH = ./obj/
LIB_PATH = ./lib/
INC_PATH = ./include/ $(LIB_PATH)libft/include/ $(LIB_PATH)libvec/include/ \
$(LIB_PATH)libftprintf/include/ $(LIB_PATH)mlx/
NAME = rt
CC = gcc
CFLGS = -Werror -Wextra -Wall
MLXFLGS = -framework OpenGL -framework AppKit
SRC_NAME = main.c parse_yml.c parse.c parse_camera.c parse_light.c \
parse_object.c parse_utils.c parse_material.c noise.c \
utils.c error.c init.c core.c image.c hook.c \
raytracing_color.c raytracing_intersect.c raytracing.c \
raytracing_recursion.c bmp_exporter.c yml_exporter.c yml_write.c \
filter.c antialiasing.c bmp_importer.c texture.c movement.c \
texture_generator.c normal_map.c mouse_hook.c intersect_cube.c \
intersect_hyperboloid.c intersect_paraboloid.c \
intersect_parallelogram.c intersect_torus.c intersect_triangle.c \
solve_quartic.c fresnel.c raytracing_shadow.c object_movement.c \
stereoscopy.c parse_obj.c intersect_bbox.c bbox_aux.c \
intersect_basics.c intersect_chewing_gum.c intersect_disc.c \
intersect_moebius.c intersect_quadric.c \
root_compute_utils.c intersect_csg.c solve_quadratic.c \
csg_helpers.c csg_helpers2.c create_object.c intersect_cube_troue.c \
parse_csg.c solve_cubic.c choose_roots.c yml_write_object.c \
quit.c g_object_type.c normal_basics.c intersect_selle.c \
math_utils.c default_object.c create_cube.c
OBJ_NAME = $(SRC_NAME:.c=.o)
LIB_NAME = libft libftprintf libvec mlx
SRC = $(addprefix $(SRC_PATH), $(SRC_NAME))
OBJ = $(addprefix $(OBJ_PATH), $(OBJ_NAME))
INC = $(addprefix -I,$(INC_PATH))
LIB = $(addprefix -L$(LIB_PATH),$(LIB_NAME))
.PHONY: re all clean fclean nolib norme
all: $(NAME)
$(NAME): $(OBJ)
make -C $(LIB_PATH)libft -j
make -C $(LIB_PATH)mlx -j
make -C $(LIB_PATH)libftprintf -j
make -C $(LIB_PATH)libvec -j
$(CC) $(CFLGS) $(LIB) -lft -lftprintf -lvec -lmlx $(INC) $(OBJ) $(MLXFLGS) -o $(NAME)
$(OBJ_PATH)%.o: $(SRC_PATH)%.c
@mkdir -p $(OBJ_PATH)
$(CC) $(CFLGS) $(INC) -o $@ -c $<
nolib: $(OBJ)
$(CC) $(CFLGS) -lft -lftprintf -lvec -lmlx $(INC) $(OBJ) $(MLXFLGS) -o $(NAME)
clean:
rm -fv $(OBJ)
rm -rf $(OBJ_PATH)
fclean: clean
make -C $(LIB_PATH)libft fclean
make -C $(LIB_PATH)libftprintf fclean
make -C $(LIB_PATH)libvec fclean
make -C $(LIB_PATH)mlx clean
rm -fv $(NAME)
re: fclean all
norme:
make -C $(LIB_PATH) norme
make -C $(VEC_PATH) norme
norminette $(SRC) ./include/