-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (43 loc) · 1.24 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
NAME = push_swap
DEF_COLOR = \033[0;39m
GRAY = \033[0;90m
RED = \033[0;91m
GREEN = \033[0;92m
YELLOW = \033[0;93m
BLUE = \033[0;94m
MAGENTA = \033[0;95m
CYAN = \033[0;96m
WHITE = \033[0;97m
BLACK = \033[0;99m
ORANGE = \033[38;5;209m
BROWN = \033[38;2;184;143;29m
DARK_GRAY = \033[38;5;234m
MID_GRAY = \033[38;5;245m
DARK_GREEN = \033[38;2;75;179;82m
DARK_YELLOW = \033[38;5;143m
SRCS = main.c \
cost.c do_moves.c position.c \
push.c reverse_rotate.c \
split.c rotate.c sort_three.c sort.c \
stack.c start.c swap.c utils.c
INCLUDE = ./push_swap.h
CC = gcc
RM = rm -f
CFLAGS = -Wall -Wextra -Werror
%.o: %.c
@echo "${BLUE} ◎ $(YELLOW)Compiling ${RED}→ $(GREEN)$< $(DEF_COLOR)"
@${CC} ${CFLAGS} -c $< -o $@
OBJS = ${SRCS:.c=.o}
all: ${NAME}
${NAME}: ${OBJS} $(INCLUDE)
@${CC} ${SRCS} -o ${NAME}
@echo "\n$(GREEN) Created $(NAME) ✓$(DEF_COLOR)\n"
clean:
@${RM} ${OBJS}
@echo "\n${GRAY} ◎ $(RED)All objects cleaned successfully ${GRAY}◎$(DEF_COLOR)\n"
fclean:
@${RM} ${OBJS}
@${RM} ${NAME}
@echo "\n${GRAY} ◎ $(RED)All objects and executable cleaned successfully${GRAY} ◎$(DEF_COLOR)\n"
re: fclean all
.PHONY: all clean fclean re