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: Paul D. Smith
Subject: Re: Problem with static pattern rules and full path
Date: Wed, 28 Sep 2005 21:24:03 -0400

%% 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).

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.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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