[PATCH 02/10] backports: Makefile: introduce KVERSION and rework KLIB definition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Samuel Martin <s.martin49@xxxxxxxxx>
---
 backport/Makefile | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/backport/Makefile b/backport/Makefile
index 3ff74d9..e9256e4 100644
--- a/backport/Makefile
+++ b/backport/Makefile
@@ -12,10 +12,18 @@ KMODDIR ?= updates
 ifneq ($(origin KROOT), undefined)
 KMODPATH_ARG := "INSTALL_MOD_PATH=$(KROOT)"
 else
-KLIB := /lib/modules/$(shell uname -r)/
 KROOT := /
 KMODPATH_ARG :=
 endif
+
+ifneq ($(origin KLIB_BUILD), undefined)
+KVERSION := $(shell $(MAKE) -C $(KLIB_BUILD) $(if $(ARCH),ARCH=$(ARCH)) \
+	--no-print-directory -s kernelrelease)
+else
+KVERSION := $(shell uname -r)
+endif
+
+KLIB := $(KROOT)/lib/modules/$(KVERSION)
 KLIB_BUILD ?= $(KLIB)/build/
 KERNEL_CONFIG := $(KLIB_BUILD)/.config
 KERNEL_MAKEFILE := $(KLIB_BUILD)/Makefile
-- 
1.9.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux