[gentoo-user] [OT]: Need help with a Makefile

March 09th, 2012 - 03:00 pm ET by meino.cramer | Report spam
Hi,

I am trying to compile a linux-kernel for an embedded system.
There is an (older) build environment.
The kernel is based on a 2.4er linux kernel.
When doing a
make menuconfig
I get:

make menuconfig
Makefile:441: *** mixed implicit and normal rules. Stop.
[1] 8814 exit 2 make menuconfig

The according part of the makefile is:

include $(srctree)/arch/$(ARCH)/Makefile
export KBUILD_DEFCONFIG

441 config %config: scripts_basic outputmakefile FORCE
$(Q)mkdir -p include/linux
$(Q)$(MAKE) $(build)=scripts/kconfig $@
$(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease



I marked the according line with its number.

Unfortunately I am not familiar with makefiles...

I am using the make of the gentoo system, which is
GNU make 3.82...

What is wrong here?

Thank you very much in advance for any help!
Best regards,
mcc
email Follow the discussionReplies 4 repliesReplies Make a reply

Similar topics

Replies

#1 Todd Goodman
March 09th, 2012 - 03:40 pm ET | Report spam
* [120309 14:54]:
Hi,

I am trying to compile a linux-kernel for an embedded system.
There is an (older) build environment.
The kernel is based on a 2.4er linux kernel.
When doing a
make menuconfig
I get:

make menuconfig
Makefile:441: *** mixed implicit and normal rules. Stop.
[1] 8814 exit 2 make menuconfig

The according part of the makefile is:

include $(srctree)/arch/$(ARCH)/Makefile
export KBUILD_DEFCONFIG

441 config %config: scripts_basic outputmakefile FORCE
$(Q)mkdir -p include/linux
$(Q)$(MAKE) $(build)=scripts/kconfig $@
$(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease



I marked the according line with its number.

Unfortunately I am not familiar with makefiles...

I am using the make of the gentoo system, which is
GNU make 3.82...

What is wrong here?

Thank you very much in advance for any help!
Best regards,
mcc





Hi Meino,

Unfortunately GNU Make changed the rules on Makefiles (or decided to
enforce a rule that wasn't previously enforced, I don't know which) and
the kernel Makefiles were caught out by it.

The later kernels have the changes made that are necessary but if you're
building an older kernel with a newer make then you'll run into this
problem.

You can look at newer kernel source to find the changes necessary.

In the case above, the imlicit rule is the %config target and the normal
rule is the config target.

You can just separate those into two separate rules with the same
recipes.

For example:
config: scripts_basic outputmakefile FORCE
$(Q)mkdir -p include/linux
$(Q)$(MAKE) $(build)=scripts/kconfig $@
$(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease

%config: scripts_basic outputmakefile FORCE
$(Q)mkdir -p include/linux
$(Q)$(MAKE) $(build)=scripts/kconfig $@
$(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease

Regards,

Todd
Replies Reply to this message
#2 Sebastian Pipping
March 09th, 2012 - 05:10 pm ET | Report spam
Hello,


zhe troublesome changes occured between 3.81 and 3.82. There is a
tracker bug on related breakage in case you are interested:

https://bugs.gentoo.org/show_bug.cgi?id=gmake-3.82

Best,



Sebastian
Replies Reply to this message
#3 meino.cramer
March 09th, 2012 - 05:40 pm ET | Report spam
Sebastian Pipping [12-03-09 23:16]:
Hello,


zhe troublesome changes occured between 3.81 and 3.82. There is a
tracker bug on related breakage in case you are interested:

https://bugs.gentoo.org/show_bug.cgi?id=gmake-3.82

Best,



Sebastian




...which means to me and the problems I have: Reemerge make 3.81
???or...

Best regards,
mcc
Replies Reply to this message
#4 Sebastian Pipping
March 09th, 2012 - 09:10 pm ET | Report spam
On 03/09/2012 11:29 PM, wrote:
...which means to me and the problems I have: Reemerge make 3.81
???or...



I would prefer a patch to the Makefile (like Tood Goodman proposed
earlier) over a downgrade of make. I just meant to provide more
information about the issue. Let us know if you have trouble patching
that very Makefile.

Best,



Sebastian
email Follow the discussion Replies Reply to this message
Help Create a new topicReplies Make a reply
Search Make your own search