diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-08-05 00:54:40 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-08-05 09:31:15 -0700 |
commit | 899062438f47189cdcc3f5d3b3185eb4cfd798a7 (patch) | |
tree | 0ea53abc7f3146b3739d78bba213e45703e5f8a4 /t/t6005-rev-list-count.sh | |
parent | Makefile: remove "cscope.out", not "cscope*" in cscope.out target (diff) | |
download | tgif-899062438f47189cdcc3f5d3b3185eb4cfd798a7.tar.xz |
Makefile: normalize clobbering & xargs for tags targets
Since the "tags", "TAGS" and "cscope.out" targets rely on piping into
xargs with an "echo <list> | xargs" pattern, we need to make sure
we're in an append mode.
Unlike my recent change to make use of ".DELETE_ON_ERROR" in
7b76d6bf221 (Makefile: add and use the ".DELETE_ON_ERROR" flag,
2021-06-29), we really do need the "rm $@+" at the beginning (note,
not "rm $@").
This is because the xargs command may decide to invoke the program
multiple times. We need to make sure we've got a union of its results
at the end.
For "ctags" and "etags" we used the "-a" flag for this, for cscope
that behavior is the default. Its "-u" flag disables its equivalent of
an implicit "-a" flag.
Let's also consistently use the $@ and $@+ names instead of needlessly
hardcoding or referring to more verbose names in the "tags" and "TAGS"
rules.
These targets could perhaps be improved in the future by factoring
this "echo <list> | xargs" pattern so that we make intermediate tags
files for each source file, and then assemble them into one "tags"
file at the end.
The etags manual page suggests that doing that (or perhaps just
--update) might be counter-productive, in any case, the tag building
is fast enough for me, so I'm leaving that for now.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6005-rev-list-count.sh')
0 files changed, 0 insertions, 0 deletions