char *tmp_dir = NULL;
char *file_out = NULL;
char *watchfile = NULL;
+char *depfile = NULL;
char *authors = NULL;
char *license = NULL;
Eina_List *licenses = NULL;
"\n"
"-w files.txt Dump all sources files path into files.txt\n"
"-anotate Anotate the dumped files.\n"
+ "-deps files.txt Dump gnu style include dependencies path into files.txt\n"
"-id image/directory Add a directory to look in for relative path images\n"
"-fd font/directory Add a directory to look in for relative path fonts\n"
"-sd sound/directory Add a directory to look in for relative path sounds samples\n"
{
anotate = 1;
}
+ else if ((!strcmp(argv[i], "-deps")) && (i < (argc - 1)))
+ {
+ i++;
+ depfile = argv[i];
+ unlink(depfile);
+ }
else if (!file_in)
file_in = argv[i];
else if (!file_out)
extern char *file_in;
extern char *file_out;
extern char *watchfile;
+extern char *depfile;
extern char *license;
extern char *authors;
extern Eina_List *licenses;
eina_prefix_lib_get(pfx));
if (ecore_file_exists(buf2))
{
- if (anotate)
+ if (depfile)
+ snprintf(buf, sizeof(buf), "%s -MMD %s -MT %s %s -I%s %s -o %s"
+ " -DEFL_VERSION_MAJOR=%d -DEFL_VERSION_MINOR=%d",
+ buf2, depfile, file_out, file_in,
+ inc, def, clean_file,
+ EINA_VERSION_MAJOR, EINA_VERSION_MINOR);
+ else if (anotate)
snprintf(buf, sizeof(buf), "%s -anotate -a %s %s -I%s %s -o %s"
" -DEFL_VERSION_MAJOR=%d -DEFL_VERSION_MINOR=%d",
buf2, watchfile ? watchfile : "/dev/null", file_in,
/* The style of the choices here is a bit mixed.
* The chosen scheme is a hybrid of keeping all options in one string
* and specifying each option in a separate argument:
- * -M|-MM|-MD file|-MMD file [-MG]. An alternative is:
- * -M|-MM|-MD file|-MMD file|-MG|-MMG; or more concisely:
- * -M[M][G][D file]. This is awkward to handle in specs, and is not
- * as extensible. */
+ * -M|-MM|-MT file|-MD file|-MMD file [-MG]. An alternative is:
+ * -M|-MM|-MT file|-MD file|-MMD file|-MG|-MMG; or more concisely:
+ * -M[M][G][D file][T file]. This is awkward to handle in specs, and is
+ * not as extensible. */
/* ??? -MG must be specified in addition to one of -M or -MM.
* This can be relaxed in the future without breaking anything.
* The converse isn't true. */
argv[i]);
opts->deps_file = argv[++i];
}
+ /* For MT option, use file named by next arg as Target-name to write
+ * with the dependency information. */
+ else if (!strcmp(argv[i], "-MT"))
+ {
+ if (i + 1 == argc)
+ cpp_fatal("Filename missing after %s option",
+ argv[i]);
+ opts->deps_target = argv[++i];
+ }
else
{
/* For -M and -MM, write deps on standard output