]> git.ipfire.org Git - thirdparty/git.git/commitdiff
makefile/meson: add 'check-headers' as alias for 'hdr-check'
authorKarthik Nayak <karthik.188@gmail.com>
Wed, 23 Apr 2025 08:15:39 +0000 (10:15 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 23 Apr 2025 17:36:42 +0000 (10:36 -0700)
The 'hdr-check' target in Meson and makefile is used to check if headers
can be compiled individually. The naming however isn't readable as 'hdr'
is not a common shortforme for 'header', neither is it an abbreviation.

Let's introduce 'check-headers' as an alternative target for 'hdr-check'
and add a `TODO` to deprecate the latter after 2 releases. Since this
is an internal tool, we can use a shorter deprecation cycle.

Change existing usage of 'hdr-check' in 'ci/run-static-analysis.sh' to
also use 'check-headers'.

Signed-off-by: Karthik Nayak <karthik.188@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile
ci/run-static-analysis.sh
meson.build

index ac32d2d0bdae93b6065aaf20efb27c3380f91e63..961ee508be37c42130948d00834c5f1e080f7b4c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -3326,8 +3326,10 @@ HCC = $(HCO:hco=hcc)
 $(HCO): %.hco: %.hcc $(GENERATED_H) FORCE
        $(QUIET_HDR)$(CC) $(ALL_CFLAGS) -o /dev/null -c -xc $<
 
-.PHONY: hdr-check $(HCO)
+# TODO: deprecate 'hdr-check' in lieu of 'check-headers' in Git 2.51+
+.PHONY: hdr-check check-headers $(HCO)
 hdr-check: $(HCO)
+check-headers: hdr-check
 
 .PHONY: style
 style:
index 0d51e5ce0e7cb42e0101df607c925ccd066d4433..60c175a094331d17a18d3cc7425b0dcb4898a838 100755 (executable)
@@ -26,7 +26,7 @@ then
        exit 1
 fi
 
-make hdr-check ||
+make check-headers ||
 exit 1
 
 make check-pot
index 22fc65ec80ba6a840186a53393bce8663c26e2ab..569e3888fb2d0b80519e8925cab306b6e28e513f 100644 (file)
@@ -2054,7 +2054,9 @@ if headers_to_check.length() != 0 and compiler.get_argument_syntax() == 'gcc'
     hco_targets += hco
   endforeach
 
-  alias_target('hdr-check', hco_targets)
+  # TODO: deprecate 'hdr-check' in lieu of 'check-headers' in Git 2.51+
+  hdr_check = alias_target('hdr-check', hco_targets)
+  alias_target('check-headers', hdr_check)
 endif
 
 foreach key, value : {