]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Makefile: make hdr-check depend on generated headers
authorPatrick Steinhardt <ps@pks.im>
Wed, 4 Sep 2024 14:17:06 +0000 (16:17 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 4 Sep 2024 15:41:37 +0000 (08:41 -0700)
The "hdr-check" Makefile target compiles each of our headers as a
standalone code unit to ensure that they are not missing any type
declarations and can be included standalone.

With the next commit we will wire up the clar unit testing framework,
which will have the effect that some headers start depending on
generated ones. While we could declare that dependency explicitly, it
does not really feel very maintainable in the future.

Instead, we do the same as in the preceding commit and have the objects
depend on all of our generated headers. While again overly broad, it is
easy to maintain and generating headers is not an expensive thing to do
anyway.

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

index efd305ab3580ab4d2c2d4f057186de60ef104f1f..8c4487dd0c608580d9d12ae72f575c62956b5805 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3284,7 +3284,7 @@ HCC = $(HCO:hco=hcc)
        @echo '#include "git-compat-util.h"' >$@
        @echo '#include "$<"' >>$@
 
-$(HCO): %.hco: %.hcc FORCE
+$(HCO): %.hco: %.hcc $(GENERATED_H) FORCE
        $(QUIET_HDR)$(CC) $(ALL_CFLAGS) -o /dev/null -c -xc $<
 
 .PHONY: hdr-check $(HCO)