]> git.ipfire.org Git - thirdparty/git.git/commit
Makefile: fix sparse dependency on GENERATED_H
authorPatrick Steinhardt <ps@pks.im>
Wed, 4 Sep 2024 14:17:04 +0000 (16:17 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 4 Sep 2024 15:41:37 +0000 (08:41 -0700)
commit11c1b5ca594359c1a8c2fa890d880615b8cf0e29
treef265214615caa0eebcb45f31e1b77cbde05d919d
parentfe7066a9d97bb2546a717911bbda6c43bf02087a
Makefile: fix sparse dependency on GENERATED_H

The "check" Makefile target is essentially an alias around the "sparse"
target. The one difference though is that it will tell users to instead
run the "test" target in case they do not have sparse(1) installed, as
chances are high that they wanted to execute the test suite rather than
doing semantic checks.

But even though the "check" target ultimately just ends up executing
`make sparse`, it still depends on our generated headers. This does not
make any sense though: they are irrelevant for the "test" target advice,
and if these headers are required for the "sparse" target they must be
declared as a dependency on the aliased target, not the alias.

But even moving the dependency to the "sparse" target is wrong, as
concurrent builds may then end up generating the headers and running
sparse concurrently. Instead, we make them a dependency of the specific
objects. While that is overly broad, it does ensure correct ordering.
The alternative, specifying which file depends on what generated header
explicitly, feels rather unmaintainable.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile