summaryrefslogtreecommitdiff
path: root/scripts/kconfig/parser.y
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2024-02-03 00:58:05 +0900
committerMasahiro Yamada <masahiroy@kernel.org>2024-02-19 18:20:40 +0900
commit56e634b06fd554b819ac9c45fc77a41500861ced (patch)
treeda7da38591efbae297cd7eb9baa6d279abbf3256 /scripts/kconfig/parser.y
parent526396b723a38dbeed35cb9e80814084b9f56329 (diff)
kconfig: call env_write_dep() right after yyparse()
This allows preprocess.c to free up all of its resources when the parse stage is finished. It also ensures conf_write_autoconf_cmd() produces consistent results even if called multiple times for any reason. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Diffstat (limited to 'scripts/kconfig/parser.y')
-rw-r--r--scripts/kconfig/parser.y9
1 files changed, 8 insertions, 1 deletions
diff --git a/scripts/kconfig/parser.y b/scripts/kconfig/parser.y
index 611038c502fc..cfb82ba09037 100644
--- a/scripts/kconfig/parser.y
+++ b/scripts/kconfig/parser.y
@@ -482,7 +482,7 @@ void conf_parse(const char *name)
autoconf_cmd = str_new();
- str_printf(&autoconf_cmd, "deps_config := \\\n");
+ str_printf(&autoconf_cmd, "\ndeps_config := \\\n");
zconf_initscan(name);
@@ -492,6 +492,13 @@ void conf_parse(const char *name)
yydebug = 1;
yyparse();
+ str_printf(&autoconf_cmd,
+ "\n"
+ "$(autoconfig): $(deps_config)\n"
+ "$(deps_config): ;\n");
+
+ env_write_dep(&autoconf_cmd);
+
/* Variables are expanded in the parse phase. We can free them here. */
variable_all_del();