aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-extended/uxen/uxen-guest-tools/fix-Makefile-for-OE-kernel-build.patch
blob: 09a43754aa308a747771d14cf6d70a72a33ae929 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
Upstream-Status: Inappropriate [embedded specific]

# OpenEmbedded uses KERNEL_SRC instead of KDIR
# and enable the modules_install target.
# Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
diff --git a/Makefile b/Makefile
index 3fd3075..80cf0fe 100644
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,13 @@
 ifneq ($(KERNELRELEASE),)
 # kbuild part of makefile
-else
+include Kbuild
 
-KVERSION ?= $(shell uname -r)
-KDIR := /lib/modules/${KVERSION}/build
+else
+#normal makefile
+KERNEL_VERSION ?= $(shell uname -r)
+KERNEL_SRC ?= /lib/modules/${KERNEL_VERSION}/build
 UXENDIR ?= $(shell pwd)/include/uxen
+INSTALL_HDR_PATH ?= /usr
 
 LX_TARGET_FLAGS= -DLX_TARGET_STANDARDVM
 LX_TARGET_ATTOVM=n
@@ -19,7 +22,9 @@ EXTRA_CFLAGS=$(LX_TARGET_FLAGS) -g -Wall
 NOSTDINC_FLAGS=-I$(shell pwd)/include/ -I$(UXENDIR) -I$(UXENDIR)/xen
 
 all:
-	make -C $(KDIR) $(LX_TARGET) M=$(shell pwd) EXTRA_CFLAGS="$(EXTRA_CFLAGS)" NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)"
+	make -C $(KERNEL_SRC) $(LX_TARGET) M=$(shell pwd) EXTRA_CFLAGS="$(EXTRA_CFLAGS)" NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)"
 clean:
-	make -C $(KDIR) $(LX_TARGET) M=$(shell pwd) clean
+	make -C $(KERNEL_SRC) $(LX_TARGET) M=$(shell pwd) clean
+modules_install:
+	make -C $(KERNEL_SRC) $(LX_TARGET) M=$(shell pwd) modules_install
 endif