kbuild: use 'include' directive to load auto.conf from top Makefile
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 20 Jul 2018 07:46:32 +0000 (16:46 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Wed, 25 Jul 2018 14:25:31 +0000 (23:25 +0900)
commit0a16d2e8cb7e6310debc208d42ff725361ae1911
tree6885bc6aa40310214934338cb346720036dac84b
parent00c864f8903dd357471e8ee48f4d57aaa9a1a0de
kbuild: use 'include' directive to load auto.conf from top Makefile

When you build targets that require the kernel configuration, dot-config
is set to 1, then the top-level Makefile includes auto.conf.  However,
Make considers its inclusion is optional because the '-include' directive
is used here.

If a necessary configuration file is missing for the external module
building, the following error message is displayed:

  ERROR: Kernel configuration is invalid.
         include/generated/autoconf.h or include/config/auto.conf are missing.
         Run 'make oldconfig && make prepare' on kernel src to fix it.

However, Make still continues building; /bin/false let the creation of
'include/config/auto.config' fail, but Make can ignore the error since
it is included by the '-include' directive.

I guess the reason of using '-include' directive was to suppress
the warning when you build the kernel from a pristine source tree:

  Makefile:605: include/config/auto.conf: No such file or directory

The previous commit made sure include/config/auto.conf exists after
the 'make *config' stage.  Now, we can use the 'include' directive
without showing the warning.

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