]> git.ipfire.org Git - thirdparty/git.git/commit
Makefile: emulate compile in $(HCO) target better
authorDenton Liu <liu.denton@gmail.com>
Wed, 25 Sep 2019 08:21:01 +0000 (01:21 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 28 Sep 2019 05:04:22 +0000 (14:04 +0900)
commitb503a2d515e6ac3d2cced7881791c12663c45d01
tree9fcba0f80078552a3e0f67cb7c71259e92600bd5
parentaf26e2a9d265c7ad676e3b178c359a0ff75440a2
Makefile: emulate compile in $(HCO) target better

Currently, when testing headers using `make hdr-check`, headers are
directly compiled. Although this seems to test the headers, this is too
strict since we treat the headers as C sources. As a result, this will
cause warnings to appear that would otherwise not, such as a static
variable definition intended for later use throwing a unused variable
warning.

In addition, on platforms that can run `make hdr-check` but require
custom flags, this target was failing because none of them were being
passed to the compiler. For example, on MacOS, the NO_OPENSSL flag was
being set but it was not being passed into compiler so the check was
failing.

Fix these problems by emulating the compile process better, including
test compiling dummy *.hcc C sources generated from the *.h files and
passing $(ALL_CFLAGS) into the compiler for the $(HCO) target so that
these custom flags can be used.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
.gitignore
Makefile