This is the mail archive of the
mailing list for the GCC project.
Automatic dependency file generation bug/question
- From: ANDY KENNEDY <ANDY dot KENNEDY at adtran dot com>
- To: "'gcc at gcc dot gnu dot org'" <gcc at gcc dot gnu dot org>
- Date: Wed, 15 Jan 2014 21:16:23 +0000
- Subject: Automatic dependency file generation bug/question
- Authentication-results: sourceware.org; auth=none
Reading <http://gcc.gnu.org/news/dependencies.html>, I find that
dependency files should be created along the lines of
%.o: %.c ...
In gcc version 4.4.4 (Slackware64 Linux version 13.0), I execute the
gcc -c -MMD -MP -MF"a.d" -MT"a.d" -o "a.o" "a.c"
and get the following output:
a.d a.o: a.c
which is precisely what I want. However, I have a cross compiler using
gcc version 4.7.3 which produces the following output using the same
commands (obviously, with gcc replace with <path to >/bin/gcc:
I have been looking for the reason for the change, but am unable to find
Please advise whether this is a bug, or if this is meant to be the way
gcc will work for all future releases. As I see it, this complicates my
Makefile(s) as I have two gcc version that behave differently. This
implies that my Makefile(s) will now require a section specifically
dedicated to the .d file generation. Whereas I remember that this used
to be the way I had to construct the dependency list, this was
cumbersome and the way e.g. 4.4.4 supported automatic dependency
generation is preferable to me.
Thank you for your time,