On Wed, Oct 29, 2008 at 07:24:50PM -0700, Philip Guenther wrote: > On Wed, Oct 29, 2008 at 2:12 PM, Sam Ravnborg <s...@ravnborg.org> wrote: > > On Sun, Oct 26, 2008 at 07:12:53PM -0400, Paul Smith wrote: > ... > >> Makefile:442: *** mixed implicit and normal rules. Stop. > >> > >> config %config: scripts_basic outputmakefile FORCE > >> $(Q)mkdir -p include/linux include/config > >> $(Q)$(MAKE) $(build)=scripts/kconfig $@ > > > > Here I try to catch the following: > > > > make config > > make menuconfig > > make xconfig > > make foobarconfig > > > > I must admit I cannot see the problem with mixing implicit and normal > > rules in the above. But I gues this is my simple use of it. > > I see at least two ways in which it's confusing: > 1) what prerequisites does "foo" have with this rule: > foo %.c: %.c.real > @: cp $< $@ ... For the record I pushed the following patch to the Linux kernel.
Sam >From 31110ebbec8688c6e9597b641101afc94e1c762a Mon Sep 17 00:00:00 2001 From: Sam Ravnborg <s...@ravnborg.org> Date: Sat, 13 Dec 2008 23:00:45 +0100 Subject: [PATCH] kbuild: fix make incompatibility "Paul Smith" <psm...@gnu.org> reported that we would fail to build with a new check that may be enabled in an upcoming version of make. The error was: Makefile:442: *** mixed implicit and normal rules. Stop. The problem is that we did stuff like this: config %config: ... The solution was simple - the above was split into two with identical prerequisites and commands. With only three lines it was not worth to try to avoid the duplication. Cc: "Paul Smith" <psm...@gnu.org> Signed-off-by: Sam Ravnborg <s...@ravnborg.org> --- Makefile | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index be462cf..95160e5 100644 --- a/Makefile +++ b/Makefile @@ -439,7 +439,11 @@ ifeq ($(config-targets),1) include $(srctree)/arch/$(SRCARCH)/Makefile export KBUILD_DEFCONFIG KBUILD_KCONFIG -config %config: scripts_basic outputmakefile FORCE +config: scripts_basic outputmakefile FORCE + $(Q)mkdir -p include/linux include/config + $(Q)$(MAKE) $(build)=scripts/kconfig $@ + +%config: scripts_basic outputmakefile FORCE $(Q)mkdir -p include/linux include/config $(Q)$(MAKE) $(build)=scripts/kconfig $@ @@ -1493,7 +1497,11 @@ endif $(Q)$(MAKE) $(build)=$(build-dir) $(target-dir)$(notdir $@) # Modules -/ %/: prepare scripts FORCE +/: prepare scripts FORCE + $(cmd_crmodverdir) + $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ + $(build)=$(build-dir) +%/: prepare scripts FORCE $(cmd_crmodverdir) $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \ $(build)=$(build-dir) -- 1.5.6.GIT _______________________________________________ Bug-make mailing list Bug-make@gnu.org http://lists.gnu.org/mailman/listinfo/bug-make