]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Makefile: add QUIET_GEN to "tags" and "TAGS" targets
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Sun, 28 Mar 2021 02:18:34 +0000 (04:18 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 2 Apr 2021 05:23:39 +0000 (22:23 -0700)
Don't show the very verbose $(FIND_SOURCE_FILES) command on every
"make TAGS" invocation.

Let's use "generate into temporary and rename to the final file,
after seeing the command that generated the output finished
successfully" pattern, to avoid leaving a file with an incorrect
output generated by a failed command.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile

index f3dc2178324e4f7270c053a7fad070ead9f0c21e..d3274f62b4776797937dad51b656b7bdf5ff5933 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2669,12 +2669,14 @@ FIND_SOURCE_FILES = ( \
        )
 
 $(ETAGS_TARGET): FORCE
-       $(RM) $(ETAGS_TARGET)
-       $(FIND_SOURCE_FILES) | xargs etags -a -o $(ETAGS_TARGET)
+       $(QUIET_GEN)$(RM) "$(ETAGS_TARGET)+" && \
+       $(FIND_SOURCE_FILES) | xargs etags -a -o "$(ETAGS_TARGET)+" && \
+       mv "$(ETAGS_TARGET)+" "$(ETAGS_TARGET)"
 
 tags: FORCE
-       $(RM) tags
-       $(FIND_SOURCE_FILES) | xargs ctags -a
+       $(QUIET_GEN)$(RM) tags+ && \
+       $(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \
+       mv tags+ tags
 
 cscope:
        $(RM) cscope*