wip better makefile

This commit is contained in:
asus
2024-01-23 16:14:28 +01:00
parent 25fadd05a0
commit 3c1d9f0c3c
5 changed files with 23 additions and 30 deletions

View File

@@ -31,8 +31,10 @@ RESET = "\e[0m"
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
# FILES :
#NAME -> defined in subfolder makefiles
#SRCS -> defined in subfolder makefiles
#NAME -> defined in subfolder makefiles
#SRCS -> defined in subfolder makefiles
#CLONE -> defined in subfolder makefiles
#CREATE_CLONE -> defined in subfolder makefiles
LIBS =
D_SRCS = .
D_HEADERS = .
@@ -55,7 +57,6 @@ ifeq "$(D_OBJS)" "."
else
RM_OBJS = rm -rf $(D_OBJS)
endif
F_DIFF = tmp_$(NAME).c
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - #
@@ -89,21 +90,17 @@ $(NAME): $(OBJS)
leaks: $(NAME)
valgrind --leak-check=full --show-leak-kinds=all ./$(NAME)
diff_clean:
rm $(F_DIFF)
diff_exec:
diff: $(NAME)
@echo $(CYAN)"compare source with output :"$(RESET)
./$(NAME) > $(F_DIFF)
- diff --color $(F_DIFF) $(SRCS); \
if [ $$? -eq 0 ]; then echo $(GREEN)"Files $(NAME) and $(SRCS) are identical"$(RESET); else echo $(RED)":Files $(NAME) and $(SRCS) differ"$(RESET); fi
diff: $(NAME) diff_exec diff_clean
diff_keep: $(NAME) diff_exec
$(CREATE_CLONE)
- diff --color $(CLONE) $(SRCS); \
if [ $$? -eq 0 ]; then echo $(GREEN)"Files $(SRCS) and $(CLONE) are identical"$(RESET); else echo $(RED)":Files $(NAME) and $(SRCS) differ"$(RESET); fi
clean:
$(RM_OBJS)
fclean: clean
rm -f $(NAME)
rm -f $(CLONE)
re: fclean all