]> git.ipfire.org Git - thirdparty/git.git/commit
Makefile: have "coccicheck" re-run if flags change
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 1 Nov 2022 22:35:46 +0000 (23:35 +0100)
committerTaylor Blau <me@ttaylorr.com>
Thu, 3 Nov 2022 01:22:16 +0000 (21:22 -0400)
commit09d9a69e31f2249ba8500250b9bc3ba532685126
tree52f7753dd3dc750e13652f85b7f4c3633ebd2146
parente603a140aed8fc362320d949bfc0b47adcefc32f
Makefile: have "coccicheck" re-run if flags change

Fix an issue with the "coccicheck" family of rules that's been here
since 63f0a758a06 (add coccicheck make target, 2016-09-15), unlike
e.g. "make grep.o" we wouldn't re-run it when $(SPATCH) or
$(SPATCH_FLAGS) changed. To test new flags we needed to first do a
"make cocciclean".

This now uses the same (copy/pasted) pattern as other "DEFINES"
rules. As a result we'll re-run properly. This can be demonstrated
e.g. on the issue noted in [1]:

$ make contrib/coccinelle/xcalloc.cocci.patch COCCI_SOURCES=promisor-remote.c V=1
[...]
    SPATCH contrib/coccinelle/xcalloc.cocci
$ make contrib/coccinelle/xcalloc.cocci.patch COCCI_SOURCES=promisor-remote.c SPATCH_FLAGS="--all-includes --recursive-includes"
    * new spatch flags
    SPATCH contrib/coccinelle/xcalloc.cocci
     SPATCH result: contrib/coccinelle/xcalloc.cocci.patch
$

1. https://lore.kernel.org/git/20220823095602.GC1735@szeder.dev/

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
.gitignore
Makefile