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 ${V8_DIR}gypfiles/detect_v8_host_arch.py) | 2 HOST_ARCH :=$(shell python ${V8_DIR}gypfiles/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})" "" |
| 16 BUILD_V8=do-nothing |
| 17 ABP_GYP_PARAMETERS+= libv8_lib_dir=${LIBV8_LIB_DIR} libv8_include_dir=${LIBV8_IN
CLUDE_DIR} |
| 18 else |
| 19 BUILD_V8=build-v8 |
| 20 endif |
| 21 |
15 ifneq ($(ANDROID_ARCH),) | 22 ifneq ($(ANDROID_ARCH),) |
16 GYP_PARAMETERS+= OS=android target_arch=${ANDROID_ARCH} | 23 GYP_PARAMETERS+= OS=android target_arch=${ANDROID_ARCH} |
17 ifeq ($(ANDROID_ARCH),arm) | 24 ifeq ($(ANDROID_ARCH),arm) |
18 ANDROID_ABI = armeabi-v7a | 25 ANDROID_ABI = armeabi-v7a |
19 else ifeq ($(ANDROID_ARCH),ia32) | 26 else ifeq ($(ANDROID_ARCH),ia32) |
20 ANDROID_ABI = x86 | 27 ANDROID_ABI = x86 |
21 else | 28 else |
22 $(error "Unsupported Android architecture: $(ANDROID_ARCH)) | 29 $(error "Unsupported Android architecture: $(ANDROID_ARCH)) |
23 endif | 30 endif |
24 ANDROID_DEST_DIR = android_$(ANDROID_ARCH).release | 31 ANDROID_DEST_DIR = android_$(ANDROID_ARCH).release |
25 else | 32 |
| 33 ifeq "$(and ${LIBV8_LIB_DIR}, ${LIBV8_INCLUDE_DIR})" "" |
| 34 ABP_GYP_PARAMETERS+= libv8_lib_dir=${ANDROID_DEST_DIR} |
| 35 BUILD_V8=build-v8-android |
| 36 endif |
| 37 |
| 38 else # if ${ANDROID_ARCH} is empty |
26 TARGET_ARCH=${HOST_ARCH} | 39 TARGET_ARCH=${HOST_ARCH} |
27 ifdef ARCH | 40 ifdef ARCH |
28 TARGET_ARCH=${ARCH} | 41 TARGET_ARCH=${ARCH} |
29 endif | 42 endif |
30 GYP_PARAMETERS+= OS=${HOST_OS} target_arch=${TARGET_ARCH} | 43 GYP_PARAMETERS+= OS=${HOST_OS} target_arch=${TARGET_ARCH} |
31 endif | 44 endif |
32 | 45 |
33 | 46 |
34 TEST_EXECUTABLE = build/out/Debug/tests | 47 TEST_EXECUTABLE = build/out/Debug/tests |
35 | 48 |
36 .PHONY: all test clean docs v8 v8_android_multi android_multi android_x86 \ | 49 .PHONY: do-nothing all test clean docs build-v8 build-v8-android v8_android_mult
i android_multi android_x86 \ |
37 android_arm ensure_dependencies | 50 android_arm ensure_dependencies |
38 | 51 |
39 .DEFAULT_GOAL:=all | 52 .DEFAULT_GOAL:=all |
40 | 53 |
| 54 do-nothing: |
| 55 |
41 ensure_dependencies: | 56 ensure_dependencies: |
42 python ensure_dependencies.py | 57 python ensure_dependencies.py |
43 | 58 |
44 v8: ensure_dependencies | 59 build-v8: ensure_dependencies |
45 GYP_DEFINES="${GYP_PARAMETERS}" third_party/gyp/gyp --depth=. -f make -I
build-v8.gypi --generator-output=build/v8 ${V8_DIR}src/v8.gyp | 60 GYP_DEFINES="${GYP_PARAMETERS}" third_party/gyp/gyp --depth=. -f make -I
build-v8.gypi --generator-output=build/v8 ${V8_DIR}src/v8.gyp |
46 make -C build/v8 v8_snapshot v8_libplatform v8_libsampler | 61 make -C build/v8 v8_snapshot v8_libplatform v8_libsampler |
47 | 62 |
48 all: v8 | 63 all: ${BUILD_V8} ensure_dependencies |
49 » GYP_DEFINES="${GYP_PARAMETERS}" third_party/gyp/gyp --depth=. -f make -I
libadblockplus.gypi --generator-output=build libadblockplus.gyp | 64 » GYP_DEFINES="${GYP_PARAMETERS} ${ABP_GYP_PARAMETERS}" third_party/gyp/gy
p --depth=. -f make -I libadblockplus.gypi --generator-output=build libadblockpl
us.gyp |
50 $(MAKE) -C build | 65 $(MAKE) -C build |
51 | 66 |
52 test: all | 67 test: all |
53 ifdef FILTER | 68 ifdef FILTER |
54 $(TEST_EXECUTABLE) --gtest_filter=$(FILTER) | 69 $(TEST_EXECUTABLE) --gtest_filter=$(FILTER) |
55 else | 70 else |
56 $(TEST_EXECUTABLE) | 71 $(TEST_EXECUTABLE) |
57 endif | 72 endif |
58 | 73 |
59 docs: | 74 docs: |
(...skipping 27 matching lines...) Expand all Loading... |
87 builddir=${V8_DIR}../../build/android_${ANDROID_ARCH}.release | 102 builddir=${V8_DIR}../../build/android_${ANDROID_ARCH}.release |
88 | 103 |
89 v8_android_multi_linux_${ANDROID_ARCH}: v8_android_multi | 104 v8_android_multi_linux_${ANDROID_ARCH}: v8_android_multi |
90 | 105 |
91 v8_android_multi_mac_ia32: v8_android_multi | 106 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
{} \; | 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
{} \; |
93 | 108 |
94 v8_android_multi_mac_arm: v8_android_multi | 109 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 {} \; | 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 {} \; |
96 | 111 |
97 android_multi: v8_android_multi_${HOST_OS}_${ANDROID_ARCH} | 112 build-v8-android: v8_android_multi_${HOST_OS}_${ANDROID_ARCH} |
98 » GYP_DEFINES="${GYP_PARAMETERS}" \ | 113 |
| 114 android_multi: ${BUILD_V8} ensure_dependencies |
| 115 » GYP_DEFINES="${GYP_PARAMETERS} ${ABP_GYP_PARAMETERS}" \ |
99 python ./make_gyp_wrapper.py --depth=. -f make-android -Ilibadblockplus.
gypi --generator-output=build -Gandroid_ndk_version=r9 libadblockplus.gyp | 116 python ./make_gyp_wrapper.py --depth=. -f make-android -Ilibadblockplus.
gypi --generator-output=build -Gandroid_ndk_version=r9 libadblockplus.gyp |
100 $(ANDROID_NDK_ROOT)/ndk-build -C build installed_modules \ | 117 $(ANDROID_NDK_ROOT)/ndk-build -C build installed_modules \ |
101 BUILDTYPE=Release \ | 118 BUILDTYPE=Release \ |
102 APP_ABI=$(ANDROID_ABI) \ | 119 APP_ABI=$(ANDROID_ABI) \ |
103 APP_PLATFORM=android-9 \ | 120 APP_PLATFORM=android-9 \ |
104 APP_STL=c++_static \ | 121 APP_STL=c++_static \ |
105 APP_BUILD_SCRIPT=Makefile \ | 122 APP_BUILD_SCRIPT=Makefile \ |
106 NDK_PROJECT_PATH=. \ | 123 NDK_PROJECT_PATH=. \ |
107 NDK_OUT=. \ | 124 NDK_OUT=. \ |
108 NDK_APP_DST_DIR=$(ANDROID_DEST_DIR) | 125 NDK_APP_DST_DIR=$(ANDROID_DEST_DIR) |
109 endif | 126 endif |
110 | 127 |
OLD | NEW |