summaryrefslogtreecommitdiff
path: root/scripts/kconfig/conf.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig/conf.c')
-rw-r--r--scripts/kconfig/conf.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c
index 5af899112cae..b35cc9303979 100644
--- a/scripts/kconfig/conf.c
+++ b/scripts/kconfig/conf.c
@@ -686,29 +686,32 @@ int main(int ac, char **av)
break;
}
- if (sync_kconfig) {
- /* syncconfig is used during the build so we shall update autoconf.
- * All other commands are only used to generate a config.
- */
- if (!no_conf_write && conf_write(NULL)) {
- fprintf(stderr, "\n*** Error during writing of the configuration.\n\n");
- exit(1);
- }
- if (conf_write_autoconf()) {
- fprintf(stderr, "\n*** Error during update of the configuration.\n\n");
- return 1;
- }
- } else if (input_mode == savedefconfig) {
+ if (input_mode == savedefconfig) {
if (conf_write_defconfig(defconfig_file)) {
fprintf(stderr, "n*** Error while saving defconfig to: %s\n\n",
defconfig_file);
return 1;
}
} else if (input_mode != listnewconfig) {
- if (conf_write(NULL)) {
+ if (!no_conf_write && conf_write(NULL)) {
fprintf(stderr, "\n*** Error during writing of the configuration.\n\n");
exit(1);
}
+
+ /*
+ * Create auto.conf if it does not exist.
+ * This prevents GNU Make 4.1 or older from emitting
+ * "include/config/auto.conf: No such file or directory"
+ * in the top-level Makefile
+ *
+ * syncconfig always creates or updates auto.conf because it is
+ * used during the build.
+ */
+ if (conf_write_autoconf(sync_kconfig) && sync_kconfig) {
+ fprintf(stderr,
+ "\n*** Error during sync of the configuration.\n\n");
+ return 1;
+ }
}
return 0;
}