dtc: Implement -d option to write out a dependency file
[linux-flexiantxendom0-3.2.10.git] / scripts / dtc / srcpos.c
index 2dbc874..36a38e9 100644 (file)
@@ -40,6 +40,7 @@ static char *dirname(const char *path)
        return NULL;
 }
 
+FILE *depfile; /* = NULL */
 struct srcfile_state *current_srcfile; /* = NULL */
 
 /* Detect infinite include recursion. */
@@ -67,6 +68,9 @@ FILE *srcfile_relative_open(const char *fname, char **fullnamep)
                            strerror(errno));
        }
 
+       if (depfile)
+               fprintf(depfile, " %s", fullname);
+
        if (fullnamep)
                *fullnamep = fullname;
        else