This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

-MD behavior does not match documentation


The documentation says that -MD (and -MMD) write dependency information
"to a file made by replacing `.c' with `.d' at the end of the input file
names."  The problem is that if the input files are in a different
directory, the .d files are put in the current directory as in this
example:

gcc -MD -c -o obj/foo.o src/foo.c

produces ./foo.d.  It would seem that foo.d should go into src according
to the documentation.  An alternative might be to put it into obj, that
is replace the .o in the output with .d, paying attention to -o.

--Lee Hetherington


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]