aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/kconfig/util.c')
-rw-r--r--scripts/kconfig/util.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/scripts/kconfig/util.c b/scripts/kconfig/util.c
index e1cad924c0a4..f8e73c039dc8 100644
--- a/scripts/kconfig/util.c
+++ b/scripts/kconfig/util.c
@@ -29,6 +29,8 @@ struct file *file_lookup(const char *name)
29/* write a dependency file as used by kbuild to track dependencies */ 29/* write a dependency file as used by kbuild to track dependencies */
30int file_write_dep(const char *name) 30int file_write_dep(const char *name)
31{ 31{
32 struct symbol *sym, *env_sym;
33 struct expr *e;
32 struct file *file; 34 struct file *file;
33 FILE *out; 35 FILE *out;
34 36
@@ -45,8 +47,25 @@ int file_write_dep(const char *name)
45 fprintf(out, "\t%s\n", file->name); 47 fprintf(out, "\t%s\n", file->name);
46 } 48 }
47 fprintf(out, "\ninclude/config/auto.conf: \\\n" 49 fprintf(out, "\ninclude/config/auto.conf: \\\n"
48 "\t$(deps_config)\n\n" 50 "\t$(deps_config)\n\n");
49 "$(deps_config): ;\n"); 51
52 expr_list_for_each_sym(sym_env_list, e, sym) {
53 struct property *prop;
54 const char *value;
55
56 prop = sym_get_env_prop(sym);
57 env_sym = prop_get_symbol(prop);
58 if (!env_sym)
59 continue;
60 value = getenv(env_sym->name);
61 if (!value)
62 value = "";
63 fprintf(out, "ifneq \"$(%s)\" \"%s\"\n", env_sym->name, value);
64 fprintf(out, "include/config/auto.conf: FORCE\n");
65 fprintf(out, "endif\n");
66 }
67
68 fprintf(out, "\n$(deps_config): ;\n");
50 fclose(out); 69 fclose(out);
51 rename("..config.tmp", name); 70 rename("..config.tmp", name);
52 return 0; 71 return 0;