This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Problems with -MD -MMD preprocessing for dependency information
- To: "'gcc-bugs at gcc dot gnu dot org'" <gcc-bugs at gcc dot gnu dot org>
- Subject: Problems with -MD -MMD preprocessing for dependency information
- From: David Mahaffey <dmahaffey at epicrealm dot com>
- Date: Wed, 17 Jan 2001 11:32:42 -0600
Using version 2.95.2 compiled unmodified on Red Hat 6.1.
The online documentation for gcc and -MD says :
"Like `-M' but the dependency information is written to a file
rather than stdout. gcc will use the same file name and directory as
the object file, but with the suffix ".d" instead."
However if your target object file is output a directory other than the
current directory, the .d file is stored in the current directory anyway.
As in:
gcc -c -MD -o ../obj/main.o main.c
The file main.d is created in the cwd and not in ../obj as stated in the
documentation. It also list the target of the header dependencies as if it
were in the current directory and not in the ../obj directory.
main.d is this :
main.o : main.c main.h
instead of
../obj/main.o : main.c main.h
It may be a case that the documentation is wrong, but when compiling targets
into other than the current directory all of the -M variants are of
diminished usefulness.
Thanks for your time and attention,
David G. Mahaffey
Sr. Software Engineer
epicRealm Inc.
mailto:dmahaffey@epicrealm.com
(214) 570-4593