From bbe97e90c6059501af91266d43d06abe35553505 Mon Sep 17 00:00:00 2001 From: asus Date: Fri, 26 Jan 2024 13:10:50 +0100 Subject: [PATCH] make diff ok --- C/MakefileCommon | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/C/MakefileCommon b/C/MakefileCommon index 1d750da..80989b1 100644 --- a/C/MakefileCommon +++ b/C/MakefileCommon @@ -105,13 +105,15 @@ $(NAME): $(OBJS) leaks: $(NAME) valgrind --leak-check=full --show-leak-kinds=all $(CREATE_CLONE) -run: +run: $(NAME) $(CREATE_CLONE) -diff: $(NAME) +diff: $(CLONES) @echo $(CYAN)"compare source with output :"$(RESET) - - diff --color $(CLONE) $(SRCS); \ - if [ $$? -eq 0 ]; then echo $(GREEN)"Files $(SRCS) and $(CLONES) are identical"$(RESET); else echo $(RED)":Files $(SRCS) and $(CLONES) differ"$(RESET); fi + @for clone in $^; do \ + diff --color $$clone $(SRCS); \ + if [ $$? -eq 0 ]; then echo $(GREEN)"Files $(SRCS) and $$clone are identical"$(RESET); else echo $(RED)":Files $(SRCS) and $$clone differ"$(RESET); fi \ + done clean: $(RM_OBJS)