OLD | NEW |
1 ARCH := x64 | 1 V8_DIR :=$(shell pwd -L)/third_party/v8/ |
| 2 HOST_ARCH :=$(shell python ${V8_DIR}gypfiles/detect_v8_host_arch.py) |
2 | 3 |
3 ANDROID_PARAMETERS = OS=android | 4 GYP_PARAMETERS=host_arch=${HOST_ARCH} |
| 5 |
| 6 ifndef HOST_OS |
| 7 raw_OS = $(shell uname -s) |
| 8 ifeq (${raw_OS},Linux) |
| 9 HOST_OS=linux |
| 10 else ifeq (${raw_OS},Darwin) |
| 11 HOST_OS=mac |
| 12 endif |
| 13 endif |
| 14 |
4 ifneq ($(ANDROID_ARCH),) | 15 ifneq ($(ANDROID_ARCH),) |
| 16 GYP_PARAMETERS+= OS=android target_arch=${ANDROID_ARCH} |
5 ifeq ($(ANDROID_ARCH),arm) | 17 ifeq ($(ANDROID_ARCH),arm) |
6 ANDROID_PARAMETERS += target_arch=arm android_target_arch=arm | |
7 ANDROID_PARAMETERS += arm_neon=0 armv7=0 arm_fpu=off vfp3=off | |
8 ANDROID_PARAMETERS += arm_float_abi=default | |
9 ANDROID_ABI = armeabi-v7a | 18 ANDROID_ABI = armeabi-v7a |
10 else ifeq ($(ANDROID_ARCH),ia32) | 19 else ifeq ($(ANDROID_ARCH),ia32) |
11 ANDROID_PARAMETERS += target_arch=x86 android_target_arch=x86 | |
12 ANDROID_ABI = x86 | 20 ANDROID_ABI = x86 |
13 else | 21 else |
14 $(error "Unsupported Android architecture: $(ANDROID_ARCH)) | 22 $(error "Unsupported Android architecture: $(ANDROID_ARCH)) |
15 endif | 23 endif |
16 ANDROID_DEST_DIR = android_$(ANDROID_ARCH).release | 24 ANDROID_DEST_DIR = android_$(ANDROID_ARCH).release |
| 25 else |
| 26 TARGET_ARCH=${HOST_ARCH} |
| 27 ifdef ARCH |
| 28 TARGET_ARCH=${ARCH} |
17 endif | 29 endif |
| 30 GYP_PARAMETERS+= OS=${HOST_OS} target_arch=${TARGET_ARCH} |
| 31 endif |
| 32 |
18 | 33 |
19 TEST_EXECUTABLE = build/out/Debug/tests | 34 TEST_EXECUTABLE = build/out/Debug/tests |
20 | 35 |
21 .PHONY: all test clean docs v8_android_multi android_multi android_x86 \ | 36 .PHONY: all test clean docs v8 v8_android_multi android_multi android_x86 \ |
22 » android_arm | 37 » android_arm ensure_dependencies |
23 | 38 |
24 all: | 39 .DEFAULT_GOAL:=all |
25 » third_party/gyp/gyp --depth=. -f make -I common.gypi --generator-output=
build -Dtarget_arch=$(ARCH) libadblockplus.gyp | 40 |
| 41 ensure_dependencies: |
| 42 » python ensure_dependencies.py |
| 43 |
| 44 v8: ensure_dependencies |
| 45 » GYP_DEFINES="${GYP_PARAMETERS}" third_party/gyp/gyp --depth=. -f make -I
v8.gypi --generator-output=build/v8 ${V8_DIR}src/v8.gyp |
| 46 » make -C build/v8 v8_snapshot v8_libplatform v8_libsampler |
| 47 |
| 48 all: v8 |
| 49 » GYP_DEFINES="${GYP_PARAMETERS}" third_party/gyp/gyp --depth=. -f make -I
libadblockplus.gypi --generator-output=build libadblockplus.gyp |
26 $(MAKE) -C build | 50 $(MAKE) -C build |
27 | 51 |
28 test: all | 52 test: all |
29 ifdef FILTER | 53 ifdef FILTER |
30 $(TEST_EXECUTABLE) --gtest_filter=$(FILTER) | 54 $(TEST_EXECUTABLE) --gtest_filter=$(FILTER) |
31 else | 55 else |
32 $(TEST_EXECUTABLE) | 56 $(TEST_EXECUTABLE) |
33 endif | 57 endif |
34 | 58 |
35 docs: | 59 docs: |
36 doxygen | 60 doxygen |
37 | 61 |
38 clean: | 62 clean: |
39 $(RM) -r build docs | 63 $(RM) -r build docs |
40 | 64 |
41 android_x86: | 65 android_x86: |
42 ANDROID_ARCH="ia32" $(MAKE) android_multi | 66 ANDROID_ARCH="ia32" $(MAKE) android_multi |
43 | 67 |
44 android_arm: | 68 android_arm: |
45 ANDROID_ARCH="arm" $(MAKE) android_multi | 69 ANDROID_ARCH="arm" $(MAKE) android_multi |
46 | 70 |
47 ifneq ($(ANDROID_ARCH),) | 71 ifneq ($(ANDROID_ARCH),) |
48 v8_android_multi: | 72 v8_android_multi: ensure_dependencies |
49 » mkdir -p third_party/v8/build/gyp | 73 » cd third_party/v8 && GYP_GENERATORS=make-android \ |
50 » cp -f third_party/v8_gyp_launcher third_party/v8/build/gyp/gyp | 74 » GYP_DEFINES="${GYP_PARAMETERS} v8_target_arch=${ANDROID_ARCH}" \ |
51 » DEFINES="${ANDROID_PARAMETERS}" \ | 75 » PYTHONPATH="${V8_DIR}tools/generate_shim_headers:${V8_DIR}gypfiles:${P
YTHONPATH}" \ |
52 » OUTDIR=../../build \ | 76 » tools/gyp/gyp \ |
53 » $(MAKE) -C third_party/v8 $(ANDROID_DEST_DIR) | 77 » --generator-output=../../build src/v8.gyp \ |
| 78 » -Igypfiles/standalone.gypi \ |
| 79 » --depth=. \ |
| 80 » -S.android_${ANDROID_ARCH}.release \ |
| 81 » -I../../android-v8-options.gypi |
| 82 » cd third_party/v8 && make \ |
| 83 » -C ../../build \ |
| 84 » -f Makefile.android_${ANDROID_ARCH}.release \ |
| 85 » v8_snapshot v8_libplatform v8_libsampler \ |
| 86 » BUILDTYPE=Release \ |
| 87 » builddir=${V8_DIR}../../build/android_${ANDROID_ARCH}.release |
54 | 88 |
55 android_multi: v8_android_multi | 89 v8_android_multi_linux_${ANDROID_ARCH}: v8_android_multi |
56 » GYP_DEFINES="${ANDROID_PARAMETERS} ANDROID_ARCH=$(ANDROID_ARCH)" \ | 90 |
57 » third_party/gyp/gyp --depth=. -f make-android -I common.gypi --generator
-output=build -Gandroid_ndk_version=r9 libadblockplus.gyp | 91 v8_android_multi_mac_ia32: v8_android_multi |
| 92 » 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
{} \; |
| 93 |
| 94 v8_android_multi_mac_arm: v8_android_multi |
| 95 » 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 {} \; |
| 96 |
| 97 android_multi: v8_android_multi_${HOST_OS}_${ANDROID_ARCH} |
| 98 » GYP_DEFINES="${GYP_PARAMETERS}" \ |
| 99 » ./make_gyp_wrapper.py --depth=. -f make-android -Ilibadblockplus.gypi --
generator-output=build -Gandroid_ndk_version=r9 libadblockplus.gyp |
58 $(ANDROID_NDK_ROOT)/ndk-build -C build installed_modules \ | 100 $(ANDROID_NDK_ROOT)/ndk-build -C build installed_modules \ |
59 BUILDTYPE=Release \ | 101 BUILDTYPE=Release \ |
60 APP_ABI=$(ANDROID_ABI) \ | 102 APP_ABI=$(ANDROID_ABI) \ |
61 APP_PLATFORM=android-9 \ | 103 APP_PLATFORM=android-9 \ |
62 APP_STL=c++_static \ | 104 APP_STL=c++_static \ |
63 APP_BUILD_SCRIPT=Makefile \ | 105 APP_BUILD_SCRIPT=Makefile \ |
64 NDK_TOOLCHAIN_VERSION=clang3.4 \ | |
65 NDK_PROJECT_PATH=. \ | 106 NDK_PROJECT_PATH=. \ |
66 NDK_OUT=. \ | 107 NDK_OUT=. \ |
67 NDK_APP_DST_DIR=$(ANDROID_DEST_DIR) | 108 NDK_APP_DST_DIR=$(ANDROID_DEST_DIR) |
68 endif | 109 endif |
69 | 110 |
OLD | NEW |