-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
67 lines (52 loc) · 1.89 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: argonthi <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2019/10/21 04:41:46 by argonthi #+# #+# #
# Updated: 2019/10/23 12:10:22 by argonthi ### ########.fr #
# #
# **************************************************************************** #
NAME = fdf
SRC_PATH = srcs
SRC_NAME = draw_line.c \
find_map_size.c \
handle_events.c \
parser.c \
draw_map.c \
rotations.c \
zoom.c \
handle_moves.c \
images.c \
main.c \
quit_all.c
OBJ_PATH = objs
OBJ_NAME = $(SRC_NAME:.c=.o)
CC = gcc
CFLAGS = -g -Wall -Werror -Wextra
CPPFLAGS = -I includes -I libft
LDFLAGS = -L libft
LDLIBS = -lft -lm -lmlx -framework OpenGL -framework AppKit
SRC = $(addprefix $(SRC_PATH)/,$(SRC_NAME))
OBJ = $(addprefix $(OBJ_PATH)/,$(OBJ_NAME))
all: $(NAME)
$(NAME): $(OBJ)
@make -C libft
@$(CC) $(LDFLAGS) $(LDLIBS) $^ -o $@
@echo "Compilation of FdF: \033[1;32mOK\033[m"
$(OBJ_PATH)/%.o: $(SRC_PATH)/%.c
@mkdir $(OBJ_PATH) 2> /dev/null || true
@$(CC) $(CFLAGS) -c $< $(CPPFLAGS) -o $@
clean:
@make -C libft clean
@rm -f $(OBJ)
@rmdir $(OBJ_PATH) 2> /dev/null || true
@echo "FdF: Removing Objs"
fclean: clean
@make -C libft fclean
@rm -f $(NAME)
@echo "FdF: Removing FdF"
re: fclean all
.PHONY: all, clean, fclean, re