Skip to contentSkip to conversation

Make kernel source path configurable

PATCH In review Mike Waychison 2 participants 2 messages Jan 29, 2009 1 message not in the archive Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make kernel source path configurable

Add an optional argument to the user-cs Makefile called KERNELPATH that allows one to specify the path for kernel sources to use for the build.

---

 Makefile |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
Makefile +4 -4
index 151d006..52cbfee 100644
@@ -1,13 +1,13 @@
-
+KERNELPATH ?= ../linux
 # compile with debug ?
 DEBUG = -DCHECKPOINT_DEBUG
 
 # find linux architecure
-KERN_ARCH = $(shell readlink ../linux/include/asm | sed 's/^asm-//')
+KERN_ARCH = $(shell readlink $(KERNELPATH)/include/asm | sed 's/^asm-//')
 
 # look for includes
-PATHS = -I../linux/include \
-	-I../linux/arch/$(KERN_ARCH)/include
+PATHS = -I$(KERNELPATH)/include \
+	-I$(KERNELPATH)/arch/$(KERN_ARCH)/include
 
 # extra warnings and fun
 WARNS := -Wall -Wstrict-prototypes -Wno-trigraphs

A message that is not in the archive (sent off-list or not yet received): 20090129021528.22655.32316.stgit-KRTu2lV406v8o+N1Ual6GVaTQe2KTcn/@public.gmane.org

#2 lore raw

Thanks.

Quoted 33 lines · Mike Waychison

Add an optional argument to the user-cs Makefile called KERNELPATH that allows one to specify the path for kernel sources to use for the build.

---

 Makefile |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
Makefile +4 -4
index 151d006..52cbfee 100644
@@ -1,13 +1,13 @@
-
+KERNELPATH ?= ../linux
 # compile with debug ?
 DEBUG = -DCHECKPOINT_DEBUG
 
 # find linux architecure
-KERN_ARCH = $(shell readlink ../linux/include/asm | sed 's/^asm-//')
+KERN_ARCH = $(shell readlink $(KERNELPATH)/include/asm | sed 's/^asm-//')
 
 # look for includes
-PATHS = -I../linux/include \
-	-I../linux/arch/$(KERN_ARCH)/include
+PATHS = -I$(KERNELPATH)/include \
+	-I$(KERNELPATH)/arch/$(KERN_ARCH)/include
 
 # extra warnings and fun
 WARNS := -Wall -Wstrict-prototypes -Wno-trigraphs