summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2005-08-03 03:09:02 +0000
committerEric Andersen <andersen@codepoet.org>2005-08-03 03:09:02 +0000
commite3ba99bc58bc7d24d13948158449223d16a77479 (patch)
tree4722edd2571b11357039858ea7f04896bc24845c
parent05c5b1ba361dd59ecc6537c0d54c3f95a4dc45f6 (diff)
put back support for generating .config.cmd
-rw-r--r--package/config/confdata.c1
-rw-r--r--package/config/lkc.h1
-rw-r--r--package/config/util.c23
3 files changed, 25 insertions, 0 deletions
diff --git a/package/config/confdata.c b/package/config/confdata.c
index 91a1cf4e2..55cb94fdf 100644
--- a/package/config/confdata.c
+++ b/package/config/confdata.c
@@ -380,6 +380,7 @@ int conf_write(const char *name)
}
}
fclose(out);
+ file_write_dep(NULL);
if (!name || basename != conf_def_filename) {
if (!name)
name = conf_def_filename;
diff --git a/package/config/lkc.h b/package/config/lkc.h
index df2f6b46e..b8a67fc9d 100644
--- a/package/config/lkc.h
+++ b/package/config/lkc.h
@@ -59,6 +59,7 @@ void menu_set_type(int type);
/* util.c */
struct file *file_lookup(const char *name);
+int file_write_dep(const char *name);
struct gstr {
size_t len;
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)