Re: [patch] Makefile: can't build modules outside the kernel tree if it was built using O=

From: AmÃrico Wang
Date: Wed Sep 16 2009 - 23:16:00 EST


On Thu, Sep 17, 2009 at 10:30 AM, Caveh Jalali <ecaveh@xxxxxxxxx> wrote:
> in 2.6.31, it is no longer possible to build kernel modules for some platforms
> (the ones that need include2) outside the kernel src tree if the
> src tree was built using O= to specify an alternate directory for the
> build output.
>
> i think this broke with the following commit:
>
> commit b8b572e1015f81b4e748417be2629dfe51ab99f9
> Author: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
> Date:ÂÂ Fri Aug 1 15:20:30 2008 +1000


Only after 2.6.31? This commit was on 2008 Aug 1...

>
> ÂÂ powerpc: Move include files to arch/powerpc/include/asm
>
>
> when the platform specific include directories were shuffled around
> without updating the
> top level Makefile. Âhowever, i think this FAIL is generic, and not
> limited to powerpc.
> here's a patch to the top level Makefile to teach it about the shuffled files:
>


You forgot your SOB line.

Anyway, it looks fine.

Acked-by: WANG Cong <xiyou.wangcong@xxxxxxxxx>

>
> --- /local/caveh/linux/linux-2.6.31/MakefileÂÂÂ 2009-09-09
> 15:13:59.000000000 -0700
> +++ MakefileÂÂÂ 2009-09-16 12:23:05.000000000 -0700
> @@ -958,9 +958,9 @@ ifneq ($(KBUILD_SRC),)
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ echo "Â in the '$(srctree)' directory.";\
> ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ /bin/false; \
> ÂÂÂÂÂÂÂ fi;
> -ÂÂÂÂÂÂ $(Q)if [ ! -d include2 ]; thenÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ \
> -ÂÂÂÂÂÂÂÂÂÂ mkdir -p include2;ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ \
> -ÂÂÂÂÂÂÂÂÂÂ ln -fsn $(srctree)/include/asm-$(SRCARCH) include2/asm;ÂÂÂÂ \
> +ÂÂÂÂÂÂ $(Q)if [ ! -d include2 ]; thenÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ \
> +ÂÂÂÂÂÂÂÂÂÂ mkdir -p include2;ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ \
> +ÂÂÂÂÂÂÂÂÂÂ ln -fsn $(srctree)/arch/$(SRCARCH)/include/asm include2/asm; \
> ÂÂÂÂÂÂÂ fi
> Âendif
N‹§²æìr¸›yúèšØb²X¬¶ÇvØ^–)Þ{.nÇ+‰·¥Š{±‘êçzX§¶›¡Ü}©ž²ÆzÚ&j:+v‰¨¾«‘êçzZ+€Ê+zf£¢·hšˆ§~†­†Ûiÿûàz¹®w¥¢¸?™¨è­Ú&¢)ßf”ù^jÇy§m…á@A«a¶Úÿ 0¶ìh®å’i