help-make
[Top][All Lists]
Advanced

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

Re: per-target VPATH


From: Paul D. Smith
Subject: Re: per-target VPATH
Date: Thu, 13 Dec 2001 12:26:40 -0500

%% __alex__ <address@hidden> writes:

  >> See the GNU make manual, section "Target Specific Variable Values".

  a> Actually I don't see anything stating that during implicit rule
  a> search only global VPATH is used. May be this should be explicitly
  a> reflected in the documentation (I've checked VPATH/implicit rule
  a> search sections too)

It's implied by the statement that target-specific variable values are
only available within the context the command script.

Since that's true, there's no way the VPATH variable can be considered
while looking for prerequisites, long before the command script is in
context (until _after_ we find the prerequisites we don't even know
whether or not this is the right target).

  a> Having working pattern-specific VPATH would be even better. I
  a> wonder whether it's going to be implemented in future versions of
  a> gmake.

  >> No, I have no plans to do this; the current behavior of target-specific
  >> variables, as above, is the planned behavior going forward.

  a> I've had a quick look at the sources of make 3.79.1. In the 'file'
  a> struct there's a char* vpath variable which, afaict, is unused
  a> right now. Moreover, when finding implicit rule per-target variable
  a> list is already available. If I ever make patch to take per-target
  a> VPATH in consideration when finding implicit rules, how big are
  a> chances that it gets to the future version of gmake?

Doing this would make the treatment of the VPATH variable a very special
case, unlike any other variable treatment.  I don't like that.

Also, it's only part of an imagined "full" solution, since there's no
way to use the "vpath <pattern>" syntax in a target-specific way.  I
don't like that either.

Special cases are surprising, and so are to be avoided IMO.

I don't like to ever say never, but at the moment I don't feel
optimistic about this.

Your case is difficult because you have two distinct areas where the
pathname might be different (the prefix and the .obj or whatever
directory); if there was only one then you could do what you want
without needing VPATH.


BTW, that vpath field seems to be left in there by accident, it appeared
in GNU make 3.77 but it's never been used even in that version.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://www.paulandlesley.org/gmake/
 "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]