summaryrefslogtreecommitdiff
path: root/core/makefile
diff options
context:
space:
mode:
authorruki <[email protected]>2020-09-12 21:12:55 +0800
committerruki <[email protected]>2020-09-12 21:14:11 +0800
commitb23f11f53af9f087292c08cfcb62adff62d1ce2f (patch)
treede90316e741d5e4e4db26f77fe6cd61b84561939 /core/makefile
parent37766bcc2dfb3dc0a620485a273b115d3f6b906a (diff)
fix makefile for arm
Diffstat (limited to 'core/makefile')
-rw-r--r--core/makefile20
1 files changed, 9 insertions, 11 deletions
diff --git a/core/makefile b/core/makefile
index 31b3b9026..17bfde98d 100644
--- a/core/makefile
+++ b/core/makefile
@@ -177,21 +177,18 @@ ARCH :=$(if $(findstring i686,$(ARCH)),i386,$(ARCH)) # from msys/mingw32
ARCH :=$(if $(findstring x32,$(ARCH)),i386,$(ARCH))
ARCH :=$(if $(findstring x64,$(ARCH)),x86_64,$(ARCH))
-# for arm linux?
-ifeq ($(PLAT),linux)
+# on termux/ci
ifneq ($(TERMUX_ARCH),)
-ARCHSTR := $(TERMUX_ARCH) # on termux/ci
-else
-ARCHSTR := $(shell uname -m) # on arm device, e.g. termux app
-endif
-ARCH := $(if $(findstring aarch64,$(ARCHSTR)),arm64,$(ARCH))
-ARCH := $(if $(findstring arm64,$(ARCHSTR)),arm64,$(ARCH))
-ARCH := $(if $(findstring armv7,$(ARCHSTR)),armv7,$(ARCH))
-ARCH := $(if $(findstring arm,$(ARCHSTR)),arm,$(ARCH))
-ARCH := $(if $(findstring i686,$(ARCHSTR)),i386,$(ARCH))
+ARCH := $(TERMUX_ARCH)
endif
endif
+# translate architecture, e.g. armhf/armv7l -> arm, arm64-v8a -> arm64
+ARCH := $(if $(findstring aarch64,$(ARCH)),arm64,$(ARCH))
+ARCH := $(if $(findstring arm64,$(ARCH)),arm64,$(ARCH))
+ARCH := $(if $(findstring arm,$(ARCH)),arm,$(ARCH))
+ARCH := $(if $(findstring i686,$(ARCH)),i386,$(ARCH))
+
# debug
DEBUG :=$(if $(DEBUG),$(DEBUG),n)
@@ -354,6 +351,7 @@ config : .null
@$(ECHO) "compile:"
@$(ECHO) " plat:\t\t"$(PLAT)
@$(ECHO) " arch:\t\t"$(ARCH)
+ @$(ECHO) " arch:\t\t"$(shell uname -m)
@$(ECHO) " host:\t\t"$(HOST)
@$(ECHO) " demo:\t\t"$(DEMO)
@$(ECHO) " prof:\t\t"$(PROF)