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)