-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
71 lines (53 loc) · 2.01 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: abensett <[email protected]> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/10/23 22:08:35 by abensett #+# #+# #
# Updated: 2021/12/19 12:46:50 by abensett ### ########.fr #
# #
# **************************************************************************** #
GREEN = \033[1;32m
WHITE = \033[0;m
SRC = src/ft_errorshandler.c \
src/ft_push_swap.c \
src/ft_ps_utils.c \
src/ft_ps_commands.c \
src/ft_ps_sort_utils.c \
src/ft_ps_sort.c \
BSRC = src/ft_errorshandler.c \
src/ft_ps_utils.c \
src/ft_ps_commands.c \
src/ft_checker.c \
src/ft_ps_sort_utils.c \
src/ft_ps_sort.c \
src/ft_get_next_line.c \
OBJ = $(SRC:.c=.o)
BOBJ = $(BSRC: .c=.o)
CC = gcc
CFLAGS = -Wall -Wextra -Werror
EXEC = push_swap
all: $(EXEC)
bonus: push_swap checker
checker: $(BOBJ) libft
gcc -o $@ $(BOBJ) -Llibft -lft
@printf "\n[$(GREEN)OK$(WHITE)] checker generated\n"
$(EXEC) : $(OBJ)
@make -C libft
@make bonus -C libft
@printf "\033[2K\r $(_YELLOW)Compiling $< $(_END)⌛\n"
$(CC) -o $@ $^ libft/libft.a
@printf "\n[$(GREEN)OK$(WHITE)] $(EXEC) generated\n"
.o:.c
@$(CC) -c $(CFLAGS) $?
clean:
@rm -f $(OBJ)
@make -C libft clean
@printf "\n[$(GREEN)cleaned$(WHITE)] .o FILES and libft \n"
fclean: clean
@rm -f $(EXEC) checker libft/libft.a
@printf "\n[$(GREEN)cleaned$(WHITE)] $(EXEC), checker and libft.a \n"
re: fclean all
.PHONY: all clean fclean re