-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
72 lines (46 loc) · 1.05 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
NAME = fractol
LIBFT_DIR = libft-42/
LIBFT_FILE = libft.a
LIBFT = $(LIBFT_DIR)$(LIBFT_FILE)
MLX_DIR = minilibx-linux/
MLX_FILE= libmlx.a
MLX = $(MLX_DIR)$(MLX_FILE)
MLX_FLAGS = -lX11 -lXext
SRC_DIR = srcs/
OBJ_DIR = objs/
INC_DIR = includes/
CC = gcc
CFLAGS = -Wall -Werror -Wextra
RM = rm -rf
AR = ar rc
RANLIB = ranlib
SRC_FILES = main\
fractals\
navigation\
pixels_manipulation\
animation\
utility\
parsing\
colors\
SRCS = $(addprefix $(SRC_DIR), $(addsuffix .c, $(SRC_FILES)))
OBJS = $(addprefix $(OBJ_DIR), $(addsuffix .o, $(SRC_FILES)))
all: $(NAME)
$(LIBFT):
@make all -C $(LIBFT_DIR)
$(MLX):
@make all -C $(MLX_DIR)
$(NAME): $(OBJS) $(LIBFT) $(MLX)
$(CC) $(CFLAGS) -o $(NAME) $(OBJS) $(LIBFT) $(MLX) $(MLX_FLAGS) -lm
$(OBJ_DIR)%.o: $(SRC_DIR)%.c fractol.h | $(OBJ_DIR)
$(CC) $(CFLAGS) -c $< -o $@
$(OBJ_DIR):
mkdir -p $(OBJ_DIR)
clean:
make clean -C $(LIBFT_DIR)
make clean -C $(MLX_DIR)
$(RM) $(OBJ_DIR)
fclean: clean
$(RM) $(NAME)
make fclean -C $(LIBFT_DIR)
re: fclean all
.PHONY: all clean fclean re