kernel: Don't try to do math on empty kernel version
Fixes the following error message when compiling target w/o kernel src:
expr: syntax error: unexpected argument ‘5’
Test: lunch lineage_sdk_phone_x86_64-eng
Change-Id: Ib3ec41d9dc2b59ddc9ee3c0c8e3813c4defcfc3e
diff --git a/config/BoardConfigKernel.mk b/config/BoardConfigKernel.mk
index c372895..f584046 100644
--- a/config/BoardConfigKernel.mk
+++ b/config/BoardConfigKernel.mk
@@ -74,9 +74,11 @@
TARGET_KERNEL_VERSION ?= $(shell echo $(KERNEL_VERSION)"."$(KERNEL_PATCHLEVEL))
# 5.10+ can fully compile without GCC by default
-ifeq ($(shell expr $(KERNEL_VERSION) \>= 5), 1)
- ifeq ($(shell expr $(KERNEL_PATCHLEVEL) \>= 10), 1)
- TARGET_KERNEL_NO_GCC ?= true
+ifneq ($(KERNEL_VERSION),)
+ ifeq ($(shell expr $(KERNEL_VERSION) \>= 5), 1)
+ ifeq ($(shell expr $(KERNEL_PATCHLEVEL) \>= 10), 1)
+ TARGET_KERNEL_NO_GCC ?= true
+ endif
endif
endif