summaryrefslogtreecommitdiff
path: root/usr/include
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2026-03-16 17:51:58 +0100
committerNicolas Schier <nsc@kernel.org>2026-03-25 13:24:40 +0100
commit55d68ec5b9ba004764acaa3291871513102b4fd4 (patch)
tree1b4465014261611a2c38798354b16c1b21d4cdc6 /usr/include
parentbb25b5635e90e33c8c1c4ef231d4d7351c06be49 (diff)
kbuild: uapi: move some compiler arguments out of the command definition
Simplify the definition of cmd_hdrtest by moving some of it to a new variable. This will both enable the upcoming reuse of those flags and also the extension of cmd_hdrtest. Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Link: https://patch.msgid.link/20260316-kbuild-uapi-c-v2-1-35d6d0ed863f@weissschuh.net Signed-off-by: Nicolas Schier <nsc@kernel.org>
Diffstat (limited to 'usr/include')
-rw-r--r--usr/include/Makefile6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr/include/Makefile b/usr/include/Makefile
index 845d06b63c2b..0b1c9a4b0477 100644
--- a/usr/include/Makefile
+++ b/usr/include/Makefile
@@ -140,11 +140,13 @@ always-y := $(patsubst $(obj)/%.h,%.hdrtest, $(shell find $(obj) -name '*.h' 2>/
target-libc = $(filter $(uses-libc), $*.h)
target-can-compile = $(filter-out $(no-header-test), $*.h)
+hdrtest-flags = -fsyntax-only -Werror \
+ -nostdinc $(if $(target-libc), -I $(srctree)/usr/dummy-include)
+
# Include the header twice to detect missing include guard.
quiet_cmd_hdrtest = HDRTEST $<
cmd_hdrtest = \
- $(CC) $(c_flags) -fsyntax-only -Werror -x c /dev/null \
- -nostdinc $(if $(target-libc), -I $(srctree)/usr/dummy-include) \
+ $(CC) $(c_flags) $(hdrtest-flags) -x c /dev/null \
$(if $(target-can-compile), -include $< -include $<); \
$(PERL) $(src)/headers_check.pl $(obj) $<; \
touch $@