diff --git a/Makefile b/Makefile index 80de5a6..dc73527 100644 --- a/Makefile +++ b/Makefile @@ -6,41 +6,141 @@ SRCDIR = srcs INCDIR = includes LIBFT = libft/libft.a GNL = gnl/gnl.a +MLX_DIR = minilibx-linux +MLX = $(MLX_DIR)/libmlx_Linux.a +MLX_REPO = https://git.gasoff.ovh/lfirmin/mlx_42.git + +# Flags pour MLX (Linux) +MLX_FLAGS = -lXext -lX11 -lm + +# Couleurs +RED = \033[0;31m +GREEN = \033[0;32m +YELLOW = \033[0;33m +BLUE = \033[0;34m +MAGENTA = \033[0;35m +CYAN = \033[0;36m +WHITE = \033[0;37m +RESET = \033[0m +BOLD = \033[1m SRCS = $(SRCDIR)/main.c \ - $(SRCDIR)/parsing/parsing.c \ - $(SRCDIR)/parsing/check_file.c \ - $(SRCDIR)/parsing/init_parsing.c \ - $(SRCDIR)/parsing/get_map.c \ - $(SRCDIR)/parsing/line_detect.c \ - $(SRCDIR)/parsing/get_textures.c \ - $(SRCDIR)/parsing/check_colors.c \ - $(SRCDIR)/utils/utils.c \ - $(SRCDIR)/utils/init.c \ - $(SRCDIR)/utils/debug.c \ + $(SRCDIR)/parsing/parsing.c \ + $(SRCDIR)/parsing/check_file.c \ + $(SRCDIR)/parsing/init_parsing.c \ + $(SRCDIR)/parsing/get_map.c \ + $(SRCDIR)/parsing/line_detect.c \ + $(SRCDIR)/parsing/get_textures.c \ + $(SRCDIR)/parsing/check_colors.c \ + $(SRCDIR)/utils/utils.c \ + $(SRCDIR)/utils/init.c \ + $(SRCDIR)/utils/debug.c \ INCS = $(INCDIR)/parsing.h \ - $(INCDIR)/cub.h \ - $(INCDIR)/messages.h \ + $(INCDIR)/cub.h \ + $(INCDIR)/messages.h \ -all: $(NAME) +# Animation de chargement +define loading_animation + @echo "$(1)" + @for i in 1 2 3 4 5 6 7 8 9 10; do \ + printf "$(CYAN)["; \ + for j in $$(seq 1 $$i); do printf "█"; done; \ + for j in $$(seq $$i 9); do printf " "; done; \ + printf "] $$(($$i * 10))%%$(RESET)\r"; \ + sleep 0.1; \ + done + @echo "" +endef -$(NAME): $(SRCS) $(INCS) +all: + @echo "$(BOLD)$(MAGENTA)" + @echo "╔════════════════════════════════════════╗" + @echo "║ 🎮 CUB3D BUILD 🎮 ║" + @echo "╚════════════════════════════════════════╝" + @echo "$(RESET)" + @$(MAKE) -s $(NAME) + +$(MLX_DIR): + @echo "$(BOLD)$(CYAN)📦 Cloning MLX42...$(RESET)" + $(call loading_animation,$(YELLOW)⬇️ Downloading MLX42 library...) + @if [ ! -d "$(MLX_DIR)/.git" ]; then \ + rm -rf $(MLX_DIR) > /dev/null 2>&1; \ + git clone $(MLX_REPO) $(MLX_DIR) > /dev/null 2>&1; \ + fi + @echo "$(GREEN)✅ MLX42 cloned successfully!$(RESET)" + +$(MLX): $(MLX_DIR) + @echo "$(BOLD)$(BLUE)🔨 Building MLX42...$(RESET)" + $(call loading_animation,$(YELLOW)⚙️ Compiling MLX42...) + @$(MAKE) -s -C $(MLX_DIR) + @echo "$(GREEN)✅ MLX42 built successfully!$(RESET)" + +$(NAME): $(MLX) $(SRCS) $(INCS) + @echo "$(BOLD)$(BLUE)📚 Building libraries...$(RESET)" + $(call loading_animation,$(YELLOW)📖 Compiling libft...) @$(MAKE) -s -C libft + $(call loading_animation,$(YELLOW)📄 Compiling gnl...) @$(MAKE) -s -C gnl - $(CC) -g -I$(INCDIR) $(SRCS) -o $(NAME) $(LIBFT) $(GNL) + @echo "$(BOLD)$(BLUE)🎯 Building $(NAME)...$(RESET)" + $(call loading_animation,$(YELLOW)🚀 Compiling main executable...) + @$(CC) -g -I$(INCDIR) -I$(MLX_DIR)/include $(SRCS) -o $(NAME) $(LIBFT) $(GNL) $(MLX) $(MLX_FLAGS) + @echo "" + @echo "$(BOLD)$(GREEN)" + @echo "╔════════════════════════════════════════╗" + @echo "║ 🎉 BUILD SUCCESSFUL! 🎉 ║" + @echo "║ ║" + @echo "║ Your $(NAME) is ready to use! 🚀 ║" + @echo "╚════════════════════════════════════════╝" + @echo "$(RESET)" clean: - rm -f $(NAME) + @echo "$(BOLD)$(YELLOW)" + @echo "╔════════════════════════════════════════╗" + @echo "║ 🧹 CLEANING UP 🧹 ║" + @echo "╚════════════════════════════════════════╝" + @echo "$(RESET)" + $(call loading_animation,$(YELLOW)🗑️ Cleaning object files...) + @rm -f $(NAME) @make clean -s -C libft @make clean -s -C gnl + @if [ -d "$(MLX_DIR)" ]; then make clean -s -C $(MLX_DIR); fi + @echo "$(GREEN)✅ Clean completed!$(RESET)" clean1: - rm -f $(NAME) + @echo "$(CYAN)🗑️ Removing executable...$(RESET)" + @rm -f $(NAME) + @echo "$(GREEN)✅ Executable removed!$(RESET)" -fclean: clean1 +fclean: + @echo "$(BOLD)$(RED)" + @echo "╔════════════════════════════════════════╗" + @echo "║ 💣 DEEP CLEAN 💣 ║" + @echo "╚════════════════════════════════════════╝" + @echo "$(RESET)" + @$(MAKE) -s clean1 + $(call loading_animation,$(RED)🔥 Full cleanup in progress...) @make fclean -s -C libft @make fclean -s -C gnl -re: fclean all + @if [ -d "$(MLX_DIR)/minilibx-linux" ]; then make fclean -s -C $(MLX_DIR)/minilibx-linux; fi + @rm -rf $(MLX_DIR) + @echo "" + @echo "$(BOLD)$(GREEN)" + @echo "╔════════════════════════════════════════╗" + @echo "║ ✨ DEEP CLEAN COMPLETE! ✨ ║" + @echo "║ ║" + @echo "║ All files have been removed! 🗑️ ║" + @echo "╚════════════════════════════════════════╝" + @echo "$(RESET)" -.PHONY: all clean fclean re clean1 +re: + @echo "$(BOLD)$(MAGENTA)" + @echo "╔════════════════════════════════════════╗" + @echo "║ 🔄 REBUILDING 🔄 ║" + @echo "╚════════════════════════════════════════╝" + @echo "$(RESET)" + @$(MAKE) -s fclean + @echo "" + @$(MAKE) -s all + +.PHONY: all clean fclean re clean1 \ No newline at end of file diff --git a/cub3d b/cub3d deleted file mode 100755 index 660c7d5..0000000 Binary files a/cub3d and /dev/null differ diff --git a/gnl/Makefile b/gnl/Makefile index baedc93..167aa17 100644 --- a/gnl/Makefile +++ b/gnl/Makefile @@ -29,20 +29,11 @@ YELLOW = \033[0;33m RESET = \033[0m WHITE = \033[0;97m -# Loading animation -LOADING_CHARS = ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ - all: $(NAME) $(NAME): $(OBJ) - @printf "$(YELLOW)Compiling get_next_line, Please wait...$(RESET)" - @for char in $(LOADING_CHARS); do \ - printf "\r$(YELLOW)Compiling get_next_line, Please wait... $$char$(RESET)"; \ - sleep 0.1; \ - done @ar rc $(NAME) $(OBJ) @ranlib $(NAME) - @printf "\r$(GREEN)fine ! $(WHITE)get_next_line compiled successfully ! $(RESET)\n" $(OBJ_DIR)%.o: $(SRCS_DIR)%.c @mkdir -p $(OBJ_DIR) @@ -50,11 +41,9 @@ $(OBJ_DIR)%.o: $(SRCS_DIR)%.c clean: @rm -rf $(OBJ_DIR) - @printf "$(WHITE)Clean process completed for $(GREEN)get_next_line.$(RESET)\n" fclean: clean @rm -f $(NAME) - @printf "$(WHITE)Full clean process completed for $(GREEN)get_next_line.$(RESET)\n" re: fclean all diff --git a/gnl/gnl.a b/gnl/gnl.a deleted file mode 100644 index a81d41a..0000000 Binary files a/gnl/gnl.a and /dev/null differ diff --git a/gnl/obj/get_next_line.o b/gnl/obj/get_next_line.o deleted file mode 100644 index f875ed0..0000000 Binary files a/gnl/obj/get_next_line.o and /dev/null differ diff --git a/gnl/obj/get_next_line_utils.o b/gnl/obj/get_next_line_utils.o deleted file mode 100644 index ce5eb42..0000000 Binary files a/gnl/obj/get_next_line_utils.o and /dev/null differ diff --git a/libft/Makefile b/libft/Makefile index dc17dcc..a33f37e 100644 --- a/libft/Makefile +++ b/libft/Makefile @@ -42,14 +42,8 @@ LOADING_CHARS = ⠋ ⠙ ⠹ ⠸ ⠼ ⠴ ⠦ ⠧ ⠇ ⠏ all: $(NAME) $(NAME): $(OBJ) - @printf "$(YELLOW)Compiling libft, Please wait...$(RESET)" - @for char in $(LOADING_CHARS); do \ - printf "\r$(YELLOW)Compiling libft, Please wait... $$char$(RESET)"; \ - sleep 0.1; \ - done @ar rc $(NAME) $(OBJ) @ranlib $(NAME) - @printf "\r$(GREEN)Great news ! $(WHITE)Libft compiled successfully ! $(RESET)\n" $(OBJ_DIR)%.o: $(SRCS_DIR)%.c @mkdir -p $(OBJ_DIR) @@ -57,11 +51,9 @@ $(OBJ_DIR)%.o: $(SRCS_DIR)%.c clean: @rm -rf $(OBJ_DIR) - @printf "$(WHITE)Clean process completed for $(GREEN)Libft.$(RESET)\n" fclean: clean @rm -f $(NAME) - @printf "$(WHITE)Full clean process completed for $(GREEN)Libft.$(RESET)\n" re: fclean all diff --git a/libft/libft.a b/libft/libft.a deleted file mode 100644 index e187b83..0000000 Binary files a/libft/libft.a and /dev/null differ diff --git a/libft/obj/ft_atoi.o b/libft/obj/ft_atoi.o deleted file mode 100644 index ca72c3c..0000000 Binary files a/libft/obj/ft_atoi.o and /dev/null differ diff --git a/libft/obj/ft_atoll.o b/libft/obj/ft_atoll.o deleted file mode 100644 index 37c372c..0000000 Binary files a/libft/obj/ft_atoll.o and /dev/null differ diff --git a/libft/obj/ft_bzero.o b/libft/obj/ft_bzero.o deleted file mode 100644 index be086ff..0000000 Binary files a/libft/obj/ft_bzero.o and /dev/null differ diff --git a/libft/obj/ft_calloc.o b/libft/obj/ft_calloc.o deleted file mode 100644 index de633bf..0000000 Binary files a/libft/obj/ft_calloc.o and /dev/null differ diff --git a/libft/obj/ft_isalnum.o b/libft/obj/ft_isalnum.o deleted file mode 100644 index 121d636..0000000 Binary files a/libft/obj/ft_isalnum.o and /dev/null differ diff --git a/libft/obj/ft_isalpha.o b/libft/obj/ft_isalpha.o deleted file mode 100644 index ae2efe8..0000000 Binary files a/libft/obj/ft_isalpha.o and /dev/null differ diff --git a/libft/obj/ft_isascii.o b/libft/obj/ft_isascii.o deleted file mode 100644 index 6119c28..0000000 Binary files a/libft/obj/ft_isascii.o and /dev/null differ diff --git a/libft/obj/ft_isdigit.o b/libft/obj/ft_isdigit.o deleted file mode 100644 index bf0722d..0000000 Binary files a/libft/obj/ft_isdigit.o and /dev/null differ diff --git a/libft/obj/ft_isprint.o b/libft/obj/ft_isprint.o deleted file mode 100644 index c72f58e..0000000 Binary files a/libft/obj/ft_isprint.o and /dev/null differ diff --git a/libft/obj/ft_itoa.o b/libft/obj/ft_itoa.o deleted file mode 100644 index 8c24108..0000000 Binary files a/libft/obj/ft_itoa.o and /dev/null differ diff --git a/libft/obj/ft_lstadd_back_bonus.o b/libft/obj/ft_lstadd_back_bonus.o deleted file mode 100644 index 67c1f2e..0000000 Binary files a/libft/obj/ft_lstadd_back_bonus.o and /dev/null differ diff --git a/libft/obj/ft_lstadd_front_bonus.o b/libft/obj/ft_lstadd_front_bonus.o deleted file mode 100644 index 30a9e4f..0000000 Binary files a/libft/obj/ft_lstadd_front_bonus.o and /dev/null differ diff --git a/libft/obj/ft_lstclear_bonus.o b/libft/obj/ft_lstclear_bonus.o deleted file mode 100644 index 32ee2ef..0000000 Binary files a/libft/obj/ft_lstclear_bonus.o and /dev/null differ diff --git a/libft/obj/ft_lstdelone_bonus.o b/libft/obj/ft_lstdelone_bonus.o deleted file mode 100644 index 953015a..0000000 Binary files a/libft/obj/ft_lstdelone_bonus.o and /dev/null differ diff --git a/libft/obj/ft_lstiter_bonus.o b/libft/obj/ft_lstiter_bonus.o deleted file mode 100644 index 9933fd3..0000000 Binary files a/libft/obj/ft_lstiter_bonus.o and /dev/null differ diff --git a/libft/obj/ft_lstlast_bonus.o b/libft/obj/ft_lstlast_bonus.o deleted file mode 100644 index e3f8e88..0000000 Binary files a/libft/obj/ft_lstlast_bonus.o and /dev/null differ diff --git a/libft/obj/ft_lstmap_bonus.o b/libft/obj/ft_lstmap_bonus.o deleted file mode 100644 index 5f758e0..0000000 Binary files a/libft/obj/ft_lstmap_bonus.o and /dev/null differ diff --git a/libft/obj/ft_lstnew_bonus.o b/libft/obj/ft_lstnew_bonus.o deleted file mode 100644 index 299d50d..0000000 Binary files a/libft/obj/ft_lstnew_bonus.o and /dev/null differ diff --git a/libft/obj/ft_lstsize_bonus.o b/libft/obj/ft_lstsize_bonus.o deleted file mode 100644 index 5032c79..0000000 Binary files a/libft/obj/ft_lstsize_bonus.o and /dev/null differ diff --git a/libft/obj/ft_memchr.o b/libft/obj/ft_memchr.o deleted file mode 100644 index c3f003f..0000000 Binary files a/libft/obj/ft_memchr.o and /dev/null differ diff --git a/libft/obj/ft_memcmp.o b/libft/obj/ft_memcmp.o deleted file mode 100644 index 6275aad..0000000 Binary files a/libft/obj/ft_memcmp.o and /dev/null differ diff --git a/libft/obj/ft_memcpy.o b/libft/obj/ft_memcpy.o deleted file mode 100644 index 795ca66..0000000 Binary files a/libft/obj/ft_memcpy.o and /dev/null differ diff --git a/libft/obj/ft_memmove.o b/libft/obj/ft_memmove.o deleted file mode 100644 index f2a2d83..0000000 Binary files a/libft/obj/ft_memmove.o and /dev/null differ diff --git a/libft/obj/ft_memset.o b/libft/obj/ft_memset.o deleted file mode 100644 index 25fbb68..0000000 Binary files a/libft/obj/ft_memset.o and /dev/null differ diff --git a/libft/obj/ft_putchar_fd.o b/libft/obj/ft_putchar_fd.o deleted file mode 100644 index 7f16461..0000000 Binary files a/libft/obj/ft_putchar_fd.o and /dev/null differ diff --git a/libft/obj/ft_putendl_fd.o b/libft/obj/ft_putendl_fd.o deleted file mode 100644 index 45e092e..0000000 Binary files a/libft/obj/ft_putendl_fd.o and /dev/null differ diff --git a/libft/obj/ft_putnbr_fd.o b/libft/obj/ft_putnbr_fd.o deleted file mode 100644 index 6dd260e..0000000 Binary files a/libft/obj/ft_putnbr_fd.o and /dev/null differ diff --git a/libft/obj/ft_putstr_fd.o b/libft/obj/ft_putstr_fd.o deleted file mode 100644 index 70dfe77..0000000 Binary files a/libft/obj/ft_putstr_fd.o and /dev/null differ diff --git a/libft/obj/ft_split.o b/libft/obj/ft_split.o deleted file mode 100644 index 8bbdd52..0000000 Binary files a/libft/obj/ft_split.o and /dev/null differ diff --git a/libft/obj/ft_straddchar.o b/libft/obj/ft_straddchar.o deleted file mode 100644 index 457b929..0000000 Binary files a/libft/obj/ft_straddchar.o and /dev/null differ diff --git a/libft/obj/ft_strchr.o b/libft/obj/ft_strchr.o deleted file mode 100644 index 5c63d94..0000000 Binary files a/libft/obj/ft_strchr.o and /dev/null differ diff --git a/libft/obj/ft_strcmp.o b/libft/obj/ft_strcmp.o deleted file mode 100644 index d23b9c1..0000000 Binary files a/libft/obj/ft_strcmp.o and /dev/null differ diff --git a/libft/obj/ft_strcpy.o b/libft/obj/ft_strcpy.o deleted file mode 100644 index 360c3a7..0000000 Binary files a/libft/obj/ft_strcpy.o and /dev/null differ diff --git a/libft/obj/ft_strdup.o b/libft/obj/ft_strdup.o deleted file mode 100644 index f9669a9..0000000 Binary files a/libft/obj/ft_strdup.o and /dev/null differ diff --git a/libft/obj/ft_striteri.o b/libft/obj/ft_striteri.o deleted file mode 100644 index 1341711..0000000 Binary files a/libft/obj/ft_striteri.o and /dev/null differ diff --git a/libft/obj/ft_strjoin.o b/libft/obj/ft_strjoin.o deleted file mode 100644 index f67b4ef..0000000 Binary files a/libft/obj/ft_strjoin.o and /dev/null differ diff --git a/libft/obj/ft_strlcat.o b/libft/obj/ft_strlcat.o deleted file mode 100644 index 94339c9..0000000 Binary files a/libft/obj/ft_strlcat.o and /dev/null differ diff --git a/libft/obj/ft_strlcpy.o b/libft/obj/ft_strlcpy.o deleted file mode 100644 index 040be82..0000000 Binary files a/libft/obj/ft_strlcpy.o and /dev/null differ diff --git a/libft/obj/ft_strlen.o b/libft/obj/ft_strlen.o deleted file mode 100644 index 2b75faf..0000000 Binary files a/libft/obj/ft_strlen.o and /dev/null differ diff --git a/libft/obj/ft_strmapi.o b/libft/obj/ft_strmapi.o deleted file mode 100644 index 87c09a4..0000000 Binary files a/libft/obj/ft_strmapi.o and /dev/null differ diff --git a/libft/obj/ft_strncmp.o b/libft/obj/ft_strncmp.o deleted file mode 100644 index fb4b9f4..0000000 Binary files a/libft/obj/ft_strncmp.o and /dev/null differ diff --git a/libft/obj/ft_strnstr.o b/libft/obj/ft_strnstr.o deleted file mode 100644 index b13c723..0000000 Binary files a/libft/obj/ft_strnstr.o and /dev/null differ diff --git a/libft/obj/ft_strrchr.o b/libft/obj/ft_strrchr.o deleted file mode 100644 index 482fbe3..0000000 Binary files a/libft/obj/ft_strrchr.o and /dev/null differ diff --git a/libft/obj/ft_strtrim.o b/libft/obj/ft_strtrim.o deleted file mode 100644 index 09ca38f..0000000 Binary files a/libft/obj/ft_strtrim.o and /dev/null differ diff --git a/libft/obj/ft_substr.o b/libft/obj/ft_substr.o deleted file mode 100644 index e8b22b9..0000000 Binary files a/libft/obj/ft_substr.o and /dev/null differ diff --git a/libft/obj/ft_tolower.o b/libft/obj/ft_tolower.o deleted file mode 100644 index 874f0c6..0000000 Binary files a/libft/obj/ft_tolower.o and /dev/null differ diff --git a/libft/obj/ft_toupper.o b/libft/obj/ft_toupper.o deleted file mode 100644 index bdc406c..0000000 Binary files a/libft/obj/ft_toupper.o and /dev/null differ