kbuild: set KBUILD_MODULES=1 all the time for single target %/
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 14 Feb 2019 03:05:16 +0000 (12:05 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Wed, 20 Feb 2019 00:42:46 +0000 (09:42 +0900)
It is fine to set KBUILD_MODULES=1 when CONFIG_MODULES is disabled.
It is actually how "make allnoconfig all" works.

On the other hand, KBUILD_MODULES=1 is unneeded for the %.ko pattern.
It is just a matter of whether modules.order is generated or not.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Makefile

index 660e10a..cacb751 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1716,16 +1716,13 @@ endif
 
 # Modules
 /: prepare FORCE
-       $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
-       $(build)=$(build-dir)
+       $(Q)$(MAKE) KBUILD_MODULES=1 $(build)=$(build-dir)
 # Make sure the latest headers are built for Documentation
 Documentation/ samples/: headers_install
 %/: prepare FORCE
-       $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
-       $(build)=$(build-dir)
+       $(Q)$(MAKE) KBUILD_MODULES=1 $(build)=$(build-dir)
 %.ko: prepare FORCE
-       $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1)   \
-       $(build)=$(build-dir) $(@:.ko=.o)
+       $(Q)$(MAKE) $(build)=$(build-dir) $(@:.ko=.o)
        $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
 
 # FIXME Should go into a make.lib or something