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@xxxxxxxxxx> --- 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 -- 1.5.6.3 _______________________________________________ Containers mailing list Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx https://lists.linux-foundation.org/mailman/listinfo/containers