-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·48 lines (33 loc) · 901 Bytes
/
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
SDIR = src
SRCS = main.c events.c images.c colors.c init.c \
fractals/mandelbrot.c fractals/julia.c \
complex.c manupilation.c fractals/burning_ship.c \
fractals/multi_mandelbrot.c
ODIR = obj
OBJS = $(addprefix $(ODIR)/,$(SRCS:.c=.o))
IDIR = inc
INCL = fractol.h ft_mlx_keys.h
CFLAGS = -Wall -Wextra -Werror
NAME = fractol
HEADER = $(addprefix $(IDIR)/,$(INCL))
OUTPUT = ./
CC = cc
LIBS = -L/usr/local/lib -lmlx -Llibft/lib -lft -framework OpenGL -framework AppKit
INCLUDE = -I/usr/local/include -I$(IDIR) -Ilibft/inc
all: $(NAME)
run: all
@$(OUTPUT)/$(NAME)
$(ODIR)/%.o: $(SDIR)/%.c $(HEADER)
@mkdir -p $(@D)
$(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
$(NAME): $(OBJS)
@make -C libft
$(CC) $(OBJS) $(LIBS) -o $(OUTPUT)/$(NAME)
clean:
@make -C libft clean
@rm -rf $(ODIR)
fclean: clean
@make -C libft fclean
@rm -rf $(NAME)
re: fclean all
.PHONY: all clean fclean re run