From a3b8cb988c7d7ebc42ab6904e5f257821fe7fe82 Mon Sep 17 00:00:00 2001 From: josephcheel Date: Tue, 2 Jul 2024 23:57:34 +0200 Subject: [PATCH] some improvements on makefile --- Makefile | 126 ++++++++++++++++++++++++++----------------------------- 1 file changed, 60 insertions(+), 66 deletions(-) diff --git a/Makefile b/Makefile index 73ea5da..9125f7b 100644 --- a/Makefile +++ b/Makefile @@ -1,97 +1,91 @@ - -RESET := \033[1;97m -RED := \033[1;91m -GREEN := \033[1;92m -YELLOW := \033[1;93m -BLUE := \033[1;94m -PINK := \033[1;95m -CYAN := \033[1;96m -CLEAN_CAR = \033[2K\r - -NAME := Webserv - +# **************************************************************************** # +# # +# ::: :::::::: # +# Makefile :+: :+: :+: # +# +:+ +:+ +:+ # +# By: jcheel-n $@.$$$$; \ - sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ - rm -f $@.$$$$ - -print: - @echo "$(RESET)NAME: $(NAME)" - @echo "FLAGS: $(YELLOW)$(FLAGS)$(RESET)" - @echo "SRCS: $(YELLOW)$(SRCS)$(RESET)" - @echo "INCS: $(YELLOW)$(INCS)$(RESET)" - @echo OBJS: $(OBJS) - @echo DSTS: $(DSTS) - @echo OBJDST_DIR: $(OBJDST_DIR) - @echo DIRSRC: $(DIRSRC) - @echo DIRINC: $(DIRINC) - @echo FLAG SISTEMA: $(SYSTEM) + @printf "$(COLOR_GREEN)$(CLEAN_CAR)Compiling $*.o: $(notdir $<) $(COLOR_RESET)" + @$(CC) $(FLAGS) -MMD -MP -c $(INCLUDE) $< -o $@ clean: - @printf "$(RED)$(CLEAN_CAR)Removing objects folder $(OBJDST_DIR)$(RESET)\n" - $(RM) $(OBJDST_DIR) + @printf "$(COLOR_RED)$(CLEAN_CAR)Removing objects folder $(OBJDST_DIR)$(COLOR_RESET)\n" + @$(RM) $(OBJDST_DIR) fclean: clean - @printf "$(RED)$(CLEAN_CAR)Removing executable object $(NAME)$(RESET)\n" - $(RM) $(NAME) + @printf "$(COLOR_RED)$(CLEAN_CAR)Removing executable object $(NAME)$(COLOR_RESET)\n" + @$(RM) $(NAME) re: fclean all - - PHONY: all clean fclean re print lnx print_system -.SILENT: - -ifeq (,$(findstring clean,$(MAKECMDGOALS))) -ifeq (,$(findstring re,$(MAKECMDGOALS))) --include $(DSTS) -endif -endif - - +.SILENT: $(DEPS) $(OBJS) $(NAME) +-include $(DEPS) + \ No newline at end of file