kbuild: clear KBUILD_MODULES in top Makefile if CONFIG_MODULES=n
authorMasahiro Yamada <masahiroy@kernel.org>
Fri, 22 May 2020 01:59:59 +0000 (10:59 +0900)
committerMasahiro Yamada <masahiroy@kernel.org>
Mon, 25 May 2020 15:03:16 +0000 (00:03 +0900)
Do not try to build any module-related artifacts when CONFIG_MODULES
is disabled.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Makefile
scripts/Makefile.build

index 1f5bbfb31103306b8330a6af4148970a1bed302f..72eb55a365451f72bf0404f7cb894d17555a35ad 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1724,6 +1724,10 @@ build-dirs := $(foreach d, $(build-dirs), \
 
 endif
 
+ifndef CONFIG_MODULES
+KBUILD_MODULES :=
+endif
+
 # Handle descending into subdirectories listed in $(build-dirs)
 # Preset locale variables to speed up the build process. Limit locale
 # tweaks to this spot to avoid wrong language settings when running
index 9af88f4cacb894230b6ec0d9ce72b86c3189638e..f46d25441804bb8f99fac64c494a283d35fec6f2 100644 (file)
@@ -77,7 +77,7 @@ ifdef need-builtin
 builtin-target := $(obj)/built-in.a
 endif
 
-ifeq ($(CONFIG_MODULES)$(need-modorder),y1)
+ifdef need-modorder
 modorder-target := $(obj)/modules.order
 endif