This is the mail archive of the gcc-patches@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]

Re: [CPP patch]: -M default name


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  <neil@daikokuya.demon.co.uk>
> > 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
> directory)
> 
> bash-2.04$ gcc -MM /tmp/test.c
> /tmp/test.o: /tmp/test.c /tmp/test.h
> bash-2.04$ 
> 
> 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).

My $.02.

zw

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