-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
74 lines (58 loc) · 1.86 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: zyuan <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2018/01/17 19:48:50 by zyuan #+# #+# #
# Updated: 2018/06/28 20:03:52 by zyuan ### ########.fr #
# #
# **************************************************************************** #
NAME = fractol
#src / obj files
SRC = main.c \
set_up_image.c \
init_fractal.c \
escape_time.c \
color.c \
ui.c \
key_hook.c \
mouse_hook.c \
OBJ = $(addprefix $(OBJDIR),$(SRC:.c=.o))
# compiler
CC = gcc
CFLAGS = -Wall -Wextra -g3
# mlx library
MLX = ./minilibx/
MLX_LIB = $(addprefix $(MLX),mlx.a)
MLX_INC = -I ./minilibx
MLX_LNK = -L ./minilibx -lmlx -framework OpenGL -framework AppKit
# ft library
FT = ./libft/
FT_LIB = $(addprefix $(FT),libft.a)
FT_INC = -I ./libft
FT_LNK = -L ./libft -l ft
#directories
SRCDIR = ./src/
INCDIR = ./includes/
OBJDIR = ./obj/
all: obj $(FT_LIB) $(MLX_LIB) $(NAME)
obj:
mkdir -p $(OBJDIR)
$(OBJDIR)%.o:$(SRCDIR)%.c
$(CC) $(CFLAGS) $(MLX_INC) $(FT_INC) -I $(INCDIR) -o $@ -c $<
$(FT_LIB):
make -C $(FT)
$(MLX_LIB):
make -C $(MLX)
$(NAME): $(OBJ)
$(CC) $(OBJ) $(MLX_LNK) $(FT_LNK) -lm -o $(NAME)
clean:
rm -rf $(OBJDIR)
make -C $(FT) clean
make -C $(MLX) clean
fclean: clean
rm -rf $(NAME)
make -C $(FT) fclean
re: fclean all