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

Side by Side Diff: Makefile

Issue 29509592: Issue 5267 - Add support of 64 bit android (Closed) Base URL: https://github.com/adblockplus/libadblockplus.git
Patch Set: Created Aug. 8, 2017, 12:59 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 GYP_PARAMETERS+= OS=android target_arch=${ANDROID_ARCH} 23 GYP_PARAMETERS+= OS=android target_arch=${ANDROID_ARCH}
24 ifeq ($(ANDROID_ARCH),arm) 24 ifeq ($(ANDROID_ARCH),arm)
25 ANDROID_ABI = armeabi-v7a 25 ANDROID_ABI = armeabi-v7a
26 else ifeq ($(ANDROID_ARCH),ia32) 26 else ifeq ($(ANDROID_ARCH),ia32)
27 ANDROID_ABI = x86 27 ANDROID_ABI = x86
28 else ifeq ($(ANDROID_ARCH),arm64)
29 ANDROID_ABI = arm64-v8a
28 else 30 else
29 $(error "Unsupported Android architecture: $(ANDROID_ARCH)) 31 $(error "Unsupported Android architecture: $(ANDROID_ARCH))
30 endif 32 endif
31 ANDROID_DEST_DIR = android_$(ANDROID_ARCH).release 33 ANDROID_DEST_DIR = android_$(ANDROID_ARCH).release
32 34
33 ifeq "$(and ${LIBV8_LIB_DIR}, ${LIBV8_INCLUDE_DIR})" "" 35 ifeq "$(and ${LIBV8_LIB_DIR}, ${LIBV8_INCLUDE_DIR})" ""
34 ABP_GYP_PARAMETERS+= libv8_lib_dir=${ANDROID_DEST_DIR} 36 ABP_GYP_PARAMETERS+= libv8_lib_dir=${ANDROID_DEST_DIR}
35 BUILD_V8=build-v8-android 37 BUILD_V8=build-v8-android
36 endif 38 endif
37 39
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 docs: 76 docs:
75 doxygen 77 doxygen
76 78
77 clean: 79 clean:
78 $(RM) -r build docs 80 $(RM) -r build docs
79 81
80 android_x86: 82 android_x86:
81 ANDROID_ARCH="ia32" $(MAKE) android_multi 83 ANDROID_ARCH="ia32" $(MAKE) android_multi
82 84
83 android_arm: 85 android_arm:
84 ANDROID_ARCH="arm" $(MAKE) android_multi 86 ANDROID_ARCH="arm" $(MAKE) android_multi
hub 2017/08/08 13:50:01 Shouldn't we add a android_arm64 target here?
sergei 2017/08/08 15:47:32 Right
85 87
86 ifneq ($(ANDROID_ARCH),) 88 ifneq ($(ANDROID_ARCH),)
87 v8_android_multi: ensure_dependencies 89 v8_android_multi: ensure_dependencies
88 cd third_party/v8 && GYP_GENERATORS=make-android \ 90 cd third_party/v8 && GYP_GENERATORS=make-android \
89 GYP_DEFINES="${GYP_PARAMETERS} v8_target_arch=${ANDROID_ARCH}" \ 91 GYP_DEFINES="${GYP_PARAMETERS} v8_target_arch=${ANDROID_ARCH}" \
90 PYTHONPATH="${V8_DIR}tools/generate_shim_headers:${V8_DIR}gypfiles:${P YTHONPATH}" \ 92 PYTHONPATH="${V8_DIR}tools/generate_shim_headers:${V8_DIR}gypfiles:${P YTHONPATH}" \
91 tools/gyp/gyp \ 93 tools/gyp/gyp \
92 --generator-output=../../build src/v8.gyp \ 94 --generator-output=../../build src/v8.gyp \
93 -Igypfiles/standalone.gypi \ 95 -Igypfiles/standalone.gypi \
94 --depth=. \ 96 --depth=. \
95 -S.android_${ANDROID_ARCH}.release \ 97 -S.android_${ANDROID_ARCH}.release \
96 -I../../android-v8-options.gypi 98 -I../../android-v8-options.gypi
97 cd third_party/v8 && make \ 99 cd third_party/v8 && make \
98 -C ../../build \ 100 -C ../../build \
99 -f Makefile.android_${ANDROID_ARCH}.release \ 101 -f Makefile.android_${ANDROID_ARCH}.release \
100 v8_snapshot v8_libplatform v8_libsampler \ 102 v8_snapshot v8_libplatform v8_libsampler \
101 BUILDTYPE=Release \ 103 BUILDTYPE=Release \
102 builddir=${V8_DIR}../../build/android_${ANDROID_ARCH}.release 104 builddir=${V8_DIR}../../build/android_${ANDROID_ARCH}.release
103 105
104 v8_android_multi_linux_${ANDROID_ARCH}: v8_android_multi 106 v8_android_multi_linux_${ANDROID_ARCH}: v8_android_multi
105 107
106 v8_android_multi_mac_ia32: v8_android_multi 108 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 {} \; 109 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 110
109 v8_android_multi_mac_arm: v8_android_multi 111 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 {} \; 112 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 113
114 v8_android_multi_mac_arm64: v8_android_multi
115 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 {} \;
116
112 build-v8-android: v8_android_multi_${HOST_OS}_${ANDROID_ARCH} 117 build-v8-android: v8_android_multi_${HOST_OS}_${ANDROID_ARCH}
113 118
114 android_multi: ${BUILD_V8} ensure_dependencies 119 android_multi: ${BUILD_V8} ensure_dependencies
115 GYP_DEFINES="${GYP_PARAMETERS} ${ABP_GYP_PARAMETERS}" \ 120 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 121 python ./make_gyp_wrapper.py --depth=. -f make-android -Ilibadblockplus. gypi --generator-output=build -Gandroid_ndk_version=r9 libadblockplus.gyp
hub 2017/08/08 13:50:00 I'm not sure how relevant that is, but ndk version
sergei 2017/08/08 15:47:32 Good catch. It's for gyp and it seems the value i
sergei 2017/08/10 13:45:49 See https://codereview.adblockplus.org/29511621/
117 $(ANDROID_NDK_ROOT)/ndk-build -C build installed_modules \ 122 $(ANDROID_NDK_ROOT)/ndk-build -C build installed_modules \
118 BUILDTYPE=Release \ 123 BUILDTYPE=Release \
119 APP_ABI=$(ANDROID_ABI) \ 124 APP_ABI=$(ANDROID_ABI) \
120 APP_PLATFORM=android-9 \ 125 APP_PLATFORM=android-9 \
121 APP_STL=c++_static \ 126 APP_STL=c++_static \
122 APP_BUILD_SCRIPT=Makefile \ 127 APP_BUILD_SCRIPT=Makefile \
123 NDK_PROJECT_PATH=. \ 128 NDK_PROJECT_PATH=. \
124 NDK_OUT=. \ 129 NDK_OUT=. \
125 NDK_APP_DST_DIR=$(ANDROID_DEST_DIR) 130 NDK_APP_DST_DIR=$(ANDROID_DEST_DIR)
126 endif 131 endif
127 132
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld