aboutsummaryrefslogtreecommitdiffstats
path: root/include/kernel.mk
diff options
context:
space:
mode:
Diffstat (limited to 'include/kernel.mk')
-rw-r--r--include/kernel.mk8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/kernel.mk b/include/kernel.mk
index 2314ec73aa..7effca3832 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -51,17 +51,19 @@ else
LINUX_UNAME_VERSION:=$(LINUX_UNAME_VERSION)-$(strip $(lastword $(subst -, ,$(LINUX_VERSION))))
endif
- MODULES_SUBDIR:=lib/modules/$(LINUX_UNAME_VERSION)
- TARGET_MODULES_DIR := $(LINUX_TARGET_DIR)/$(MODULES_SUBDIR)
-
LINUX_KERNEL:=$(KERNEL_BUILD_DIR)/vmlinux
LINUX_SOURCE:=linux-$(LINUX_VERSION).tar.xz
TESTING:=$(if $(findstring -rc,$(LINUX_VERSION)),/testing,)
ifeq ($(call qstrip,$(CONFIG_EXTERNAL_KERNEL_TREE))$(call qstrip,$(CONFIG_KERNEL_GIT_CLONE_URI)),)
LINUX_SITE:=@KERNEL/linux/kernel/v$(word 1,$(subst ., ,$(KERNEL_BASE))).x$(TESTING)
+ else
+ LINUX_UNAME_VERSION:=$(strip $(shell cat $(LINUX_DIR)/include/config/kernel.release))
endif
+ MODULES_SUBDIR:=lib/modules/$(LINUX_UNAME_VERSION)
+ TARGET_MODULES_DIR:=$(LINUX_TARGET_DIR)/$(MODULES_SUBDIR)
+
ifneq ($(TARGET_BUILD),1)
PKG_BUILD_DIR ?= $(KERNEL_BUILD_DIR)/$(PKG_NAME)$(if $(PKG_VERSION),-$(PKG_VERSION))
endif