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 \ |
| 25 | v8_nosnapshot.host \ |
| 26 | v8_base.target \ |
| 27 | v8_libbase.target \ |
| 28 | v8_snapshot.target \ |
| 29 | ) \ |
| 30 | $(addprefix $(CHROMIUM_DIR)/third_party/icu/, \ |
| 31 | icudata.host \ |
| 32 | icui18n.host \ |
| 33 | icuuc.host \ |
| 34 | icui18n.target \ |
| 35 | icuuc.target \ |
Primiano Tucci | 1320f92 | 2014-09-30 14:45:55 +0100 | [diff] [blame] | 36 | ) |
| 37 | else |
| 38 | # Not using a prebuilt; include the manually-written makefile that builds all |
| 39 | # the WebView java code, and use the main autogenerated makefile. |
Ben Murdoch | c5cede9 | 2014-04-10 11:22:14 +0100 | [diff] [blame] | 40 | include $(CHROMIUM_DIR)/android_webview/Android.mk |
Primiano Tucci | 1320f92 | 2014-09-30 14:45:55 +0100 | [diff] [blame] | 41 | GYP_MAKEFILE_STEMS := $(CHROMIUM_DIR)/GypAndroid |
| 42 | endif |
Torne (Richard Coles) | 54cd422 | 2014-04-03 15:40:12 +0100 | [diff] [blame] | 43 | |
Ben Murdoch | c5cede9 | 2014-04-10 11:22:14 +0100 | [diff] [blame] | 44 | # If the gyp-generated makefile exists for the current host OS and primary |
| 45 | # target architecture, we need to include it. If it doesn't exist then just do |
| 46 | # 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] | 47 | ifneq (,$(wildcard $(CHROMIUM_DIR)/GypAndroid.$(HOST_OS)-$(TARGET_ARCH).mk)) |
| 48 | |
Ben Murdoch | c5cede9 | 2014-04-10 11:22:14 +0100 | [diff] [blame] | 49 | # We set GYP_VAR_PREFIX to the empty string to indicate that we are building for |
| 50 | # the primary target architecture. |
Torne (Richard Coles) | 54cd422 | 2014-04-03 15:40:12 +0100 | [diff] [blame] | 51 | GYP_VAR_PREFIX := |
Torne (Richard Coles) | 46d4c2b | 2014-06-09 12:00:27 +0100 | [diff] [blame] | 52 | |
| 53 | # If the host is declared as being 64-bit, set the host multilib variables |
| 54 | # appropriately to ensure that the host targets are the same "bitness" as the |
| 55 | # primary target, which is required by V8. |
| 56 | ifeq ($(HOST_IS_64_BIT),true) |
| 57 | ifeq ($(TARGET_IS_64_BIT),true) |
| 58 | GYP_HOST_VAR_PREFIX := |
| 59 | GYP_HOST_MULTILIB := 64 |
| 60 | else # Target is 32-bit. |
| 61 | GYP_HOST_VAR_PREFIX := $(HOST_2ND_ARCH_VAR_PREFIX) |
| 62 | GYP_HOST_MULTILIB := 32 |
Torne (Richard Coles) | 54cd422 | 2014-04-03 15:40:12 +0100 | [diff] [blame] | 63 | endif |
Torne (Richard Coles) | 46d4c2b | 2014-06-09 12:00:27 +0100 | [diff] [blame] | 64 | endif |
| 65 | |
Primiano Tucci | 1320f92 | 2014-09-30 14:45:55 +0100 | [diff] [blame] | 66 | # Include the appropriate version of each of the makefiles. |
| 67 | include $(addsuffix .$(HOST_OS)-$(TARGET_ARCH).mk,$(GYP_MAKEFILE_STEMS)) |
Torne (Richard Coles) | 46d4c2b | 2014-06-09 12:00:27 +0100 | [diff] [blame] | 68 | |
| 69 | endif # End primary architecture handling. |
Torne (Richard Coles) | 54cd422 | 2014-04-03 15:40:12 +0100 | [diff] [blame] | 70 | |
Ben Murdoch | c5cede9 | 2014-04-10 11:22:14 +0100 | [diff] [blame] | 71 | # Do the same check for the secondary architecture; if this doesn't exist then |
| 72 | # the current target platform probably doesn't have a secondary architecture and |
| 73 | # we can just do nothing. |
Torne (Richard Coles) | 46d4c2b | 2014-06-09 12:00:27 +0100 | [diff] [blame] | 74 | ifneq (,$(wildcard $(CHROMIUM_DIR)/GypAndroid.$(HOST_OS)-$(TARGET_2ND_ARCH).mk)) |
| 75 | |
Ben Murdoch | c5cede9 | 2014-04-10 11:22:14 +0100 | [diff] [blame] | 76 | # We set GYP_VAR_PREFIX to $(TARGET_2ND_ARCH_VAR_PREFIX) to indicate that we are |
| 77 | # building for the secondary target architecture. |
Torne (Richard Coles) | 54cd422 | 2014-04-03 15:40:12 +0100 | [diff] [blame] | 78 | GYP_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX) |
Torne (Richard Coles) | 46d4c2b | 2014-06-09 12:00:27 +0100 | [diff] [blame] | 79 | |
| 80 | # If the host is declared as being 64-bit, set the host multilib variables |
| 81 | # appropriately to ensure that the host targets are the same "bitness" as the |
| 82 | # secondary target, which is required by V8. |
| 83 | ifeq ($(HOST_IS_64_BIT),true) |
| 84 | ifeq ($(2ND_TARGET_IS_64_BIT),true) |
| 85 | GYP_HOST_VAR_PREFIX := |
| 86 | GYP_HOST_MULTILIB := 64 |
| 87 | else # Second target is 32-bit. |
| 88 | GYP_HOST_VAR_PREFIX := $(HOST_2ND_ARCH_VAR_PREFIX) |
| 89 | GYP_HOST_MULTILIB := 32 |
Torne (Richard Coles) | 54cd422 | 2014-04-03 15:40:12 +0100 | [diff] [blame] | 90 | endif |
Torne (Richard Coles) | 46d4c2b | 2014-06-09 12:00:27 +0100 | [diff] [blame] | 91 | endif |
| 92 | |
Primiano Tucci | 1320f92 | 2014-09-30 14:45:55 +0100 | [diff] [blame] | 93 | # Include the appropriate version of each of the makefiles. |
| 94 | include $(addsuffix .$(HOST_OS)-$(TARGET_2ND_ARCH).mk,$(GYP_MAKEFILE_STEMS)) |
Torne (Richard Coles) | 46d4c2b | 2014-06-09 12:00:27 +0100 | [diff] [blame] | 95 | |
| 96 | endif # End secondary architecture handling. |