help-make
[Top][All Lists]
Advanced

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

Re: if there are multiple pattern rules


From: Paul Smith
Subject: Re: if there are multiple pattern rules
Date: Sun, 03 Apr 2011 18:09:54 -0400

On Sun, 2011-04-03 at 13:42 +0430, ali hagigat wrote:
> If I have two pattern rules for a target in a makefile, which one will
> be selected?

Before 3.82, the GNU make manual says:

           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.


In 3.82 a more intelligent scheme is used: the GNU make manual says:

        It is possible that more than one pattern rule will meet these
        criteria.  In that case, @code{make} will choose the rule with
        the shortest stem (that is, the pattern that matches most
        specifically). If more than one pattern rule has the shortest
        stem, @code{make} will choose the first one found in the
        makefile.

However, we've seen incompatibilities and problems with this.  It's not
clear exactly how this will play out.

Most of the time rules can easily be written to work the same in both
versions.

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