diff --git a/build/platform.simulator.android.mak b/build/platform.simulator.android.mak index 97cd7faf7..936a94db3 100644 --- a/build/platform.simulator.android.mak +++ b/build/platform.simulator.android.mak @@ -3,6 +3,8 @@ EXE = so EPSILON_TELEMETRY ?= 1 -ifdef NDK_ABI -BUILD_DIR := $(BUILD_DIR)/$(NDK_ABI) +ARCHS = armeabi-v7a arm64-v8a x86 x86_64 + +ifdef ARCH +BUILD_DIR := $(BUILD_DIR)/$(ARCH) endif diff --git a/build/toolchain.android.mak b/build/toolchain.android.mak index 2249be610..ed6762dbf 100644 --- a/build/toolchain.android.mak +++ b/build/toolchain.android.mak @@ -13,16 +13,16 @@ NDK_TOOLCHAIN_PATH = $(NDK_PATH)/toolchains/llvm/prebuilt/$(NDK_HOST_TAG)/bin # is no toolchain for those archs on those API levels. Let's enforce NDK_VERSION # at 21 for these archs, and 16 for the others. -ifeq ($(NDK_ABI),armeabi-v7a) +ifeq ($(ARCH),armeabi-v7a) NDK_TARGET = armv7a-linux-androideabi NDK_VERSION = 16 -else ifeq ($(NDK_ABI),arm64-v8a) +else ifeq ($(ARCH),arm64-v8a) NDK_TARGET = aarch64-linux-android NDK_VERSION = 21 -else ifeq ($(NDK_ABI),x86) +else ifeq ($(ARCH),x86) NDK_TARGET = i686-linux-android NDK_VERSION = 16 -else ifeq ($(NDK_ABI),x86_64) +else ifeq ($(ARCH),x86_64) NDK_TARGET = x86_64-linux-android NDK_VERSION = 21 endif diff --git a/ion/src/simulator/android/Makefile b/ion/src/simulator/android/Makefile index e3908dce0..450b13b70 100644 --- a/ion/src/simulator/android/Makefile +++ b/ion/src/simulator/android/Makefile @@ -40,27 +40,25 @@ $(BUILD_DIR)/app/res/%.xml: ion/src/simulator/android/src/res/%.xml | $$(@D)/. define rule_for_libepsilon $$(BUILD_DIR)/app/libs/%/lib$(1): force_remake $$$$(@D)/. - $(Q) echo "MAKE NDK_ABI=$$*" - $(Q) $$(MAKE) NDK_ABI=$$* $(1) + $(Q) echo "MAKE ARCH=$$*" + $(Q) $$(MAKE) ARCH=$$* $(1) $(Q) cp $$(BUILD_DIR)/$$*/$(1) $$@ endef $(eval $(call rule_for_libepsilon,epsilon.so)) $(eval $(call rule_for_libepsilon,epsilon.official.so)) -# If NDK_ABI is not defined, we will re-trigger a build for each avaialble ABI. +# If ARCH is not defined, we will re-trigger a build for each avaialble ABI. # This is used to build APKs, which needs to embbed a binary for each ABI. -ifndef NDK_ABI - -NDK_ABIS = armeabi-v7a arm64-v8a x86 x86_64 +ifndef ARCH epsilon_apk_deps = $(subst ion/src/simulator/android/src/res,$(BUILD_DIR)/app/res,$(wildcard ion/src/simulator/android/src/res/*/*)) epsilon_apk_deps += $(addprefix $(BUILD_DIR)/app/res/,mipmap/ic_launcher.png mipmap-v26/ic_launcher_foreground.png) define rule_for_gradle .PHONY: gradle_%_$1 -gradle_%_$1.: $$(epsilon_apk_deps) $$(patsubst %,$$(BUILD_DIR)/app/libs/%/libepsilon$1.so,$(NDK_ABIS)) +gradle_%_$1.: $$(epsilon_apk_deps) $$(patsubst %,$$(BUILD_DIR)/app/libs/%/libepsilon$1.so,$(ARCHS)) @echo "GRADLE ion/src/simulator/android/build.gradle" $(Q) ANDROID_HOME=$(ANDROID_HOME) EPSILON_VERSION=$(EPSILON_VERSION) BUILD_DIR=$(BUILD_DIR) LIBEPSILON_NAME="epsilon$1" ion/src/simulator/android/gradlew -b ion/src/simulator/android/build.gradle $$* endef