kbuild: move ".config not found!" message from Kconfig to Makefile
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Fri, 22 Feb 2019 07:40:11 +0000 (16:40 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Wed, 27 Feb 2019 13:25:10 +0000 (22:25 +0900)
If you run "make" in a pristine source tree, currently Kbuild will
start to build Kconfig to let it show the error message.

It would be more straightforward to check it in Makefile and let
it fail immediately.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Makefile
scripts/kconfig/conf.c

index 0f438aaeb6e7e23e2b8d2f947d119adda30edf20..0e1f6c3f00a26a9bf06f26e64e6b5b1a466c66da 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -628,8 +628,14 @@ ifeq ($(may-sync-config),1)
 # because some architectures define CROSS_COMPILE there.
 -include include/config/auto.conf.cmd
 
-# To avoid any implicit rule to kick in, define an empty command
-$(KCONFIG_CONFIG): ;
+$(KCONFIG_CONFIG):
+       @echo >&2 '***'
+       @echo >&2 '*** Configuration file "$@" not found!'
+       @echo >&2 '***'
+       @echo >&2 '*** Please run some configurator (e.g. "make oldconfig" or'
+       @echo >&2 '*** "make menuconfig" or "make xconfig").'
+       @echo >&2 '***'
+       @/bin/false
 
 # The actual configuration files used during the build are stored in
 # include/generated/ and include/config/. Update them if .config is newer than
index da89ef788a8d73f7683c058341ab5c7f822c2e59..ef3678c24babaf506b724e73d1f67a2d7f546661 100644 (file)
@@ -488,7 +488,6 @@ int main(int ac, char **av)
        const char *progname = av[0];
        int opt;
        const char *name, *defconfig_file = NULL /* gcc uninit */;
-       struct stat tmpstat;
        int no_conf_write = 0;
 
        tty_stdio = isatty(0) && isatty(1);
@@ -560,18 +559,6 @@ int main(int ac, char **av)
        name = av[optind];
        conf_parse(name);
        //zconfdump(stdout);
-       if (sync_kconfig) {
-               name = conf_get_configname();
-               if (stat(name, &tmpstat)) {
-                       fprintf(stderr, "***\n"
-                               "*** Configuration file \"%s\" not found!\n"
-                               "***\n"
-                               "*** Please run some configurator (e.g. \"make oldconfig\" or\n"
-                               "*** \"make menuconfig\" or \"make xconfig\").\n"
-                               "***\n", name);
-                       exit(1);
-               }
-       }
 
        switch (input_mode) {
        case defconfig: