Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: Makefile

Issue 29329913: Issue 3296 - Enable ia32/x86 Android builds (Closed)
Patch Set: Column alignment, moved a var def Created Nov. 10, 2015, 11:55 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | libadblockplus.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Makefile
diff --git a/Makefile b/Makefile
index b8900fab874df7531ce11697075dfa095ad21af6..63013746bcaae2dfb0205bd945b2e9141d65d665 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,25 @@
ARCH := x64
-ANDROID_PARAMETERS = target_arch=arm OS=android
-ANDROID_PARAMETERS += android_target_arch=arm
+ANDROID_PARAMETERS = OS=android
+ifneq ($(ANDROID_ARCH),)
+ifeq ($(ANDROID_ARCH),arm)
+ANDROID_PARAMETERS += target_arch=arm android_target_arch=arm
ANDROID_PARAMETERS += arm_neon=0 armv7=0 arm_fpu=off vfp3=off
ANDROID_PARAMETERS += arm_float_abi=default
+ANDROID_ABI = armeabi-v7a
+else ifeq ($(ANDROID_ARCH),ia32)
+ANDROID_PARAMETERS += target_arch=x86 android_target_arch=x86
+ANDROID_ABI = x86
+else
+$(error "Unsupported Android architecture: $(ANDROID_ARCH))
+endif
+ANDROID_DEST_DIR = android_$(ANDROID_ARCH).release
+endif
TEST_EXECUTABLE = build/out/Debug/tests
-.PHONY: all test clean v8_android android docs
+.PHONY: all test clean docs v8_android_multi android_multi android_x86 \
+ android_arm
all:
third_party/gyp/gyp --depth=. -f make -I common.gypi --generator-output=build -Dtarget_arch=$(ARCH) libadblockplus.gyp
@@ -26,22 +38,32 @@ docs:
clean:
$(RM) -r build docs
-v8_android:
+android_x86:
+ ANDROID_ARCH="ia32" $(MAKE) android_multi
+
+android_arm:
+ ANDROID_ARCH="arm" $(MAKE) android_multi
+
+ifneq ($(ANDROID_ARCH),)
+v8_android_multi:
mkdir -p third_party/v8/build/gyp
cp -f third_party/v8_gyp_launcher third_party/v8/build/gyp/gyp
DEFINES="${ANDROID_PARAMETERS}" \
OUTDIR=../../build \
- $(MAKE) -C third_party/v8 android_arm.release
+ $(MAKE) -C third_party/v8 $(ANDROID_DEST_DIR)
-android: v8_android
- GYP_DEFINES="${ANDROID_PARAMETERS}" \
+android_multi: v8_android_multi
+ GYP_DEFINES="${ANDROID_PARAMETERS} ANDROID_ARCH=$(ANDROID_ARCH)" \
third_party/gyp/gyp --depth=. -f make-android -I common.gypi --generator-output=build -Gandroid_ndk_version=r9 libadblockplus.gyp
$(ANDROID_NDK_ROOT)/ndk-build -C build installed_modules \
BUILDTYPE=Release \
+ APP_ABI=$(ANDROID_ABI) \
APP_PLATFORM=android-9 \
APP_STL=c++_static \
APP_BUILD_SCRIPT=Makefile \
NDK_TOOLCHAIN_VERSION=clang3.4 \
NDK_PROJECT_PATH=. \
NDK_OUT=. \
- NDK_APP_DST_DIR=android_arm.release
+ NDK_APP_DST_DIR=$(ANDROID_DEST_DIR)
+endif
+
« no previous file with comments | « no previous file | libadblockplus.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld