-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
72 lines (59 loc) · 2.29 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: ocojeda- <ocojeda-@student.42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2017/03/26 19:16:02 by bbeldame #+# #+# #
# Updated: 2017/08/08 16:33:39 by ocojeda- ### ########.fr #
# #
# **************************************************************************** #
NAME = rtv1
FLAGS = -Wall -Wextra # @todo : Add -Werror Flag, Uncomment Minilibx clean -Ofast
MLX = ./minilibX/
MLX_LIB = $(addprefix $(MLX),mlx.a)
MLX_INC = -I ./miniLibX
LINKS = -L ./minilibX -lm -lmlx -framework OpenGL -framework AppKit
LIBFTA = libft.a
LIBFTDIR = ./libft
MLXA = ./miniLibX/libmlx.a
OBJDIR = ./objs/
INCDIR = ./includes
SRCDIR = ./srcs/
SRCS_NAME = color.c cone.c create_img.c main.c operation.c \
ray.c raytrace.c sphere.c vector.c hooks.c plane.c \
parsing/parse.c cylinder.c parsing/p_errors.c \
parsing/p_objects.c parsing/p_setup.c parsing/p_utils.c \
supersampler.c
OBJS = $(SRCS_NAME:.c=.o)
OBJS := $(notdir $(OBJS))
OBJS := $(addprefix $(OBJDIR), $(OBJS))
LIBFT = $(addprefix $(LIBFTDIR)/,$(LIBFTA))
VPATH = $(SRCDIR):$(SRCDIR)parsing
GREEN = \033[0;32m
RED = \033[0;31m
NC = \033[0m
SRCS = $(addprefix $(SRCDIR),$(SRCS_NAME))
all: $(NAME)
$(OBJDIR):
@mkdir -p $(OBJDIR)
$(OBJDIR)%.o:%.c
@gcc $(FLAGS) -I $(INCDIR) -I $(LIBFTDIR) -I $(MLX) -o $@ -c $<
$(LIBFT):
@make -C $(LIBFTDIR)
$(MLXA):
@make -sC $(MLX)
$(NAME): $(LIBFT) $(MLXA) $(OBJDIR) $(OBJS)
@gcc $(OBJS) $(LINKS) $(LIBFT) -lm -o $(NAME)
@echo "$(GREEN)----------RTv1 compiled-----------$(NC)"
clean:
@rm -rf $(OBJDIR)
@make clean -C $(LIBFTDIR)
# @make --silent clean -C $(MLX)
fclean: clean
@rm -f $(NAME)
# @make fclean -C $(LIBFTDIR)
@echo "$(GREEN)-----RTv1 removed completely------$(NC)"
re: fclean all
.PHONY: all clean fclean re