help-make
[Top][All Lists]
Advanced

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

Fwd: bug or feature ?


From: Denis Onischenko
Subject: Fwd: bug or feature ?
Date: Wed, 28 Oct 2009 11:12:37 +0200

The following fragment from glibc's Makefile has the same problem:

$(objpfx)stubs ../po/manual.pot $(objpfx)stamp%:
       $(make-target-directory)
       touch $@


The make manual says:


"If a pattern rule has multiple targets, make knows that the rule’s
commands are responsible for making all of the
targets. The commands are executed only once to make all the targets.
When searching for a
pattern rule to match a target, the target patterns of a rule other
than the one that matches
the target in need of a rule are incidental: make worries only about
giving commands and
prerequisites to the file presently in question. However, when this
file’s commands are run,
the other targets are marked as having been updated themselves."

So, the question is:

How the "touch $@" command can be executed only once to make all the
targets, when the target name is not known in advance ?

Is the above rule equivalent to the following rules?

$(objpfx)stubs ../po/manual.pot:
       $(make-target-directory)
       touch $@


$(objpfx)stamp%:
       $(make-target-directory)
       touch $@


2009/10/25 Paul Smith <address@hidden>:
> On Tue, 2009-10-13 at 21:41 +0300, Denis Onischenko wrote:
>> This error occurs when compiling the linux kernel with latest make
>> version (3.81.90) from cvs repository:
>>
>> .../arch/powerpc/Makefile:168: *** mixed implicit and normal rules.
>> Stop.
>
> It's never been legal to mix implicit and explicit (normal) rules.
> However, older versions of make didn't always catch these problems; if
> you started with a pattern target then had non-pattern targets later, it
> would fail.  If you started with non-pattern targets and had pattern
> targets later, it would succeed.  The newest version is consistent: you
> can't mix them regardless of the order they appear in.
>
> Even though it didn't give an error, the makefile you had didn't work as
> you expected it to.  Make would create a pattern rule like this:
>
>        zImage% dtbImage% treeImage.% cuImage.% simpleImage.%:
>
> which doesn't do what I'm pretty sure you meant; see the GNU make
> manual, section on multiple patterns in a pattern rule.
>
> --
> -------------------------------------------------------------------------------
>  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]