Re: [PATCH 2/3] Makefile: fix "cscope" target to refer to cscope.out
- From
Jeff King <peff@peff.net>
- Date
- Jun 22, 2021, 19:25 UTC
- Message-ID
- <YNI5KVGT2mLlTrnz@coredump.intra.peff.net>
- In-Reply-To
- <patch-2.3-ea39f1f5cd2-20210622T141844Z-avarab@gmail.com>
On Tue, Jun 22, 2021 at 04:21:26PM +0200, Ævar Arnfjörð Bjarmason wrote:
Show 8 quoted lines
> The cscope target added in a2a9150bf06 (makefile: Add a cscope target, > 2007-10-06) has for some reason been referring to cscope* instead of > cscope.out. Let's generate the cscope.out file directly so we don't > need to speculate. > > The "-fcscope.out" (note, no whitespace) argument is enabled by > default on my system's cscope 15.9, but let's provide it explicitly > for good measure.
I don't use cscope myself, but it can generate other files (e.g., with "-q"). It looks like we don't even allow people to set $(CSCOPE), though, so that shouldn't ever happen.
(I wonder if anybody even really uses cscope. I wanted to love it as a better form of ctags, but I have always found it so baroque and complicated that it ends up being a waste of my time to try it).
Show 8 quoted lines
> +cscope.out: > + $(FIND_SOURCE_FILES) | xargs cscope -f$@ -b > + > .PHONY: cscope > -cscope: > - $(RM) cscope* > - $(FIND_SOURCE_FILES) | xargs cscope -b > +cscope: cscope.out
This drops the $(RM). Does cscope always overwrite the output file, or does it append? Just trying "cscope -b foo.c; cscope -b bar.c", it looks like it overwrites. Which makes your patch correct, but that existing "xargs" is somewhat questionable (if it splits into two commands, the first half will get dropped).
-Peff