makefile/meson: add 'check-headers' as alias for 'hdr-check'
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>
Karthik Nayak committed
Apr 23, 2025 at 10:15 UTC
04a13ed8a7c07ef383f19adc16494ec481960bdb
3 files changed
+7
-3
Makefile
+3
-1
@@ -3326,8 +3326,10 @@ HCC = $(HCO:hco=hcc)
3326
$(HCO): %.hco: %.hcc $(GENERATED_H) FORCE
3327
$(QUIET_HDR)$(CC) $(ALL_CFLAGS) -o /dev/null -c -xc $<
3328
3329
-.PHONY: hdr-check $(HCO)
3329
+# TODO: deprecate 'hdr-check' in lieu of 'check-headers' in Git 2.51+
3330
+.PHONY: hdr-check check-headers $(HCO)
3331
hdr-check: $(HCO)
3332
+check-headers: hdr-check
3333
3334
.PHONY: style
3335
style:
ci/run-static-analysis.sh
+1
-1
@@ -26,7 +26,7 @@ then
26
exit 1
27
fi
28
29
-make hdr-check ||
29
+make check-headers ||
30
exit 1
31
32
make check-pot
meson.build
+3
-1
@@ -2054,7 +2054,9 @@ if headers_to_check.length() != 0 and compiler.get_argument_syntax() == 'gcc'
2054
hco_targets += hco
2055
endforeach
2056
2057
- alias_target('hdr-check', hco_targets)
2057
+ # TODO: deprecate 'hdr-check' in lieu of 'check-headers' in Git 2.51+
2058
+ hdr_check = alias_target('hdr-check', hco_targets)
2059
+ alias_target('check-headers', hdr_check)
2060
endif
2061
2062
foreach key, value : {