-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (46 loc) · 1.91 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
# **************************************************************************** #
# #
# ::: :::::::: #
# Makefile :+: :+: :+: #
# +:+ +:+ +:+ #
# By: guortun- <guortun-@student.42madrid.com +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2023/10/24 13:20:28 by guortun- #+# #+# #
# Updated: 2023/11/27 08:34:30 by guortun- ### ########.fr #
# #
# **************************************************************************** #
# Colores
RESET = \033[0m
RED = \033[0;31m
GREEN = \033[0;32m
YELLOW = \033[0;33m
BLUE = \033[0;34m
# Objetivos
OBJ_COLOR = $(BLUE)
CLEAN_COLOR = $(YELLOW)
FCLEAN_COLOR = $(RED)
RE_COLOR = $(GREEN)
NAME = push_swap
CC = gcc
CFLAGS = -Wall -Wextra -Werror
SRC = push_swap.c ./include/utils.c ./include/utils_2.c ./include/utils_3.c ./include/utils_4.c ./include/utils_5.c ./include/utils_6.c ./include/utils_7.c ./include/utils_8.c ./include/utils_9.c ./include/moves.c
OBJ = $(SRC:.c=.o)
MAKEFLAGS += --silent
# Reglas
all: $(NAME)
$(NAME): $(OBJ)
@echo "$(OBJ_COLOR)Compilando $(NAME) ...$(RESET)"
@if [ -z "$(OBJ)" ]; then \
echo "$(RED)No hay nada que hacer$(RESET)"; \
else \
$(CC) $(CFLAGS) $(OBJ) -o $(NAME) || (echo "$(RED)Error de compilación$(RESET)" && exit 1); \
echo "$(GREEN)¡Compilación exitosa!$(RESET)"; \
fi
clean:
@echo "$(CLEAN_COLOR)Limpiando archivos objeto...$(RESET)"
@rm -f $(OBJ)
fclean: clean
@echo "$(FCLEAN_COLOR)Limpiando $(NAME) ...$(RESET)"
@rm -f $(NAME)
re: fclean all
.PHONY: clean fclean all re