This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: 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: Tue, 21 Jan 2014 21:42:48 +0000
- Subject: RE: Automatic dependency file generation bug/question
- Authentication-results: sourceware.org; auth=none
- References: <F9C551623D2CBB4C9488801D14F864C68AA307FD at ex-mb1 dot corp dot adtran dot com>
Ping (with one correction).
> -----Original Message-----
> From: ANDY KENNEDY
> Sent: Wednesday, January 15, 2014 3:16 PM
> To: 'gcc@gcc.gnu.org'
> Subject: Automatic dependency file generation bug/question
>
> 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
> following commands:
>
> touch a.c
> gcc -c -MMD -MP -MF"a.d" -MT"a.d" -o "a.o" "a.c"
> cat a.d
>
> 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:
>
> a.d: a.c
>
> I have been looking for the reason for the change, but am unable to find
> the rational.
>
> 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,
> Andy