[PATCH 4/5] kbuild: uapi: split out command conditions into variables

Thomas Weißschuh <[email protected]>
Newsgroups org.kernel.vger.linux-hexagon,org.kernel.vger.bpf,org.kernel.vger.linux-kbuild,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
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 <[email protected]>
---
 usr/include/Makefile | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/usr/include/Makefile b/usr/include/Makefile
index fd29c11c35cb..fa01bcda21f5 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.52.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.