-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
70 lines (52 loc) · 1.52 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
NAME = fractol
GCC = gcc
FLAGS = #-Wall -Werror -Wextra
LIBFT = $(LIBFT_DIRECTORY)libft.a
LIBFT_DIRECTORY = ./libft/
LIBFT_HEADERS = $(LIBFT_DIRECTORY)includes/
MINILIBX = $(MINILIBX_DIRECTORY)libmlx.a
MINILIBX_DIRECTORY = /usr/local/lib/
MINILIBX_HEADERS = /usr/local/include
HEADERS_LIST = \
fractol.h\
key_macos.h\
HEADERS_DIRECTORY = ./includes/
HEADERS = $(addprefix $(HEADERS_DIRECTORY), $(HEADERS_LIST))
SOURCES_DIRECTORY = ./sources/
SOURCES_LIST = \
color.c\
control_keyboard.c\
control_mouse.c\
draw.c\
fractal_burning_ship.c\
fractal_julia.c\
fractal_mandelbrot.c\
fractol.c\
utils.c\
SOURCES = $(addprefix $(SOURCES_DIRECTORY), $(SOURCES_LIST))
OBJECTS_DIRECTORY = objects/
OBJECTS_LIST = $(patsubst %.c, %.o, $(SOURCES_LIST))
OBJECTS = $(addprefix $(OBJECTS_DIRECTORY), $(OBJECTS_LIST))
LIBRARIES = -lmlx -lm -lft\
-L$(LIBFT_DIRECTORY) -L$(MINILIBX_DIRECTORY)\
-framework OpenGL -framework AppKit
INCLUDES = -I$(HEADERS_DIRECTORY) -I$(LIBFT_HEADERS) -I$(MINILIBX_HEADERS)
all: $(NAME)
$(NAME): $(LIBFT) $(OBJECTS_DIRECTORY) $(OBJECTS)
@$(GCC) $(FLAGS) $(LIBRARIES) $(INCLUDES) $(OBJECTS) -o $(NAME)
$(OBJECTS_DIRECTORY):
@mkdir -p $(OBJECTS_DIRECTORY)
$(OBJECTS_DIRECTORY)%.o : $(SOURCES_DIRECTORY)%.c $(HEADERS)
@$(GCC) $(FLAGS) -c $(INCLUDES) $< -o $@
$(LIBFT):
@$(MAKE) -sC $(LIBFT_DIRECTORY)
clean:
@$(MAKE) -sC $(LIBFT_DIRECTORY) clean
@rm -rf $(OBJECTS_DIRECTORY)
fclean: clean
@$(MAKE) -sC $(LIBFT_DIRECTORY) fclean
@rm -f $(NAME)
re:
@$(MAKE) fclean
@$(MAKE) all
.PHONY: all clean fclean re