summaryrefslogtreecommitdiff
path: root/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 /makefile
parent37766bcc2dfb3dc0a620485a273b115d3f6b906a (diff)
fix makefile for arm
Diffstat (limited to 'makefile')
-rw-r--r--makefile19
1 files changed, 8 insertions, 11 deletions
diff --git a/makefile b/makefile
index 7067f491e..7fdd273d1 100644
--- a/makefile
+++ b/makefile
@@ -51,21 +51,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))
+
# conditionally map ARCH from amd64 to x86_64 if set from the outside
#
# Some OS provide a definition for $(ARCH) through an environment