From e3ba99bc58bc7d24d13948158449223d16a77479 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Wed, 3 Aug 2005 03:09:02 +0000 Subject: put back support for generating .config.cmd --- package/config/util.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'package/config/util.c') diff --git a/package/config/util.c b/package/config/util.c index 21e09a23d..8f65ccac5 100644 --- a/package/config/util.c +++ b/package/config/util.c @@ -26,6 +26,29 @@ struct file *file_lookup(const char *name) return file; } +/* write a dependency file as used by kbuild to track dependencies */ +int file_write_dep(const char *name) +{ + struct file *file; + FILE *out; + + if (!name) + name = ".config.cmd"; + out = fopen(".config.tmp", "w"); + if (!out) + return 1; + fprintf(out, "deps_config := \\\n"); + for (file = file_list; file; file = file->next) { + if (file->next) + fprintf(out, "\t%s \\\n", file->name); + else + fprintf(out, "\t%s\n", file->name); + } + fprintf(out, "\n.config include/config.h: $(deps_config)\n\n$(deps_config):\n"); + fclose(out); + rename(".config.tmp", name); + return 0; +} /* Allocate initial growable sting */ struct gstr str_new(void) -- cgit v1.2.3