<p>We use GNU Make for our system.  At the end of our makefiles, we have an include called Makedepends which generates a bunch of .d files using -MM switch on gcc.  We then include the .d file for each .cc file using an include $(CXXFILES:.cc=.d) line.  But when we delete file or move files, the dependancies step breaks and we have to manually delete the .d files (even a make clean doesn't work because the dependencies fail)</p>

<p>Is there a way to generate these dependency .d files or include these dependency .d files which will gracefully handle a file deletion or relocation?</p>

<p>EDIT: For example: I have serial.cc and the makefiles generate a serial.d file which has a dependency on buffer.h but then I change it so I don't need buffer.h any more and I delete buffer.h.  Next time I run make, it will choke because it includes the .d file which still makes serial.o depend on buffer.h.</p>

Two possibilities:
First, can you add a rule to your Makefile to run the dependency step:
```
```
.SUFFIXES: .d

%.d::
   makedepend_command_here
```
```
If not, then from the
```
Last Resort
```
section of the
```
info
```
page for GNU Make:
For example, when testing a
  makefile, you might not care if the
  source files contain real data, only
  that they exist.  Then you might do
  this:
```
```
%::
         touch $@
```
```
to cause all the source files needed
  (as prerequisites) to be created
  automatically.
Will this work to create empty
```
.d
```
files for you?