gcc -c -MD x/y.c -o x/y.o leaves y.d in the current directory

Matthias Klose doko@cs.tu-berlin.de
Sun Jul 23 10:42:00 GMT 2000


[please CC 59232@bugs.debian.org on replies]

The gcc-2.95 man page says:
       -MD    Like `-M' but the dependency information is written
              to  files  with  names  made by replacing `.o' with
              `.d' at the end of the output file names.

So, if the object file is called "x/y.o", I would expect the
dependency file to be created as "x/y.d". However, gcc always puts
`.d' file into the current directory.

Either gcc should be fixed or the manual should explicitly state
where those files are created. I would prefer the former.

The 2.95 and mainline documentation says:

  Like @samp{-M} but the dependency information is written to a file made by
  replacing ".c" with ".d" at the end of the input file names.
  This is in addition to compiling the file as specified---@samp{-MD}
  does not inhibit ordinary compilation the way @samp{-M} does.

so, the .d file should not be placed in the current directory.



More information about the Gcc-bugs mailing list