bug or feature ?

View: New views
5 Messages — Rating Filter:   Alert me  

bug or feature ?

by Denis Onischenko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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.

The Makefile is attached.

Version of July 2009 was building the same Makefile without errors.


_______________________________________________
Help-make mailing list
Help-make@...
http://lists.gnu.org/mailman/listinfo/help-make

Makefile (10K) Download Attachment

Re: bug or feature ?

by John Calcote-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On 10/13/2009 12:41 PM, Denis Onischenko wrote:
> .../arch/powerpc/Makefile:168: *** mixed implicit and normal rules. Stop.
>
>    

The message means that some targets in the target list have '%' (the
pattern character) in them, and some don't. This isn't allowed because
pattern rule commands can be formatted differently than normal rule
commands, so pattern and normal rules can't share a command set. From
line 162 in your Makefile:

BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.%
cuImage.% simpleImage.%

zImage, zImage.initrd, and uImage are normal targets, while the rest are
pattern rule targets.

John



_______________________________________________
Help-make mailing list
Help-make@...
http://lists.gnu.org/mailman/listinfo/help-make

Re: bug or feature ?

by Paul Smith-20 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 <psmith@...>          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



_______________________________________________
Help-make mailing list
Help-make@...
http://lists.gnu.org/mailman/listinfo/help-make

Parent Message unknown Fwd: bug or feature ?

by Denis Onischenko :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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 <psmith@...>:

> 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 <psmith@...>          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
>
>


_______________________________________________
Help-make mailing list
Help-make@...
http://lists.gnu.org/mailman/listinfo/help-make

Re: Fwd: bug or feature ?

by Paul Smith-20 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 2009-10-28 at 11:12 +0200, Denis Onischenko wrote:
> The following fragment from glibc's Makefile has the same problem:
>
> $(objpfx)stubs ../po/manual.pot $(objpfx)stamp%:
>        $(make-target-directory)
>        touch $@
>
> How the "touch $@" command can be executed only once to make all the
> targets, when the target name is not known in advance ?

There is no way to do this, currently, in GNU make except through
pattern rules.  Just listing one pattern target with a bunch of
non-pattern rules won't do it.

> Is the above rule equivalent to the following rules?
>
> $(objpfx)stubs ../po/manual.pot:
>        $(make-target-directory)
>        touch $@
>
>
> $(objpfx)stamp%:
>        $(make-target-directory)
>        touch $@

Yes, exactly.  If you run "make -p" you'll see that this is exactly how
make has parsed that makefile into its internal database.

--
-------------------------------------------------------------------------------
 Paul D. Smith <psmith@...>          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



_______________________________________________
Help-make mailing list
Help-make@...
http://lists.gnu.org/mailman/listinfo/help-make