kbuild: fix build error of 'make nsdeps' in clean tree
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 3 Oct 2019 07:58:24 +0000 (16:58 +0900)
committerJessica Yu <jeyu@kernel.org>
Mon, 7 Oct 2019 16:25:13 +0000 (18:25 +0200)
Running 'make nsdeps' in a clean source tree fails as follows:

$ make -s clean; make -s defconfig; make nsdeps
   [ snip ]
awk: fatal: cannot open file `init/modules.order' for reading (No such file or directory)
make: *** [Makefile;1307: modules.order] Error 2
make: *** Deleting file 'modules.order'
make: *** Waiting for unfinished jobs....

The cause of the error is 'make nsdeps' does not build modules at all.
Set KBUILD_MODULES to fix it.

Reviewed-by: Matthias Maennich <maennich@google.com>
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Jessica Yu <jeyu@kernel.org>
Makefile

index 6f54f2f9574311301a8c59b2e8565dd5bebeb197..d97f38ad5d9ff953de64583586c3e1e6835dc877 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -616,7 +616,7 @@ endif
 # in addition to whatever we do anyway.
 # Just "make" or "make all" shall build modules as well
 
-ifneq ($(filter all _all modules,$(MAKECMDGOALS)),)
+ifneq ($(filter all _all modules nsdeps,$(MAKECMDGOALS)),)
   KBUILD_MODULES := 1
 endif