-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
94 lines (75 loc) · 2.13 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: thakala <thakala@student.hive.fi> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/09/29 10:44:14 by thakala #+# #+# #
# Updated: 2022/10/01 13:48:40 by thakala ### ########.fr #
# #
# **************************************************************************** #
NAME = fractol
FILES = \
fractol \
usage \
loop \
draw \
image \
init \
init_help \
fractals \
fractal_julia \
fractal_mandelbrot \
fractal_burning_ship \
scale \
palette \
color_graphs \
pixelput \
exit \
abs_ldbl \
hooks \
mouse \
mousemove \
manipulate \
keyboard \
rotators
SRCS_DIR = srcs
SRCS = $(addprefix $(SRCS_DIR)/, $(addsuffix .c, $(FILES)))
OBJS_DIR = objs
OBJS = $(addprefix $(OBJS_DIR)/, $(addsuffix .o, $(FILES)))
DIRS = $(SRCS_DIR) $(OBJS_DIR)
INCS = -I includes/ -I libft/
HDRS = libft/libft.h includes/fractol.h
CC = gcc
CFLAGS = -Wall -Wextra -Werror
CFLAGS += -g
MATH = -lm
MLX = -lmlx -framework OpenGL -framework AppKit
.PHONY: all
all: $(NAME)
$(NAME): .prerequisites libft/libft.a $(OBJS) Makefile
touch .prerequisites
$(CC) $(CFLAGS) $(INCS) $(MATH) $(MLX) libft/libft.a $(OBJS) -o $@
$(OBJS): $(OBJS_DIR)/%.o:$(SRCS_DIR)/%.c $(HDRS) Makefile
$(CC) $(CFLAGS) $(INCS) -c $< -o $@
.prerequisites: libft/libft.a $(DIRS) $(HDRS) $(SRCS)
libft/libft.a:
make -C libft/
$(DIRS):
mkdir -p $@
$(HDRS):
touch $@
$(SRCS):
touch $@
.PHONY: clean
clean:
/bin/rm -f $(OBJS)
make -C libft/ clean
.PHONY: fclean
fclean:
/bin/rm -f $(NAME) .prerequisites
/bin/rm -rf $(OBJS_DIR)/
make -C libft/ fclean
.PHONY: re
re: fclean all