On Wed, 2010-09-22 at 13:41 +0200, Eli Zaretskii wrote:
> > From: Paul Smith <[email protected]>
> > Cc: ali hagigat <[email protected]>, [email protected]
> > Date: Wed, 22 Sep 2010 07:06:12 -0400
> >
> > > This means that if the Makefile uses a target named "target1", which
> > > is found by directory search at /foo/bar/baz/target1, then Make will
> > > use "/foo/bar/baz/target1" in all places where the Makefile mentions
> > > "target1". At least this is my understanding of the manual's text.
> >
> > No, not "in all places where the Makefile mentions" it.
> >
> > Only in places where make supplies the name; in particular expansions of
> > automatic variables like $< etc.
> >
> > Make does not go through the recipes, etc. and replace "target1" with
> > "/foo/bar/baz/target1".
>
> But, since the same directory search will find "target1" in the same
> place over and over again, the net effect is indistinguishable, right?
I don't follow you. A simple example will show what I mean:
vpath xyzzy somedir
all: xyzzy
@echo $<
@echo xyzzy
Assuming that ./xyzzy does not exist and ./somedir/xyzzy does exist,
then this will print:
somedir/xyzzy
xyzzy
It will NOT print:
somedir/xyzzy
somedir/xyzzy
Make remembers the vpath-found name internally and uses that name
wherever it is asked what the name is (for example when expanding
automatic variables like $<).
It will NOT do some textual search/replace on the contents of the recipe
and change every string matching the original target name to the new
name.
--
-------------------------------------------------------------------------------
Paul D. Smith <[email protected]> Find some GNU make tips at:
http://www.gnu.org http://make.mad-scientist.net
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make