Makefile: add QUIET_GEN to "tags" and "TAGS" targets
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>
Ævar Arnfjörð Bjarmason committed
Mar 28, 2021 at 04:18 UTC
3c80fcb5910eddf9e347e637fce2b6fbc6d7dcbd
1 file changed
+6
-4
Makefile
+6
-4
@@ -2669,12 +2669,14 @@ FIND_SOURCE_FILES = ( \
2669
)
2670
2671
$(ETAGS_TARGET): FORCE
2672
- $(RM) $(ETAGS_TARGET)
2673
- $(FIND_SOURCE_FILES) | xargs etags -a -o $(ETAGS_TARGET)
2672
+ $(QUIET_GEN)$(RM) "$(ETAGS_TARGET)+" && \
2673
+ $(FIND_SOURCE_FILES) | xargs etags -a -o "$(ETAGS_TARGET)+" && \
2674
+ mv "$(ETAGS_TARGET)+" "$(ETAGS_TARGET)"
2675
2676
tags: FORCE
2676
- $(RM) tags
2677
- $(FIND_SOURCE_FILES) | xargs ctags -a
2677
+ $(QUIET_GEN)$(RM) tags+ && \
2678
+ $(FIND_SOURCE_FILES) | xargs ctags -a -o tags+ && \
2679
+ mv tags+ tags
2680
2681
cscope:
2682
$(RM) cscope*