blob: 7eb587cf37153f4aa3a0bfe99cd7db3161152e95 [file] [log] [blame]
Torne (Richard Coles)58218062012-11-14 11:43:16 +00001# 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 Murdochc5cede92014-04-10 11:22:14 +01006# gyp autogenerates most of the real makefiles, which we include below.
7
Primiano Tucci1320f922014-09-30 14:45:55 +01008LOCAL_PATH := $(call my-dir)
9CHROMIUM_DIR := $(LOCAL_PATH)
Torne (Richard Coles)58218062012-11-14 11:43:16 +000010
Ben Murdoch7dbb3d52013-07-17 14:55:54 +010011# We default to release for the Android build system. Developers working on
12# WebView code can build with "make GYP_CONFIGURATION=Debug".
Ben Murdocheb525c52013-07-10 11:40:50 +010013GYP_CONFIGURATION := Release
Ben Murdocheb525c52013-07-10 11:40:50 +010014
Primiano Tucci1320f922014-09-30 14:45:55 +010015# 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.
18ifeq ($(PRODUCT_PREBUILT_WEBVIEWCHROMIUM),yes)
19GYP_MAKEFILE_STEMS := \
20 $(addprefix $(CHROMIUM_DIR)/v8/tools/gyp/, \
Primiano Tucci1320f922014-09-30 14:45:55 +010021 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 Tucci1320f922014-09-30 14:45:55 +010036 )
37else
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 Murdochc5cede92014-04-10 11:22:14 +010040include $(CHROMIUM_DIR)/android_webview/Android.mk
Primiano Tucci1320f922014-09-30 14:45:55 +010041GYP_MAKEFILE_STEMS := $(CHROMIUM_DIR)/GypAndroid
42endif
Torne (Richard Coles)54cd4222014-04-03 15:40:12 +010043
Ben Murdochc5cede92014-04-10 11:22:14 +010044# 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)46d4c2b2014-06-09 12:00:27 +010047ifneq (,$(wildcard $(CHROMIUM_DIR)/GypAndroid.$(HOST_OS)-$(TARGET_ARCH).mk))
48
Ben Murdochc5cede92014-04-10 11:22:14 +010049# We set GYP_VAR_PREFIX to the empty string to indicate that we are building for
50# the primary target architecture.
Torne (Richard Coles)54cd4222014-04-03 15:40:12 +010051GYP_VAR_PREFIX :=
Torne (Richard Coles)46d4c2b2014-06-09 12:00:27 +010052
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.
56ifeq ($(HOST_IS_64_BIT),true)
57ifeq ($(TARGET_IS_64_BIT),true)
58GYP_HOST_VAR_PREFIX :=
59GYP_HOST_MULTILIB := 64
60else # Target is 32-bit.
61GYP_HOST_VAR_PREFIX := $(HOST_2ND_ARCH_VAR_PREFIX)
62GYP_HOST_MULTILIB := 32
Torne (Richard Coles)54cd4222014-04-03 15:40:12 +010063endif
Torne (Richard Coles)46d4c2b2014-06-09 12:00:27 +010064endif
65
Primiano Tucci1320f922014-09-30 14:45:55 +010066# Include the appropriate version of each of the makefiles.
67include $(addsuffix .$(HOST_OS)-$(TARGET_ARCH).mk,$(GYP_MAKEFILE_STEMS))
Torne (Richard Coles)46d4c2b2014-06-09 12:00:27 +010068
69endif # End primary architecture handling.
Torne (Richard Coles)54cd4222014-04-03 15:40:12 +010070
Ben Murdochc5cede92014-04-10 11:22:14 +010071# 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)46d4c2b2014-06-09 12:00:27 +010074ifneq (,$(wildcard $(CHROMIUM_DIR)/GypAndroid.$(HOST_OS)-$(TARGET_2ND_ARCH).mk))
75
Ben Murdochc5cede92014-04-10 11:22:14 +010076# 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)54cd4222014-04-03 15:40:12 +010078GYP_VAR_PREFIX := $(TARGET_2ND_ARCH_VAR_PREFIX)
Torne (Richard Coles)46d4c2b2014-06-09 12:00:27 +010079
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.
83ifeq ($(HOST_IS_64_BIT),true)
84ifeq ($(2ND_TARGET_IS_64_BIT),true)
85GYP_HOST_VAR_PREFIX :=
86GYP_HOST_MULTILIB := 64
87else # Second target is 32-bit.
88GYP_HOST_VAR_PREFIX := $(HOST_2ND_ARCH_VAR_PREFIX)
89GYP_HOST_MULTILIB := 32
Torne (Richard Coles)54cd4222014-04-03 15:40:12 +010090endif
Torne (Richard Coles)46d4c2b2014-06-09 12:00:27 +010091endif
92
Primiano Tucci1320f922014-09-30 14:45:55 +010093# Include the appropriate version of each of the makefiles.
94include $(addsuffix .$(HOST_OS)-$(TARGET_2ND_ARCH).mk,$(GYP_MAKEFILE_STEMS))
Torne (Richard Coles)46d4c2b2014-06-09 12:00:27 +010095
96endif # End secondary architecture handling.