put back support for generating .config.cmd
This commit is contained in:
parent
05c5b1ba36
commit
e3ba99bc58
package/config
@ -380,6 +380,7 @@ int conf_write(const char *name)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
fclose(out);
|
fclose(out);
|
||||||
|
file_write_dep(NULL);
|
||||||
if (!name || basename != conf_def_filename) {
|
if (!name || basename != conf_def_filename) {
|
||||||
if (!name)
|
if (!name)
|
||||||
name = conf_def_filename;
|
name = conf_def_filename;
|
||||||
|
@ -59,6 +59,7 @@ void menu_set_type(int type);
|
|||||||
|
|
||||||
/* util.c */
|
/* util.c */
|
||||||
struct file *file_lookup(const char *name);
|
struct file *file_lookup(const char *name);
|
||||||
|
int file_write_dep(const char *name);
|
||||||
|
|
||||||
struct gstr {
|
struct gstr {
|
||||||
size_t len;
|
size_t len;
|
||||||
|
@ -26,6 +26,29 @@ struct file *file_lookup(const char *name)
|
|||||||
return file;
|
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 */
|
/* Allocate initial growable sting */
|
||||||
struct gstr str_new(void)
|
struct gstr str_new(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user