bug-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Changing resolution of $^ in make


From: Robert Mecklenburg
Subject: Changing resolution of $^ in make
Date: Tue, 8 Oct 2002 14:30:22 -0600

I apologize in advance if this cross-posting is inappropriate, but it
seemed reasonable at the time...


The following makefile yields two different values for $^ when run
twice in succession:

# Example makefile
vpath %.in /c/work/tmp/src
vpath %.out /c/work/tmp/out

default: stuff/foo.out
        # $^

%.out: %.in
        touch /c/work/tmp/out/$@

# end of makefile


When run twice I get:

        63 OSAKA:tmp$ make
        touch /c/work/tmp/out/stuff/foo.out
        # c/foo.out
        64 OSAKA:tmp$ make
        # /c/work/tmp/out/stuff/foo.out

As you can see, the first time (when the prerequisite "stuff/foo.out"
doesn't exist) , $^ is resolved to "stuff/foo.out".  But the second
time, when stuff/foo.out already exists, it is resolved to
"/c/work/tmp/out/stuff/foo.out".  Is this behavior correct?

Environment Specifics:

This is being run on Windows XP with the latest cygwin installation.
I've cc'd that list because there are a lot of sharp people there
familiar with gnu internals.

65 OSAKA:tmp$ make --version
GNU Make version 3.79.1, by Richard Stallman and Roland McGrath.
Built for i686-pc-cygwin
Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 2000
        Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

Report bugs to <address@hidden>.

Thanks,
-- 
Robert





reply via email to

[Prev in Thread] Current Thread [Next in Thread]