help-make
[Top][All Lists]
Advanced

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

Re: Problem with static pattern rules and full path


From: Dale King
Subject: Re: Problem with static pattern rules and full path
Date: Thu, 29 Sep 2005 00:40:19 -0500
User-agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)

Paul D. Smith wrote:

%% address@hidden 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.




reply via email to

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