From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oren Laadan Subject: Re: [PATCH] user-cr: Support kernel builds done with O= Date: Mon, 13 Jul 2009 19:00:24 -0400 Message-ID: <4A5BBC88.8050703@cs.columbia.edu> References: <20090713030401.GB5213@count0.beaverton.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20090713030401.GB5213-52DBMbEzqgQ/wnmkkaCWp/UQ3DHhIser@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Matt Helsley Cc: Containers List-Id: containers.vger.kernel.org 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 > --- > 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