Paul D. Smith wrote:

%% [EMAIL PROTECTED] writes:

 d> But what I didn't mention is that this occurs many times throughout
 d> my entire tree. I am doing a non-recursive make system and this can
 d> occur in any directory and the use in one directory should not
 d> interfere with another directory. So basically, I would want to set
 d> the vpath for one rule and then clear it out.

No.  VPATH isn't used until long after the makefiles are all read in;
whatever value it has at the end of the parsing is the value it will
have for all targets.


You could do one of two things: use the VPATH variable as a
target-specific (or pattern-specific) variable (I think this will work).
No, it doesn't appear to work. I tried this, where the files /foo/a.c and /bar/a.c exist:

all : a.o1 a.o2

a.o1 : VPATH:=/foo
a.o1: %.o1 : %.c
       echo $@ $^

a.o2 : VPATH:=/bar
a.o2: %.o2 : %.c
       echo $@ $^

Which gives the error message:

make: *** No rule to make target `a.c', needed by `a.o1'.  Stop.

Or, use a more restrictive pattern for vpath, so instead of:

   vpath %.c ...

you do something like:

   vpath $(prefix)/%.c ...

where the prefix variable restricts the values to match the "current"
location, whatever that is.

That doesn't seem to work either.


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to