-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
72 lines (57 loc) · 1.18 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
NAME = push_swap
BONUS = checker
CC = cc
CFLAGS = -Wall -Wextra -Werror #-g3 -fsanitize=address
RM = rm -f
FILES = push_swap \
swap_functions \
push_functions \
rotate_functions \
rev_rotate_functions \
utilities_1 \
utilities_2 \
utilities_3 \
validation \
ft_split \
clear_and_free \
main_sorting \
sorting_3 \
sorting_5 \
indexing \
BONUS_FILES = checker \
swap_functions \
push_functions \
rotate_functions \
rev_rotate_functions \
utilities_1 \
utilities_2 \
utilities_3 \
validation \
ft_split \
clear_and_free \
main_sorting \
sorting_3 \
sorting_5 \
indexing \
get_next_line \
get_next_line_utils \
checker_utils \
HEADERS = push_swap.h
SRCS = $(addsuffix .c, $(FILES))
OBJS = $(addsuffix .o, $(FILES))
B_SRCS = $(addsuffix .c, $(BONUS_FILES))
B_OBJS = $(addsuffix .o, $(BONUS_FILES))
all: $(NAME)
bonus: $(BONUS)
$(NAME): $(OBJS)
$(CC) $(CFLAGS) $^ -o $@
$(BONUS): $(B_OBJS)
$(CC) $(CFLAGS) $^ -o $@
%.o: %.c $(SRCS) $(HEADERS) Makefile
$(CC) $(CFLAGS) -c $< -o $@
clean:
$(RM) $(OBJS) $(B_OBJS)
fclean: clean
$(RM) $(NAME) $(BONUS)
re: clean all bonus
.PHONY: all bonus clean fclean re