This repository has been archived by the owner on May 30, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
104 lines (89 loc) · 2.6 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: mgreil <mgreil@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2017/11/19 14:56:26 by mgreil #+# #+# #
# Updated: 2018/04/11 12:33:46 by mgreil ### ########.fr #
# #
# **************************************************************************** #
.PHONY: all $(NAME) clean fclean re proper
NAME = rt
CC = gcc
FLAGS = -Wall -Werror -Wextra
MLXFLAGS = -framework OpenGL -framework AppKit -lpthread
LIBFT = -lft -L$(LIBFT_PATH)
LIBMLX = -lmlx -L$(LIBMLX_PATH)
LIBXLM = -lxml2
SRC_NAME = main.c \
parse_file.c \
xmlget1.c \
xmlget2.c \
draw.c \
error.c \
inter_objs.c \
key_hook.c \
key_hook2.c \
key_hook3.c \
tools_mlx.c \
light.c \
light2.c \
shadows.c \
transformations.c \
get_normal.c \
perlin_materials.c \
perlin.c \
perlin_tools.c \
textures.c \
colors.c \
refraction.c \
reflection.c \
filter.c \
cel_shading.c \
cam.c \
cam_tool.c \
screenshot.c \
equation_second.c \
interface.c \
mouse_hook.c \
matrices.c \
bump_mapping.c \
stereoscopy.c \
save_scene.c \
xml_set.c
OBJ_NAME = $(SRC_NAME:.c=.o)
SRC_PATH = ./srcs/
INC_PATH = -I ./incs/ -I ./minilibx_macos/ -I ./libft/includes/ -I/usr/include/libxml2
OBJ_PATH = ./objs/
LIBFT_PATH = ./libft/
LIBMLX_PATH = ./minilibx_macos/
SRCS = $(addprefix $(SRC_PATH), $(SRC_NAME))
OBJS = $(addprefix $(OBJ_PATH),$(OBJ_NAME))
all : $(NAME)
$(NAME) : $(OBJS)
@make -C $(LIBFT_PATH)
@make -C $(LIBMLX_PATH)
@$(CC) $(FLAGS) $(MLXFLAGS) $(LIBFT) $(LIBMLX) $(LIBXLM) -o $(NAME) $(OBJS)
@echo "$(NAME) compiled ✓"
$(OBJ_PATH)%.o : $(SRC_PATH)%.c
@mkdir -p $(OBJ_PATH)
@$(CC) $(FLAGS) $(INC_PATH) -o $@ -c $<
@echo "$@ created ✓"
clean :
@make -C $(LIBFT_PATH) clean
@make -C $(LIBMLX_PATH) clean
@/bin/rm -rf $(OBJ_PATH)
@echo "Objects cleaned ✓"
fclean : clean
@make -C $(LIBFT_PATH) fclean
@make -C $(LIBMLX_PATH) fclean
@/bin/rm -f $(NAME)
@echo "$(NAME) deleted ✓"
re :
$(MAKE) fclean
$(MAKE) all
proper :
$(MAKE) all
$(MAKE) clean