-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (47 loc) · 1.34 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
SRCS_DIR = ./src
OBJS_DIR = ./obj
INCLUDES_DIR = ./includes
LIBFT_DIR = ./libft
CFLAGS = -O3 -Wall -Wextra -Werror
LEAKCHECK = -g -fsanitize=address
CC = gcc $(CFLAGS)
LFLAGS = -L./libft -lft -lmlx -lXext -lX11 -lm
RM = rm -f
NAME = fractol
SRCS_FILES = actions.c hooks.c color.c fractol.c info.c main.c
SRCS = $(addprefix $(SRCS_DIR)/, $(SRCS_FILES))
OBJS_FILES = $(SRCS_FILES:.c=.o)
OBJS = $(addprefix $(OBJS_DIR)/, $(OBJS_FILES))
INCLUDES_FILES = fractol.h defines.h
INCLUDES = $(addprefix $(INCLUDES_DIR)/, $(INCLUDES_FILES))
LIBFT = $(LIBFT_DIR)/libft.a
all: $(NAME)
bonus: $(NAME)
Mandelbrot: $(NAME)
./fractol Mandelbrot
Julia: $(NAME)
./fractol Julia -0.73 0.14
Celtic: $(NAME)
./fractol Celtic
Burning-Ship: $(NAME)
./fractol Burning-Ship
Valgrind: $(NAME)
valgrind --leak-check=full --show-leak-kinds=all \
--log-file=valgrind-out.txt ./fractol Julia -0.73 0.14
$(NAME): $(LIBFT) $(OBJS) $(INCLUDES)
$(CC) -o $(NAME) $(OBJS) $(LFLAGS)
$(LIBFT):
make -C $(LIBFT_DIR) printf
$(OBJS_DIR)/%.o: $(SRCS_DIR)/%.c $(INCLUDES_DIR) $(INCLUDES)
mkdir -p $(OBJS_DIR)
$(CC) $(FLAGS) -I $(INCLUDES_DIR) -c $< -o $@
clean:
make -C $(LIBFT_DIR) clean
$(RM) $(OBJS)
fclean: clean
make -C $(LIBFT_DIR) fclean
$(RM) $(NAME)
rm -rf $(OBJS_DIR)
re: fclean all
.PHONY: all clean fclean re bonus
.PHONY: Mandelbrot Julia Celtic Burning-Ship Valgrind