help-make
[Top][All Lists]
Advanced

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

Re: pattern rules and pattern-specific-variables problem


From: Paul D. Smith
Subject: Re: pattern rules and pattern-specific-variables problem
Date: Sun, 21 Aug 2005 18:40:18 -0400

%% Shawn Halpenny <address@hidden> writes:

  >> Some time ago I proposed changing pattern rules selection algorithm
  >> from picking the first applicable rule to picking the most
  >> specialized one (formally, the one with the shortest stem). I guess
  >> this will also be useful (or even more so) for pattern-specific
  >> variables.

  sh> That would match how I originally thought they worked and would
  sh> certainly be least surprising and more deterministic than the
  sh> current algorithm.

There is nothing non-deterministic about the current algorithm, and it's
very clearly documented in the manual so there shouldn't be any surprise
whatsoever about how it works.

>From the section "Introduction to Pattern Rules":

     The order in which pattern rules appear in the makefile is important
  since this is the order in which they are considered.  Of equally
  applicable rules, only the first one found is used.  The rules you
  write take precedence over those that are built in.  Note however, that
  a rule whose prerequisites actually exist or are mentioned always takes
  priority over a rule with prerequisites that must be made by chaining
  other implicit rules.


I suppose you could argue about the definition of "equally applicable",
but considering that a second rule with an identical pattern replaces
the first rule (or deletes the rule if there are no command scripts)
there is no other useful definition than the one intended by the
manual.

-- 
-------------------------------------------------------------------------------
 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]