From 4ac85d9bc73ed38a3bf98a58f9a44087375332b4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Tue, 23 Dec 2025 08:04:11 +0100 Subject: [PATCH] kbuild: uapi: split out command conditions into variables MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The condition logic will become a bit more complicated. Split them out into dedicated variables so they stay readable. Signed-off-by: Thomas Weißschuh Link: https://patch.msgid.link/20251223-uapi-nostdinc-v1-4-d91545d794f7@linutronix.de Signed-off-by: Nathan Chancellor --- usr/include/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr/include/Makefile b/usr/include/Makefile index fd29c11c35cbd..fa01bcda21f52 100644 --- a/usr/include/Makefile +++ b/usr/include/Makefile @@ -150,12 +150,15 @@ endif always-y := $(patsubst $(obj)/%.h,%.hdrtest, $(shell find $(obj) -name '*.h' 2>/dev/null)) +target-no-libc = $(filter-out $(uses-libc), $*.h) +target-can-compile = $(filter-out $(no-header-test), $*.h) + # 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 \ - $(if $(filter-out $(uses-libc), $*.h), -nostdinc) \ - $(if $(filter-out $(no-header-test), $*.h), -include $< -include $<); \ + $(if $(target-no-libc), -nostdinc) \ + $(if $(target-can-compile), -include $< -include $<); \ $(PERL) $(src)/headers_check.pl $(obj) $<; \ touch $@ -- 2.47.3