You are here

Solving GCC Kernel error: ***mixed implicit and normal rules

I'm using an old kernel because is the last stable to use with VServer patch.

evo src # ll
total 154344
lrwxrwxrwx  1 root root       15 Dec 22 20:07 linux -> linux-2.6.22.19
drwxrwxr-x 20 root root      840 Dec 22 20:07 linux-2.6.22.19
-rw-r--r--  1 root root 45108030 Nov 18  2009 linux-2.6.22.19.tar.bz2
-rw-r--r--  1 root root  1868800 Mar 17  2008 patch-2.6.22.19-vs2.2.0.7-grsec2.1.11-20080317.diff
evo linux # make
Makefile:1443: *** mixed implicit and normal rules.  Stop.
evo linux # make oldconfig
Makefile:1443: *** mixed implicit and normal rules.  Stop.
evo linux # vi Makefile 
.....
/ %/: prepare scripts FORCE
       $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
       $(build)=$(build-dir)
.....

Solution: here we have an implicit rule and an explicit rule in the same line, so we are going to split that rules.

# Modules
#/ %/: prepare scripts FORCE
#      $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
#      $(build)=$(build-dir)
/: prepare scripts FORCE
        $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
        $(build)=$(build-dir)
%/: prepare scripts FORCE
        $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) \
        $(build)=$(build-dir)