[OpenWrt-Devel] [PATCH v3 1/4] kernel.mk: Refactor LINUX_KARCH affectation

Maxime Ripard maxime.ripard at free-electrons.com
Fri Nov 28 13:20:17 EST 2014


Switch to a dumber implementation that will be easier to maintain in the long
run, with only if statements instead of having nested subst calls.

Signed-off-by: Maxime Ripard <maxime.ripard at free-electrons.com>
---
 include/kernel.mk | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)

diff --git a/include/kernel.mk b/include/kernel.mk
index 01fb4dbd8107..97eb1f74f4f7 100644
--- a/include/kernel.mk
+++ b/include/kernel.mk
@@ -64,13 +64,30 @@ endif
 
 ifneq (,$(findstring uml,$(BOARD)))
   LINUX_KARCH=um
+else ifeq ($(ARCH),aarch64)
+  LINUX_KARCH := arm64
+else ifeq ($(ARCH),aarch64_be)
+  LINUX_KARCH := arm64
+else ifeq ($(ARCH),armeb)
+  LINUX_KARCH := arm
+else ifeq ($(ARCH),mipsel)
+  LINUX_KARCH := mips
+else ifeq ($(ARCH),mips64)
+  LINUX_KARCH := mips
+else ifeq ($(ARCH),mips64el)
+  LINUX_KARCH := mips
+else ifeq ($(ARCH),sh2)
+  LINUX_KARCH := sh
+else ifeq ($(ARCH),sh3)
+  LINUX_KARCH := sh
+else ifeq ($(ARCH),sh4)
+  LINUX_KARCH := sh
+else ifeq ($(ARCH),i386)
+  LINUX_KARCH := x86
 else
-  ifeq (,$(LINUX_KARCH))
-    LINUX_KARCH=$(strip $(subst i386,x86,$(subst armeb,arm,$(subst mipsel,mips,$(subst mips64,mips,$(subst mips64el,mips,$(subst sh2,sh,$(subst sh3,sh,$(subst sh4,sh,$(subst aarch64,arm64,$(subst aarch64_be,arm64,$(ARCH))))))))))))
-  endif
+  LINUX_KARCH := $(ARCH)
 endif
 
-
 define KernelPackage/Defaults
   FILES:=
   AUTOLOAD:=
-- 
2.1.1
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list