Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 1 | # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | # This Android makefile is used to build WebView in the Android build system. |
Ben Murdoch | c5cede9 | 2014-04-10 11:22:14 +0100 | [diff] [blame] | 6 | # gyp autogenerates most of the real makefiles, which we include below. |
| 7 | |
Primiano Tucci | 1320f92 | 2014-09-30 14:45:55 +0100 | [diff] [blame] | 8 | LOCAL_PATH := $(call my-dir) |
| 9 | CHROMIUM_DIR := $(LOCAL_PATH) |
Torne (Richard Coles) | 5821806 | 2012-11-14 11:43:16 +0000 | [diff] [blame] | 10 | |
Ben Murdoch | 7dbb3d5 | 2013-07-17 14:55:54 +0100 | [diff] [blame] | 11 | # We default to release for the Android build system. Developers working on |
| 12 | # WebView code can build with "make GYP_CONFIGURATION=Debug". |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 13 | GYP_CONFIGURATION := Release |
Ben Murdoch | eb525c5 | 2013-07-10 11:40:50 +0100 | [diff] [blame] | 14 | |
Primiano Tucci | 1320f92 | 2014-09-30 14:45:55 +0100 | [diff] [blame] | 15 | # If the product is using a prebuilt libwebviewchromium then we need to skip |
| 16 | # including most of the makefiles to avoid duplicate target definitions. Some |
| 17 | # targets are still needed, so list their makefiles explicitly. |
| 18 | ifeq ($(PRODUCT_PREBUILT_WEBVIEWCHROMIUM),yes) |
| 19 | GYP_MAKEFILE_STEMS := \ |
| 20 | $(addprefix $(CHROMIUM_DIR)/v8/tools/gyp/, \ |
Primiano Tucci | 1320f92 | 2014-09-30 14:45:55 +0100 | [diff] [blame] | 21 | js2c.host \ |
| 22 | mksnapshot.host \ |
| 23 | v8_base.host \ |
| 24 | v8_libbase.host \ |
Torne (Richard Coles) | 5b55ba8 | 2015-01-12 15:06:04 +0000 | [diff] [blame] | 25 | v8_libplatform.host \ |
Primiano Tucci | 1320f92 | 2014-09-30 14:45:55 +0100 | [diff] [blame] | 26 | v8_nosnapshot.host \ |
| 27 | v8_base.target \ |
| 28 | v8_libbase.target \ |
| 29 | v8_snapshot.target \ |
| 30 | ) \ |
| 31 | $(addprefix $(CHROMIUM_DIR)/third_party/icu/, \ |
| 32 | icudata.host \ |
| 33 | icui18n.host \ |
| 34 | icuuc.host \ |
| 35 | icui18n.target \ |
| 36 | icuuc.target \ |
| 37 | system_icu.target \ |
| 38 | ) |
| 39 | else |
| 40 | # Not using a prebuilt; include the manually-written makefile that builds all |
| 41 | # the WebView java code, and use the main autogenerated makefile. |
Ben Murdoch | c5cede9 | 2014-04-10 11:22:14 +0100 | [diff] [blame] | 42 | include $(CHROMIUM_DIR)/android_webview/Android.mk |
Primiano Tucci | 1320f92 | 2014-09-30 14:45:55 +0100 | [diff] [blame] | 43 | GYP_MAKEFILE_STEMS := $(CHROMIUM_DIR)/GypAndroid |
| 44 | endif |
Torne (Richard Coles) | 54cd422 | 2014-04-03 15:40:12 +0100 | [diff] [blame] | 45 | |
Ben Murdoch | c5cede9 | 2014-04-10 11:22:14 +0100 | [diff] [blame] | 46 | # If the gyp-generated makefile exists for the current host OS and primary |
| 47 | # target architecture, we need to include it. If it doesn't exist then just do |
| 48 | # nothing, since we may not have finished bringing up this architecture yet. |
Torne (Richard Coles) | 46d4c2b | 2014-06-09 12:00:27 +0100 | [diff] [blame] | 49 | ifneq (,$(wildcard $(CHROMIUM_DIR)/GypAndroid.$(HOST_OS)-$(TARGET_ARCH).mk)) |
| 50 | |
Ben Murdoch | c5cede9 | 2014-04-10 11:22:14 +0100 | [diff] [blame] | 51 | # We set GYP_VAR_PREFIX to the empty string to indicate that we are building for |
| 52 | # the primary target architecture. |
Torne (Richard Coles) | 54cd422 | 2014-04-03 15:40:12 +0100 | [diff] [blame] | 53 | GYP_VAR_PREFIX := |
Torne (Richard Coles) | 46d4c2b | 2014-06-09 12:00:27 +0100 | [diff] [blame] | 54 | |
| 55 | # If the host is declared as being 64-bit, set the host multilib variables |
| 56 | # appropriately to ensure that the host targets are the same "bitness" as the |
| 57 | # primary target, which is required by V8. |
| 58 | ifeq ($(HOST_IS_64_BIT),true) |
| 59 | ifeq ($(TARGET_IS_64_BIT),true) |
| 60 | GYP_HOST_VAR_PREFIX := |
| 61 | GYP_HOST_MULTILIB := 64 |
| 62 | else # Target is 32-bit. |
| 63 | GYP_HOST_VAR_PREFIX := $(HOST_2ND_ARCH_VAR_PREFIX) |
| 64 | GYP_HOST_MULTILIB := 32 |
Torne (Richard Coles) | 54cd422 | 2014-04-03 15:40:12 +0100 | [diff] [blame] | 65 | endif |
Torne (Richard Coles) | 46d4c2b | 2014-06-09 12:00:27 +0100 | [diff] [blame] | 66 | endif |
| 67 | |
Primiano Tucci | 1320f92 | 2014-09-30 14:45:55 +0100 | [diff] [blame] | 68 | # Include the appropriate version of each of the makefiles. |
| 69 | include $(addsuffix .$(HOST_OS)-$(TARGET_ARCH).mk,$(GYP_MAKEFILE_STEMS)) |
Torne (Richard Coles) | 46d4c2b | 2014-06-09 12:00:27 +0100 | [diff] [blame] | 70 | |
| 71 | endif # End primary architecture handling. |
Torne (Richard Coles) | 54cd422 | 2014-04-03 15:40:12 +0100 | [diff] [blame] | 72 | |
Ben Murdoch | c5cede9 | 2014-04-10 11:22:14 +0100 | [diff] [blame] | 73 | # Do the same check for the secondary architecture; if this doesn't exist then |
| 74 | # the current target platform probably doesn't have a secondary architecture and |
| 75 | # we can just do nothing. |
Torne (Richard Coles) | 46d4c2b | 2014-06-09 12:00:27 +0100 | [diff] [blame] | 76 | ifneq (,$(wildcard $(CHROMIUM_DIR)/GypAndroid.$(HOST_OS)-$(TARGET_2ND_ARCH).mk)) |
| 77 | |
Ben Murdoch | c5cede9 | 2014-04-10 11:22:14 +0100 | [diff] [blame] | 78 | # We set GYP_VAR_PREFIX to $(TARGET_2ND_ARCH_VAR_PREFIX) to indicate that we are |
| 79 | # building for the secondary target architecture. |
Torne (Richard Coles) | 54cd422 | 2014-04-03 15:40:12 +0100 | [diff] [blame] | 80 | GYP_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX) |
Torne (Richard Coles) | 46d4c2b | 2014-06-09 12:00:27 +0100 | [diff] [blame] | 81 | |
| 82 | # If the host is declared as being 64-bit, set the host multilib variables |
| 83 | # appropriately to ensure that the host targets are the same "bitness" as the |
| 84 | # secondary target, which is required by V8. |
| 85 | ifeq ($(HOST_IS_64_BIT),true) |
| 86 | ifeq ($(2ND_TARGET_IS_64_BIT),true) |
| 87 | GYP_HOST_VAR_PREFIX := |
| 88 | GYP_HOST_MULTILIB := 64 |
| 89 | else # Second target is 32-bit. |
| 90 | GYP_HOST_VAR_PREFIX := $(HOST_2ND_ARCH_VAR_PREFIX) |
| 91 | GYP_HOST_MULTILIB := 32 |
Torne (Richard Coles) | 54cd422 | 2014-04-03 15:40:12 +0100 | [diff] [blame] | 92 | endif |
Torne (Richard Coles) | 46d4c2b | 2014-06-09 12:00:27 +0100 | [diff] [blame] | 93 | endif |
| 94 | |
Primiano Tucci | 1320f92 | 2014-09-30 14:45:55 +0100 | [diff] [blame] | 95 | # Include the appropriate version of each of the makefiles. |
| 96 | include $(addsuffix .$(HOST_OS)-$(TARGET_2ND_ARCH).mk,$(GYP_MAKEFILE_STEMS)) |
Torne (Richard Coles) | 46d4c2b | 2014-06-09 12:00:27 +0100 | [diff] [blame] | 97 | |
| 98 | endif # End secondary architecture handling. |
Nagender Telkar | e0e33f0 | 2014-11-05 22:45:35 -0700 | [diff] [blame] | 99 | |
| 100 | include $(CLEAR_VARS) |
| 101 | LOCAL_COPY_HEADERS_TO := chromium_org/include |
| 102 | LOCAL_COPY_HEADERS := v8/include/v8-debug.h |
| 103 | LOCAL_COPY_HEADERS += v8/include/v8-platform.h |
| 104 | LOCAL_COPY_HEADERS += v8/include/v8-profiler.h |
| 105 | LOCAL_COPY_HEADERS += v8/include/v8-testing.h |
| 106 | LOCAL_COPY_HEADERS += v8/include/v8-util.h |
| 107 | LOCAL_COPY_HEADERS += v8/include/v8.h |
| 108 | LOCAL_COPY_HEADERS += v8/include/v8config.h |
| 109 | LOCAL_COPY_HEADERS += v8/include/v8stdint.h |
| 110 | include $(BUILD_COPY_HEADERS) |