-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
87 lines (77 loc) · 2.11 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
# Colors
GREEN=$(shell tput setaf 2)
RED=$(shell tput setaf 1)
NC=$(shell tput sgr0)
CC=cc
CFLAGS=-Werror -Wextra -Wall
HEADER_H=./includes/helpers.h
LIST_HEADER_H=./includes/list_control.h
HELPERS_O=helpers/args_parsing.o\
helpers/check_sorted.o\
helpers/custom_atoi.o\
helpers/fail_exit.o\
helpers/ft_abs.o\
helpers/ft_isdigit.o\
helpers/ft_numbase_len.o\
helpers/ft_printf.o\
helpers/ft_putaddr.o\
helpers/ft_putchar.o\
helpers/ft_putendl_fd.o\
helpers/ft_puthex.o\
helpers/ft_putnbr.o\
helpers/ft_putstr.o\
helpers/ft_putstr_fd.o\
helpers/ft_split.o\
helpers/ft_strcmp.o\
helpers/get_next_line.o\
helpers/get_next_line_utils.o\
helpers/processing_args.o\
helpers/rrx.o\
helpers/some_cleaning.o\
helpers/str_arrays_join.o\
helpers/sx_px.o
LIST_CONTROL_O=list_control/array_to_list.o\
list_control/c_list.o\
list_control/c_node.o\
list_control/l_addafter.o\
list_control/l_addback.o\
list_control/l_addbefore.o\
list_control/l_addfront.o\
list_control/l_copy.o\
list_control/l_delnode.o\
list_control/l_display.o\
list_control/l_free.o\
list_control/l_len.o
CHECKER_O=checker_bonus/check_ok_or_ko.o\
checker_bonus/instructions_check.o\
checker_bonus/main.o\
checker_bonus/reading_input.o
PS_O=srcs/fix_stack.o\
srcs/list_indexing.o\
srcs/main.o\
srcs/maymknch_sort.o\
srcs/maymknch_sort_utils.o\
srcs/moves.o\
srcs/sort_tolati.o\
srcs/sorting.o
BONUS_NAME=checker
NAME=push_swap
all: $(NAME) bonus
bonus: $(BONUS_NAME)
$(NAME): $(HELPERS_O) $(LIST_CONTROL_O) $(PS_O)
@$(CC) $(CFLAGS) $^ -o push_swap
@echo "${GREEN}Done building ${NAME}!${NC}"
$(BONUS_NAME): $(HELPERS_O) $(CHECKER_O) $(LIST_CONTROL_O)
@$(CC) $(CFLAGS) $^ -o checker
@echo "${GREEN}Done building ${BONUS_NAME}!${NC}"
%.o: %.c $(HEADER_H) $(LIST_HEADER_H)
@$(CC) $(CFLAGS) -c $< -o $@
clean:
@rm -f $(CHECKER_O) $(HELPERS_O) $(LIST_CONTROL_O) $(PS_O)
@echo "${RED}Done removing object files.${NC}"
fclean: clean
@rm -f $(BONUS_NAME) $(NAME)
@echo "${RED}Done removing ${NAME}.${NC}"
@echo "${RED}Done removing ${BONUS_NAME}.${NC}"
re: fclean all
.PHONY: clean