-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
95 lines (75 loc) · 2.33 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
NAME := push_swap
BONUS_NAME := checker
CC := gcc
# CFLAGS = -Wall -Werror -Wextra -g -fsanitize=address
CFLAGS = -Wall -Werror -Wextra -g
LDFLAGS = -flto -O3 -march=nocona -g
SRC_DIR = ./src/
SRC := develop_utils_0.c \
develop_utils_1.c \
exit_utils.c \
input_ops.c \
main_utils.c \
main.c \
push_commands.c \
rev_rotate_commands.c \
rotate_commands.c \
sort_stack_3_nodes.c \
sort_stack_5_nodes_utils.c \
sort_stack_5_nodes.c \
sort_stack.c \
stack_utils_0.c \
stack_utils_1.c \
swap_commands.c
BONUS := checker_main.c \
checker_utils_0.c \
checker_utils_1.c \
develop_utils_0.c \
develop_utils_1.c \
exit_utils.c \
get_next_line.c \
input_ops.c \
main_utils.c \
rev_rotate_commands.c \
rotate_commands.c \
stack_utils_0.c \
stack_utils_1.c \
swap_commands.c
# get_next_line_utils.c \
HEADER = -I ./include -I ../LeakSanitizer
LIBFT_PRINTF_DIR = ./lib/ft_printf
LIBFT_PRINTF = ./lib/ft_printf/libftprintf.a
libft_printf:
${MAKE} -C $(LIBFT_PRINTF_DIR) -j
clean:
${MAKE} -C $(LIBFT_PRINTF_DIR) fclean
all: libft_printf
${MAKE} $(NAME) -j
fclean: clean
rm -f $(NAME)
re: fclean all
bonus:
${MAKE} $(BONUS_NAME) -j
bonus_fclean: clean
rm -f $(BONUS_NAME)
re_bonus: bonus_fclean bonus
re_all: re re_bonus
$(NAME):
# $(CC) $(LDFLAGS) $(addprefix $(SRC_DIR),$(SRC)) $(HEADER) $(LIBFT_PRINTF) \
-o $(NAME)
# $(CC) $(CFLAGS) $(addprefix $(SRC_DIR),$(SRC)) $(HEADER) $(LIBFT_PRINTF) \
-o $(NAME)
# $(CC) $(LDFLAGS) $(addprefix $(SRC_DIR),$(SRC)) $(HEADER) $(LIBFT_PRINTF) \
-o $(NAME) -L ../LeakSanitizer -llsan -lc++ -Wno-gnu-include-next
$(CC) $(CFLAGS) $(addprefix $(SRC_DIR),$(SRC)) $(HEADER) $(LIBFT_PRINTF) \
-o $(NAME) -L ../LeakSanitizer -llsan -lc++ -Wno-gnu-include-next
$(BONUS_NAME):
# $(CC) $(LDFLAGS) $(addprefix $(SRC_DIR),$(BONUS)) $(HEADER) $(LIBFT_PRINTF) \
-o $(BONUS_NAME)
$(CC) $(CFLAGS) $(addprefix $(SRC_DIR),$(BONUS)) $(HEADER) $(LIBFT_PRINTF) \
-o $(BONUS_NAME)
# $(CC) $(LDFLAGS) $(addprefix $(SRC_DIR),$(BONUS)) $(HEADER) $(LIBFT_PRINTF) \
-o $(BONUS_NAME) -L ../LeakSanitizer -llsan -lc++ -Wno-gnu-include-next
# $(CC) $(CFLAGS) $(addprefix $(SRC_DIR),$(BONUS)) $(HEADER) $(LIBFT_PRINTF) \
-o $(BONUS_NAME) -L ../LeakSanitizer -llsan -lc++ -Wno-gnu-include-next
.PHONY: libft_printf clean all fclean re bonus bonus_fclean re_bonus re_all