-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
93 lines (79 loc) · 2.77 KB
/
Copy pathMakefile
File metadata and controls
93 lines (79 loc) · 2.77 KB
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
88
89
90
91
92
93
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: asuc <asuc@student.42angouleme.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/08/12 17:42:16 by asuc #+# #+# #
# Updated: 2024/02/10 20:24:42 by asuc ### ########.fr #
# #
# **************************************************************************** #
BGreen = $(shell echo "\033[1;32m")
RESET = $(shell echo "\033[0m")
BRed = $(shell echo "\033[1;31m")
NAME = push_swap
NAME_BONUS = checker
COMP = cc
CFLAGS = -Wall -Werror -Wextra
libft = Libft/
SRC = srcs/ft_push_swap.c\
srcs/utils.c\
srcs/input_check_and_create_tab.c\
srcs/fill_stack.c\
srcs/sort.c\
srcs/push.c\
srcs/reverse_rotate.c\
srcs/rotate.c\
srcs/swap.c\
srcs/sort_three.c\
srcs/lis.c\
srcs/lis_utils.c\
srcs/free.c\
srcs/check_input.c\
srcs/check_input_utils.c\
srcs/input_check_and_create_tab_utils.c \
srcs/sort_part1.c \
srcs/sort_part1_utils.c \
srcs/sort_part2.c \
srcs/sort_part2_utils.c \
srcs/sort_utils.c \
srcs/sort_utils2.c \
srcs/push_swap_utils.c
SRC_BONUS = bonus/ft_push_swap.c\
bonus/utils.c\
bonus/input_check_and_create_tab.c\
bonus/fill_stack.c\
bonus/push.c\
bonus/reverse_rotate.c\
bonus/rotate.c\
bonus/swap.c\
bonus/free.c\
bonus/check_input.c\
bonus/check_input_utils.c\
bonus/input_check_and_create_tab_utils.c
OBJ = $(SRC:.c=.o)
OBJ_BONUS = $(SRC_BONUS:.c=.o)
all : $(NAME)
%.o : %.c
@$(COMP) $(CFLAGS) -o $@ -c $<
$(NAME) : $(OBJ)
@make --no-print-directory -C $(libft)
@cp $(libft)libft.a libft.a
@clang $(CFLAGS) -o $(NAME) $(OBJ) libft.a
@echo "$(BGreen)Compilation OK$(RESET)"
bonus : $(OBJ_BONUS)
@make --no-print-directory -C $(libft)
@cp $(libft)libft.a libft.a
@clang $(CFLAGS) -o $(NAME_BONUS) $(OBJ_BONUS) libft.a
@echo "$(BGreen)Compilation OK$(RESET)"
clean :
@make clean --no-print-directory -C $(libft)
@rm -f $(OBJ) $(OBJ_BONUS)
@echo "$(BRed)Erase .o files$(RESET)"
fclean : clean
@make fclean --no-print-directory -C $(libft)
@rm -f $(NAME) $(NAME_BONUS) libft.a
@echo "$(BRed)Erase $(NAME) and libft.a$(RESET)"
re : fclean all
.PHONY: all fclean clean re bonus