aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2025-06-03 03:12:53 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2025-06-07 14:37:50 +0900
commit1bf807b8f7e0eada62007f9f1966f3d22329eef9 (patch)
treee61387c6b92f9bd9631b881d26a2684da1b05f6c /Makefile
parentefi/libstub: use 'targets' instead of extra-y in Makefile (diff)
downloadlinux-rng-1bf807b8f7e0eada62007f9f1966f3d22329eef9.tar.xz
linux-rng-1bf807b8f7e0eada62007f9f1966f3d22329eef9.zip
kbuild: set y instead of 1 to KBUILD_{BUILTIN,MODULES}
KBUILD_BUILTIN is set to 1 unless you are building only modules. KBUILD_MODULES is set to 1 when you are building only modules (a typical use case is "make modules"). It is more useful to set them to 'y' instead, so we can do something like: always-$(KBUILD_BUILTIN) += vmlinux.lds This works equivalently to: extra-y += vmlinux.lds This allows us to deprecate extra-y. extra-y and always-y are quite similar, and we do not need both. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nathan Chancellor <nathan@kernel.org> Reviewed-by: Nicolas Schier <n.schier@avm.de>
Diffstat (limited to '')
-rw-r--r--Makefile16
1 files changed, 8 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index fe2f1cb4d9b7..e07692d485e6 100644
--- a/Makefile
+++ b/Makefile
@@ -749,7 +749,7 @@ targets :=
# Normally, just do built-in.
KBUILD_MODULES :=
-KBUILD_BUILTIN := 1
+KBUILD_BUILTIN := y
# If we have only "make modules", don't compile built-in objects.
ifeq ($(MAKECMDGOALS),modules)
@@ -761,11 +761,11 @@ endif
# Just "make" or "make all" shall build modules as well
ifneq ($(filter all modules nsdeps compile_commands.json clang-%,$(MAKECMDGOALS)),)
- KBUILD_MODULES := 1
+ KBUILD_MODULES := y
endif
ifeq ($(MAKECMDGOALS),)
- KBUILD_MODULES := 1
+ KBUILD_MODULES := y
endif
export KBUILD_MODULES KBUILD_BUILTIN
@@ -1193,7 +1193,7 @@ export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds
ifdef CONFIG_TRIM_UNUSED_KSYMS
# For the kernel to actually contain only the needed exported symbols,
# we have to build modules as well to determine what those symbols are.
-KBUILD_MODULES := 1
+KBUILD_MODULES := y
endif
# '$(AR) mPi' needs 'T' to workaround the bug of llvm-ar <= 14
@@ -1533,7 +1533,7 @@ all: modules
# the built-in objects during the descend as well, in order to
# make sure the checksums are up to date before we record them.
ifdef CONFIG_MODVERSIONS
- KBUILD_BUILTIN := 1
+ KBUILD_BUILTIN := y
endif
# Build modules
@@ -1542,7 +1542,7 @@ endif
# *.ko are usually independent of vmlinux, but CONFIG_DEBUG_INFO_BTF_MODULES
# is an exception.
ifdef CONFIG_DEBUG_INFO_BTF_MODULES
-KBUILD_BUILTIN := 1
+KBUILD_BUILTIN := y
modules: vmlinux
endif
@@ -1858,7 +1858,7 @@ filechk_kernel.release = echo $(KERNELRELEASE)
# We are always building only modules.
KBUILD_BUILTIN :=
-KBUILD_MODULES := 1
+KBUILD_MODULES := y
build-dir := .
@@ -1986,7 +1986,7 @@ endif
single-goals := $(addprefix $(build-dir)/, $(single-no-ko))
-KBUILD_MODULES := 1
+KBUILD_MODULES := y
endif