This is the mail archive of the
mailing list for the GCC project.
Re: [CPP patch]: -M default name
- To: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Subject: Re: [CPP patch]: -M default name
- From: "Zack Weinberg" <zackw at Stanford dot EDU>
- Date: Tue, 6 Feb 2001 11:26:23 -0800
- Cc: Nathan Sidwell <nathan at codesourcery dot com>, gcc-patches at gcc dot gnu dot org, Tom Tromey <tromey at cygnus dot com>
- References: <3A7FD18F.26C2B71@codesourcery.com> <20010206190024.J3104@daikokuya.demon.co.uk>
On Tue, Feb 06, 2001 at 07:00:24PM +0000, Neil Booth wrote:
> Hi Nathan,
> Nathan Sidwell wrote:-
> > this patch makes the default dependency target name have no directory
> > component, and reverts the behaviour of your patch of
> > 2001-01-05 Neil Booth <email@example.com>
> > what was the rationale for that? It's breaking something like
> > gcc -MD src/file.c
> > we get a file.o and a file.d, but file.d says the target is src/file.o
> Hmmm. The reason I did it was the following case (run from any
> bash-2.04$ gcc -MM /tmp/test.c
> /tmp/test.o: /tmp/test.c /tmp/test.h
> I thought we should keep the path of the source file.
Mm, but gcc -c /tmp/test.c will drop test.o in the current working
directory, so I would argue that gcc -MM /tmp/test.c should assume
you're going to drop test.o in the current working directory.
If we get an -o switch with -MM, then we should use its path. And -MM
-o foo.o should not create an empty foo.o (see the bug report).