-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
76 lines (60 loc) · 1.88 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: pbondoer <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2016/02/22 23:12:10 by pbondoer #+# #+# #
# Updated: 2016/06/12 05:36:57 by pbondoer ### ########.fr #
# #
# **************************************************************************** #
NAME = fdf
# src / obj files
SRC = main.c \
reader.c \
map.c \
window.c \
draw.c \
matrix.c \
mouse.c \
keyboard.c \
image.c \
lineclip.c
OBJ = $(addprefix $(OBJDIR),$(SRC:.c=.o))
# compiler
CC = gcc
CFLAGS = -Wall -Wextra -Werror -g
# mlx library
MLX = ./miniLibX/
MLX_LIB = $(addprefix $(MLX),mlx.a)
MLX_INC = -I ./miniLibX
MLX_LNK = -L ./miniLibX -l mlx -framework OpenGL -framework AppKit
# ft library
FT = ./libft/
FT_LIB = $(addprefix $(FT),libft.a)
FT_INC = -I ./libft
FT_LNK = -L ./libft -l ft
# directories
SRCDIR = ./src/
INCDIR = ./includes/
OBJDIR = ./obj/
all: obj $(FT_LIB) $(MLX_LIB) $(NAME)
obj:
mkdir -p $(OBJDIR)
$(OBJDIR)%.o:$(SRCDIR)%.c
$(CC) $(CFLAGS) $(MLX_INC) $(FT_INC) -I $(INCDIR) -o $@ -c $<
$(FT_LIB):
make -C $(FT)
$(MLX_LIB):
make -C $(MLX)
$(NAME): $(OBJ)
$(CC) $(OBJ) $(MLX_LNK) $(FT_LNK) -lm -o $(NAME)
clean:
rm -rf $(OBJDIR)
make -C $(FT) clean
make -C $(MLX) clean
fclean: clean
rm -rf $(NAME)
make -C $(FT) fclean
re: fclean all