-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
77 lines (59 loc) · 2.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
73
74
75
76
77
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: avassor <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2022/10/25 10:40:46 by avassor #+# #+# #
# Updated: 2022/11/25 15:57:14 by avassor ### ########.fr #
# #
# **************************************************************************** #
FRACTOL = fractol
NAME = $(FRACTOL)
CC = gcc
CFLAGS = -g -Wall -Wextra -Werror
LFLAGS = -lX11 -lXext -lm
INC = -I ./inc/
MLX_PATH = minilibx-linux/
MLX_NAME = libmlx_Linux.a
MINILIBX = $(MLX_PATH)$(MLX_NAME)
PRINTF_PATH = ft_printf/
PRINTF_NAME = libftprintf.a
PRINTF = $(PRINTF_PATH)$(PRINTF_NAME)
SRC_PATH = src/
OBJ_PATH = obj/
SRC = fract_ol.c \
fo_init.c \
fo_mnlib.c \
fo_iter.c \
fo_utils_1.c \
fo_utils_2.c \
fo_events_mngr.c \
fo_events_apply.c \
fo_color_1.c \
fo_color_2.c \
fo_comp.c
SRCS = $(addprefix $(SRC_PATH), $(SRC))
OBJS = ${SRCS:${SRC_PATH}%.c=${OBJ_PATH}%.o}
$(NAME): $(MINILIBX) $(PRINTF) $(OBJS)
$(CC) -o $(NAME) $(OBJS) $(MINILIBX) $(PRINTF) $(LFLAGS)
$(OBJ_PATH)%.o:$(SRC_PATH)%.c ./inc/fract_ol.h
mkdir -p $(OBJ_PATH)
$(CC) $(CFLAGS) $(INC) -o $@ -c $<
$(MINILIBX):
$(MAKE) -sC $(MLX_PATH)
$(PRINTF):
$(MAKE) -sC $(PRINTF_PATH)
all: $(NAME)
clean:
rm -rdf $(OBJ_PATH)
$(MAKE) clean -C $(MLX_PATH)
$(MAKE) clean -C $(PRINTF_PATH)
fclean: clean
rm -f $(NAME)
rm -f $(PRINTF_PATH)$(PRINTF_NAME)
rm -f $(MLX_PATH)$(MLX_NAME)
re: fclean all
bonus: all
.PHONY: all clean fclean re