# arch/x86/kernel/Makefile
extra-y += vmlinux.lds
+extra-y is now deprecated because this is equivalent to:
+
+ always-$(KBUILD_BUILTIN) += vmlinux.lds
+
$(extra-y) should only contain targets needed for vmlinux.
Kbuild skips extra-y when vmlinux is apparently not a final goal.
# 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)
# 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
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
# 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
# *.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
# We are always building only modules.
KBUILD_BUILTIN :=
-KBUILD_MODULES := 1
+KBUILD_MODULES := y
build-dir := .
single-goals := $(addprefix $(build-dir)/, $(single-no-ko))
-KBUILD_MODULES := 1
+KBUILD_MODULES := y
endif