-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
76 lines (63 loc) · 1.69 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
# push_swap
NAME = push_swap
PUSHSWAP_SRC = src/stack.c \
src/stack2.c \
src/helpers.c \
src/push_swap.c \
src/validator.c \
src/dictionary.c \
src/short_sort.c \
src/modern_times.c \
src/moves/ft_push.c \
src/modern_times2.c \
src/moves/ft_swap.c \
src/moves/ft_rotate.c \
src/moves/ft_reverse_rotate.c
OBJS = $(PUSHSWAP_SRC:.c=.o)
# bonus
NAME_BONUS = checker
BONUS_SRC = src/stack.c \
src/stack2.c \
src/helpers.c \
src/validator.c \
src/dictionary.c \
src/checker_bonus.c \
src/moves/ft_push.c \
src/moves/ft_swap.c \
src/moves/ft_rotate.c \
src/moves/ft_reverse_rotate.c
OBJSBNS = $(BONUS_SRC:.c=.o)
# Libft
LIBFT = libft.a
LIBFT_SRC = ./libft/
# Compiler
CC = gcc
RM = rm -f
CFLAGS = -Wall -Werror -Wextra
# Colours
RED = \033[0;31m
GREEN = \033[0;32m
YELLOW = \033[0;33m
BLUE = \033[0;34m
PURPLE = \033[0;35m
CYAN = \033[0;36m
WHITE = \033[0;37m
RESET = \033[0m
# Rules
all: $(LIBFT) $(NAME)
@printf "$(BLUE)==> $(CYAN)Push_swap compiled ✅\n\n$(RESET)"
$(LIBFT):
@make -C libft bonus
$(NAME): $(OBJS)
@$(CC) $(CFLAGS) $(OBJS) $(LIBFT_SRC)$(LIBFT) -o $(NAME)
bonus: $(LIBFT) $(OBJSBNS)
@$(CC) $(CFLAGS) $(OBJSBNS) $(LIBFT_SRC)$(LIBFT) -o $(NAME_BONUS)
@printf "$(BLUE)==> $(CYAN)Push_swap bonus compiled ✅✨\n\n$(RESET)"
clean:
@$(RM) $(NAME) $(OBJS) $(OBJSBNS) $(NAME_BONUS)
@printf "\n$(BLUE)==> $(RED)Removed Push_swap 🗑️\n$(RESET)"
fclean: clean
@make -C libft fclean
re: fclean all
@printf "$(BLUE)==> $(CYAN)Push_swap recompiled 🔄\n$(RESET)"
.PHONY: all clean fclean bonus re