-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
63 lines (49 loc) · 1.03 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
SRCDIR = src/
OBJDIR = bin/
INCDIR = include/
FTPATH = libft/
MLPATH = mlx_linux/
INDIR = $(FTPATH)include/
LIBFT = $(FTPATH)libft.a
MLX =$(MLPATH)libmlx.a
#################################################################
src = main.c\
colors.c\
colors2.c\
bresenham.c\
utils.c\
utils2.c\
parser.c\
draw.c\
free.c\
movements.c\
movements2.c\
hook.c\
OBJS = ${addprefix $(OBJDIR),$(src:.c=.o)}
#################################################################
CFLAGS = -Wall -Wextra -Werror -Ofast
LINK = -lft -lmlx -lXext -lX11 -lm
CC = gcc -g
INCPATH = -I$(INCDIR) -I$(INDIR) -I$(MLPATH)
LIBPATH = -L$(FTPATH) -L$(MLPATH)
NAME = fdf
all: ${NAME}
$(OBJDIR)%.o: $(SRCDIR)%.c
$(CC) -c $(CFLAGS) $(INCPATH) $< -o $@
${NAME}: ${OBJS} $(LIBFT) $(MLX)
$(CC) ${OBJS} $(LIBPATH) $(LINK) -o $(NAME)
$(LIBFT):
make -C $(FTPATH)
$(MLX):
make -C $(MLPATH)
checker:
make re -C checker_dir/
cp checker_dir/checker .
lft:
make -C $(FTPATH)
clean:
rm -f ${OBJS}
fclean: clean
rm -f ${NAME}
re: fclean all
.PHONY: all libft clean fclean re