[PATCH] user-cr: Support kernel builds done with O=

Oren Laadan orenl at cs.columbia.edu
Mon Jul 13 16:00:24 PDT 2009


Got it.

I added another change to allow taking the headers from
the install directory (variable: KERNELHDR, defaulf it
$(KERNELSRC)/usr/include).

Hopefully I didn't break anything...

Oren.

Matt Helsley wrote:
> Support kernel builds such as:
> 
> 	make O=../kbuild bzImage
> 
> The Makefile must differentiate between where the kernel source is and where
> the build output is. The readlink test to determine KERN_ARCH is the only
> part of the Makefile that relies on kernel build output at the moment.
> 
> Signed-off-by: Matt Helsley <matthltc at us.ibm.com>
> ---
>  Makefile |   13 +++++++------
>  1 files changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 0ae5fe0..f0439d4 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1,19 +1,20 @@
>  
> -KERNELPATH ?= ../linux
> +KERNELSRC ?= ../linux
> +KERNELBUILD ?= ../linux
>  
>  # compile with debug ?
>  DEBUG = -DCHECKPOINT_DEBUG
>  
>  # find linux architecure
> -KERN_ARCH = $(shell readlink $(KERNELPATH)/include/asm | sed 's/^asm-//')
> +KERN_ARCH = $(shell readlink $(KERNELBUILD)/include/asm | sed 's/^asm-//')
>  
>  # look for includes
> -PATHS = -I$(KERNELPATH)/include \
> -	-I$(KERNELPATH)/arch/$(KERN_ARCH)/include
> +PATHS = -I$(KERNELSRC)/include \
> +	-I$(KERNELSRC)/arch/$(KERN_ARCH)/include
>  
>  # checkpoint_hdr files
> -CKPT_HDR = $(KERNELPATH)/include/linux/checkpoint_hdr.h \
> -	   $(KERNELPATH)/arch/$(KERN_ARCH)/include/asm/checkpoint_hdr.h
> +CKPT_HDR = $(KERNELSRC)/include/linux/checkpoint_hdr.h \
> +	   $(KERNELSRC)/arch/$(KERN_ARCH)/include/asm/checkpoint_hdr.h
>  
>  # extra warnings and fun
>  WARNS := -Wall -Wstrict-prototypes -Wno-trigraphs


More information about the Containers mailing list