<p>I'm using GCC to generate a dependency file, but my build rules put the output into a subdirectory. Is there a way to tell GCC to put my subdirectory prefix in the dependency file it generates for me?</p>

<pre><code>gcc $(INCLUDES) -E -MM $(CFLAGS) $(SRC) &gt;&gt;$(DEP)
</code></pre>

If there is an argument to GCC to do this, I don't know what it is. We end up piping the dependency output through
sed
to rewrite all occurrences of
```
<blah>.o
```
as
```
${OBJDIR}/<blah>.o
```
.