Gentoo Archives: gentoo-user

From: Todd Goodman <tsg@×××××××××.net>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] [OT]: Need help with a Makefile
Date: Fri, 09 Mar 2012 20:36:56
Message-Id: 20120309203537.GB17607@ns1.bonedaddy.net
In Reply to: [gentoo-user] [OT]: Need help with a Makefile by meino.cramer@gmx.de
1 * meino.cramer@×××.de <meino.cramer@×××.de> [120309 14:54]:
2 > Hi,
3 >
4 > I am trying to compile a linux-kernel for an embedded system.
5 > There is an (older) build environment.
6 > The kernel is based on a 2.4er linux kernel.
7 > When doing a
8 > make menuconfig
9 > I get:
10 >
11 > make menuconfig
12 > Makefile:441: *** mixed implicit and normal rules. Stop.
13 > [1] 8814 exit 2 make menuconfig
14 >
15 > The according part of the makefile is:
16 >
17 > include $(srctree)/arch/$(ARCH)/Makefile
18 > export KBUILD_DEFCONFIG
19 >
20 > 441 config %config: scripts_basic outputmakefile FORCE
21 > $(Q)mkdir -p include/linux
22 > $(Q)$(MAKE) $(build)=scripts/kconfig $@
23 > $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease
24 >
25 >
26 >
27 > I marked the according line with its number.
28 >
29 > Unfortunately I am not familiar with makefiles...
30 >
31 > I am using the make of the gentoo system, which is
32 > GNU make 3.82...
33 >
34 > What is wrong here?
35 >
36 > Thank you very much in advance for any help!
37 > Best regards,
38 > mcc
39 >
40 >
41
42 Hi Meino,
43
44 Unfortunately GNU Make changed the rules on Makefiles (or decided to
45 enforce a rule that wasn't previously enforced, I don't know which) and
46 the kernel Makefiles were caught out by it.
47
48 The later kernels have the changes made that are necessary but if you're
49 building an older kernel with a newer make then you'll run into this
50 problem.
51
52 You can look at newer kernel source to find the changes necessary.
53
54 In the case above, the imlicit rule is the %config target and the normal
55 rule is the config target.
56
57 You can just separate those into two separate rules with the same
58 recipes.
59
60 For example:
61 config: scripts_basic outputmakefile FORCE
62 $(Q)mkdir -p include/linux
63 $(Q)$(MAKE) $(build)=scripts/kconfig $@
64 $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease
65
66 %config: scripts_basic outputmakefile FORCE
67 $(Q)mkdir -p include/linux
68 $(Q)$(MAKE) $(build)=scripts/kconfig $@
69 $(Q)$(MAKE) -C $(srctree) KBUILD_SRC= .kernelrelease
70
71 Regards,
72
73 Todd

Replies

Subject Author
Re: [gentoo-user] [OT]: Need help with a Makefile Sebastian Pipping <sping@g.o>