-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
80 lines (62 loc) · 2 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
77
78
79
80
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: komatsud <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/06/30 21:30:46 by komatsud #+# #+# #
# Updated: 2023/07/02 17:20:03 by komatsud ### ########.fr #
# #
# **************************************************************************** #
NAME = connect4
CC = cc
CFLAGS = -Wall -Wextra -Werror
RM = rm -f
DEBUG = debug
CFLAGS_DEBUG = -Wall -Wextra -Werror -g -fsanitize=address
# find *.c | sed 's/$/ \\/'
SRCS = \
ft_add_pawn.c \
ft_connect4.c \
ft_draw_field.c \
ft_error.c \
ft_exit.c \
ft_free.c \
ft_get_move.c \
ft_cal_move.c \
ft_init.c \
ft_is_game_ended.c \
ft_randomly_choose_first_move.c \
ft_show_result.c \
get_next_line.c \
get_next_line_utils.c \
bonus/ft_draw_tiles.c \
bonus/ft_error_libx.c \
bonus/ft_free_libx.c \
bonus/ft_hooks.c \
bonus/ft_init_libx.c \
bonus/ft_libx_connect4.c \
OBJS = $(SRCS:.c=.o)
MINILIBX = libmlx.dylib
LIBFT_DIR = ./libft
LIBFT = $(LIBFT_DIR)/libft.a
all: $(NAME)
%.o: %.c
$(CC) $(CFLAGS) -o $@ -c $<
$(NAME): $(LIBFT) $(OBJS)
$(CC) $(OBJS) $(CFLAGS) $(MINILIBX) $(LIBFT) -o $@
$(DEBUG):
make all
$(CC) $(OBJS) $(CFLAGS_DEBUG) $(LIBFT) $(MINILIBX) -o $(NAME)
$(LIBFT): FORCE
@make -C $(LIBFT_DIR) all
clean:
@make -C $(LIBFT_DIR) clean
$(RM) $(OBJS)
fclean: clean
@make -C $(LIBFT_DIR) fclean
$(RM) $(NAME)
re: fclean all
FORCE:
.PHONY: all clean fclean re FORCE