mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:04:41 +01:00
kbuild: uapi: split out command conditions into variables
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 <thomas.weissschuh@linutronix.de> Link: https://patch.msgid.link/20251223-uapi-nostdinc-v1-4-d91545d794f7@linutronix.de Signed-off-by: Nathan Chancellor <nathan@kernel.org>
This commit is contained in:
parent
e2772ba5f4
commit
4ac85d9bc7
1 changed files with 5 additions and 2 deletions
|
|
@ -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 $@
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue