-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (43 loc) · 1.81 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: abiriuk <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2018/09/12 18:00:41 by abiriuk #+# #+# #
# Updated: 2018/10/10 17:20:16 by abiriuk ### ########.fr #
# #
# **************************************************************************** #
.PHONY: all clean fclean re $(NAME) $(LFT)
NAME=fractol
CC=gcc
CFLAG=-Wall -Wextra -Werror -I$(LFTPATH) -I/usr/local/include -I./
LFTPATH=libft/
SRCPATH=src
OBJPATH=obj
LFTFILE=libft.a
LFT=$(addprefix $(LFTPATH), $(LFTFILE))
SRCS= exit.c main.c mandelbrot.c window.c color.c move.c mouse_zoom.c julia.c \
celtic.c heart.c precision.c tricorn.c mouse_zoom1.c move1.c buffalo.c \
OBJ=$(SRCS:.c=.o)
MLX=-L /usr/local/lib -lmlx -framework OpenGL -framework AppKit
all: createdir $(NAME)
createdir:
@mkdir -p obj
$(NAME): $(addprefix $(OBJPATH)/, $(OBJ)) $(LFT)
$(CC) $(CFLAG) -L$(LFTPATH) -lft $^ -o $@ $(MLX)
$(addprefix $(OBJPATH)/, %.o): $(addprefix $(SRCPATH)/, %.c)
$(CC) $(CFLAG) -c $< -o $@
debug:
$(CC) $(CFLAG) -L$(LFTPATH) -lft -o $(NAME) src/*.c -g $(MLX)
$(LFT):
$(MAKE) -C $(LFTPATH)
clean:
@rm -rf $(OBJPATH)
$(MAKE) -C $(LFTPATH) clean
fclean:
@rm -rf $(OBJPATH)
@rm -f $(NAME)
$(MAKE) -C $(LFTPATH) fclean
re: fclean all