summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Ævar Arnfjörð Bjarmason <avarab@gmail.com>2021-08-05 00:54:39 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-08-05 09:31:15 -0700
commit530a446d4ac81c722a81d8d08883be27a17ad8aa (patch)
treedebc2c546a71a61138532357904ebcd1f6b2aef3
parentMakefile: don't use "FORCE" for tags targets (diff)
downloadtgif-530a446d4ac81c722a81d8d08883be27a17ad8aa.tar.xz
Makefile: remove "cscope.out", not "cscope*" in cscope.out target
Before we generate a "cscope.out" file, remove that file explicitly, and not everything matching "cscope*". This doesn't change any behavior of the Makefile in practice, but makes this rule less confusing, and consistent with other similar rules. The cscope target was added in a2a9150bf06 (makefile: Add a cscope target, 2007-10-06). It has always referred to cscope* instead of to cscope.out in .gitignore and the "clean" target, even though we only ever generated a cscope.out file. This was seemingly done to aid use-cases where someone invoked cscope with the "-q" flag, which would make it create a "cscope.in.out" and "cscope.po.out" files in addition to "cscope.out". But us removing those files we never generated is confusing, so let's only remove the file we need to, furthermore let's use the "-f" flag to explicitly name the cscope.out file, even though it's the default if not "-f" argument is supplied. It is somewhat inconsistent to change from the glob here but not in the "clean" rule and .gitignore, an earlier version of this change updated those as well, but see [1][2] for why they were kept. 1. https://lore.kernel.org/git/87k0lit57x.fsf@evledraar.gmail.com/ 2. https://lore.kernel.org/git/87im0kn983.fsf@evledraar.gmail.com/ Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 55d0a98dc6..b3e2c7dc7a 100644
--- a/Makefile
+++ b/Makefile
@@ -2740,8 +2740,8 @@ tags: $(FOUND_SOURCE_FILES)
mv tags+ tags
cscope.out: $(FOUND_SOURCE_FILES)
- $(QUIET_GEN)$(RM) cscope* && \
- echo $(FOUND_SOURCE_FILES) | xargs cscope -b
+ $(QUIET_GEN)$(RM) $@ && \
+ echo $(FOUND_SOURCE_FILES) | xargs cscope -f$@ -b
.PHONY: cscope
cscope: cscope.out