Skip to content

Commit 530a446

Browse files
avargitster
authored andcommitted
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 a2a9150 (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/[email protected]/ 2. https://lore.kernel.org/git/[email protected]/ Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 7171221 commit 530a446

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2740,8 +2740,8 @@ tags: $(FOUND_SOURCE_FILES)
27402740
mv tags+ tags
27412741

27422742
cscope.out: $(FOUND_SOURCE_FILES)
2743-
$(QUIET_GEN)$(RM) cscope* && \
2744-
echo $(FOUND_SOURCE_FILES) | xargs cscope -b
2743+
$(QUIET_GEN)$(RM) $@ && \
2744+
echo $(FOUND_SOURCE_FILES) | xargs cscope -f$@ -b
27452745

27462746
.PHONY: cscope
27472747
cscope: cscope.out

0 commit comments

Comments
 (0)