'make syncconfig' creates some files such as include/config/auto.conf,
include/generate/autoconf.h, etc. but the necessary directory creation
relies on scripts/kconfig/Makefile.
To make Kconfig self-contained, create directories as needed in
conf_write_autoconf().
This change allows scripts/kconfig/Makefile cleanups; syncconfig can
be merged into simple-targets.
Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
fprintf(out, "\n$(deps_config): ;\n");
fclose(out);
fprintf(out, "\n$(deps_config): ;\n");
fclose(out);
+
+ if (make_parent_dir(name))
+ return 1;
rename("..config.tmp", name);
return 0;
}
rename("..config.tmp", name);
return 0;
}
conf_read_simple(name, S_DEF_AUTO);
sym_calc_value(modules_sym);
conf_read_simple(name, S_DEF_AUTO);
sym_calc_value(modules_sym);
+ if (make_parent_dir("include/generated/foo.h"))
+ return 1;
if (chdir("include/generated"))
return 1;
if (chdir("include/generated"))
return 1;
/* Try it again. */
fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (fd == -1) {
/* Try it again. */
fd = open(path, O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (fd == -1) {
name = getenv("KCONFIG_AUTOHEADER");
if (!name)
name = "include/generated/autoconf.h";
name = getenv("KCONFIG_AUTOHEADER");
if (!name)
name = "include/generated/autoconf.h";
+ if (make_parent_dir(name))
+ return 1;
if (rename(".tmpconfig.h", name))
return 1;
if (rename(".tmpconfig.h", name))
return 1;
name = getenv("KCONFIG_TRISTATE");
if (!name)
name = "include/generated/tristate.conf";
name = getenv("KCONFIG_TRISTATE");
if (!name)
name = "include/generated/tristate.conf";
+ if (make_parent_dir(name))
+ return 1;
if (rename(".tmpconfig_tristate", name))
return 1;
if (rename(".tmpconfig_tristate", name))
return 1;
name = getenv("KCONFIG_CMAKE");
if (!name)
name = "config.cmake";
name = getenv("KCONFIG_CMAKE");
if (!name)
name = "config.cmake";
+ if (make_parent_dir(name))
+ return 1;
if (rename(".tmpconfig.cmake", name))
return 1;
if (rename(".tmpconfig.cmake", name))
return 1;
name = conf_get_autoconfig_name();
name = conf_get_autoconfig_name();
+ if (make_parent_dir(name))
+ return 1;
+
/*
* This must be the last step, kbuild has a dependency on auto.conf
* and this marks the successful completion of the previous steps.
/*
* This must be the last step, kbuild has a dependency on auto.conf
* and this marks the successful completion of the previous steps.