Left: | ||
Right: |
OLD | NEW |
---|---|
1 V8_DIR :=$(shell pwd -L)/third_party/v8/ | 1 V8_DIR :=$(shell pwd -L)/third_party/v8/ |
2 HOST_ARCH :=$(shell python third_party/detect_v8_host_arch.py) | 2 HOST_ARCH :=$(shell python third_party/detect_v8_host_arch.py) |
3 | 3 |
4 GYP_PARAMETERS=host_arch=${HOST_ARCH} | 4 GYP_PARAMETERS=host_arch=${HOST_ARCH} |
5 | 5 |
6 ifndef HOST_OS | 6 ifndef HOST_OS |
7 raw_OS = $(shell uname -s) | 7 raw_OS = $(shell uname -s) |
8 ifeq (${raw_OS},Linux) | 8 ifeq (${raw_OS},Linux) |
9 HOST_OS=linux | 9 HOST_OS=linux |
10 else ifeq (${raw_OS},Darwin) | 10 else ifeq (${raw_OS},Darwin) |
11 HOST_OS=mac | 11 HOST_OS=mac |
12 endif | 12 endif |
13 endif | 13 endif |
14 | 14 |
15 ifneq "$(and ${LIBV8_LIB_DIR}, ${LIBV8_INCLUDE_DIR})" "" | 15 ifneq "$(and ${LIBV8_LIB_DIR}, ${LIBV8_INCLUDE_DIR})" "" |
16 BUILD_V8=do-nothing | 16 BUILD_V8=do-nothing |
17 ABP_GYP_PARAMETERS+= libv8_lib_dir=${LIBV8_LIB_DIR} libv8_include_dir=${LIBV8_IN CLUDE_DIR} | 17 ABP_GYP_PARAMETERS+= libv8_lib_dir=${LIBV8_LIB_DIR} libv8_include_dir=${LIBV8_IN CLUDE_DIR} |
18 else | 18 else |
19 BUILD_V8=build-v8 | 19 BUILD_V8=build-v8 |
20 endif | 20 endif |
21 | 21 |
22 ifneq ($(ANDROID_ARCH),) | 22 ifneq ($(ANDROID_ARCH),) |
23 ANDROID_PLATFORM_LEVEL=android-9 | |
23 GYP_PARAMETERS+= OS=android target_arch=${ANDROID_ARCH} | 24 GYP_PARAMETERS+= OS=android target_arch=${ANDROID_ARCH} |
24 ifeq ($(ANDROID_ARCH),arm) | 25 ifeq ($(ANDROID_ARCH),arm) |
25 ANDROID_ABI = armeabi-v7a | 26 ANDROID_ABI = armeabi-v7a |
26 else ifeq ($(ANDROID_ARCH),ia32) | 27 else ifeq ($(ANDROID_ARCH),ia32) |
27 ANDROID_ABI = x86 | 28 ANDROID_ABI = x86 |
29 else ifeq ($(ANDROID_ARCH),arm64) | |
30 ANDROID_ABI = arm64-v8a | |
31 # minimal platform having arch-arm64, see ndk/platforms | |
32 ANDROID_PLATFORM_LEVEL=android-21 | |
28 else | 33 else |
29 $(error "Unsupported Android architecture: $(ANDROID_ARCH)) | 34 $(error "Unsupported Android architecture: $(ANDROID_ARCH)) |
30 endif | 35 endif |
31 ANDROID_DEST_DIR = android_$(ANDROID_ARCH).release | 36 ANDROID_DEST_DIR = android_$(ANDROID_ARCH).release |
32 | 37 |
33 ifeq "$(and ${LIBV8_LIB_DIR}, ${LIBV8_INCLUDE_DIR})" "" | 38 ifeq "$(and ${LIBV8_LIB_DIR}, ${LIBV8_INCLUDE_DIR})" "" |
34 ABP_GYP_PARAMETERS+= libv8_lib_dir=${ANDROID_DEST_DIR} | 39 ABP_GYP_PARAMETERS+= libv8_lib_dir=${ANDROID_DEST_DIR} |
35 BUILD_V8=build-v8-android | 40 BUILD_V8=build-v8-android |
36 endif | 41 endif |
37 | 42 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
76 | 81 |
77 clean: | 82 clean: |
78 $(RM) -r build docs | 83 $(RM) -r build docs |
79 | 84 |
80 android_x86: | 85 android_x86: |
81 ANDROID_ARCH="ia32" $(MAKE) android_multi | 86 ANDROID_ARCH="ia32" $(MAKE) android_multi |
82 | 87 |
83 android_arm: | 88 android_arm: |
84 ANDROID_ARCH="arm" $(MAKE) android_multi | 89 ANDROID_ARCH="arm" $(MAKE) android_multi |
85 | 90 |
91 android_arm64: | |
92 ANDROID_ARCH="arm64" $(MAKE) android_multi | |
93 | |
86 ifneq ($(ANDROID_ARCH),) | 94 ifneq ($(ANDROID_ARCH),) |
87 v8_android_multi: ensure_dependencies | 95 v8_android_multi: ensure_dependencies |
88 cd third_party/v8 && GYP_GENERATORS=make-android \ | 96 cd third_party/v8 && GYP_GENERATORS=make-android \ |
89 GYP_DEFINES="${GYP_PARAMETERS} v8_target_arch=${ANDROID_ARCH}" \ | 97 GYP_DEFINES="${GYP_PARAMETERS} v8_target_arch=${ANDROID_ARCH}" \ |
90 PYTHONPATH="${V8_DIR}tools/generate_shim_headers:${V8_DIR}gypfiles:${P YTHONPATH}" \ | 98 PYTHONPATH="${V8_DIR}tools/generate_shim_headers:${V8_DIR}gypfiles:${P YTHONPATH}" \ |
91 tools/gyp/gyp \ | 99 tools/gyp/gyp \ |
92 --generator-output=../../build src/v8.gyp \ | 100 --generator-output=../../build src/v8.gyp \ |
93 -Igypfiles/standalone.gypi \ | 101 -Igypfiles/standalone.gypi \ |
94 --depth=. \ | 102 --depth=. \ |
95 -S.android_${ANDROID_ARCH}.release \ | 103 -S.android_${ANDROID_ARCH}.release \ |
96 -I../../android-v8-options.gypi | 104 -I../../android-v8-options.gypi |
97 cd third_party/v8 && make \ | 105 cd third_party/v8 && make \ |
98 -C ../../build \ | 106 -C ../../build \ |
99 -f Makefile.android_${ANDROID_ARCH}.release \ | 107 -f Makefile.android_${ANDROID_ARCH}.release \ |
100 v8_snapshot v8_libplatform v8_libsampler \ | 108 v8_snapshot v8_libplatform v8_libsampler \ |
101 BUILDTYPE=Release \ | 109 BUILDTYPE=Release \ |
102 builddir=${V8_DIR}../../build/android_${ANDROID_ARCH}.release | 110 builddir=${V8_DIR}../../build/android_${ANDROID_ARCH}.release |
103 | 111 |
104 v8_android_multi_linux_${ANDROID_ARCH}: v8_android_multi | 112 v8_android_multi_linux_${ANDROID_ARCH}: v8_android_multi |
105 | 113 |
106 v8_android_multi_mac_ia32: v8_android_multi | 114 v8_android_multi_mac_ia32: v8_android_multi |
107 find build/android_ia32.release/ -depth 1 -iname \*.a -exec ${ANDROID_ND K_ROOT}/toolchains/x86-4.9/prebuilt/darwin-x86_64/bin/i686-linux-android-ranlib {} \; | 115 find build/android_ia32.release/ -depth 1 -iname \*.a -exec ${ANDROID_ND K_ROOT}/toolchains/x86-4.9/prebuilt/darwin-x86_64/bin/i686-linux-android-ranlib {} \; |
108 | 116 |
109 v8_android_multi_mac_arm: v8_android_multi | 117 v8_android_multi_mac_arm: v8_android_multi |
110 find build/android_arm.release/ -depth 1 -iname \*.a -exec ${ANDROID_NDK _ROOT}/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux -androideabi-ranlib {} \; | 118 find build/android_arm.release/ -depth 1 -iname \*.a -exec ${ANDROID_NDK _ROOT}/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux -androideabi-ranlib {} \; |
111 | 119 |
120 v8_android_multi_mac_arm64: v8_android_multi | |
121 find build/android_arm64.release/ -depth 1 -iname \*.a -exec ${ANDROID_N DK_ROOT}/toolchains/aarch64-linux-android-4.9/prebuilt/darwin-x86_64/bin/aarch64 -linux-android-ranlib {} \; | |
122 | |
112 build-v8-android: v8_android_multi_${HOST_OS}_${ANDROID_ARCH} | 123 build-v8-android: v8_android_multi_${HOST_OS}_${ANDROID_ARCH} |
113 | 124 |
114 android_multi: ${BUILD_V8} ensure_dependencies | 125 android_multi: ${BUILD_V8} ensure_dependencies |
115 GYP_DEFINES="${GYP_PARAMETERS} ${ABP_GYP_PARAMETERS}" \ | 126 GYP_DEFINES="${GYP_PARAMETERS} ${ABP_GYP_PARAMETERS}" \ |
116 python ./make_gyp_wrapper.py --depth=. -f make-android -Ilibadblockplus. gypi --generator-output=build -Gandroid_ndk_version=r9 libadblockplus.gyp | 127 python ./make_gyp_wrapper.py --depth=. -f make-android -Ilibadblockplus. gypi --generator-output=build -Gandroid_ndk_version=r9 libadblockplus.gyp |
anton
2017/08/09 07:01:04
I can see it's closed but it looks strange : ndk 1
sergei
2017/08/10 13:45:49
Done in https://codereview.adblockplus.org/2951162
| |
117 $(ANDROID_NDK_ROOT)/ndk-build -C build installed_modules \ | 128 $(ANDROID_NDK_ROOT)/ndk-build -C build installed_modules \ |
118 BUILDTYPE=Release \ | 129 BUILDTYPE=Release \ |
119 APP_ABI=$(ANDROID_ABI) \ | 130 APP_ABI=$(ANDROID_ABI) \ |
120 » APP_PLATFORM=android-9 \ | 131 » APP_PLATFORM=${ANDROID_PLATFORM_LEVEL} \ |
121 APP_PIE=true \ | 132 APP_PIE=true \ |
122 APP_STL=c++_static \ | 133 APP_STL=c++_static \ |
123 APP_BUILD_SCRIPT=Makefile \ | 134 APP_BUILD_SCRIPT=Makefile \ |
124 NDK_PROJECT_PATH=. \ | 135 NDK_PROJECT_PATH=. \ |
125 NDK_OUT=. \ | 136 NDK_OUT=. \ |
126 NDK_APP_DST_DIR=$(ANDROID_DEST_DIR) | 137 NDK_APP_DST_DIR=$(ANDROID_DEST_DIR) |
127 endif | 138 endif |
128 | 139 |
OLD | NEW |