Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2011 The Android Open Source Project |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | # |
| 16 | |
Igor Murashkin | 3774335 | 2014-11-13 14:38:00 -0800 | [diff] [blame] | 17 | ifndef ART_ANDROID_COMMON_PATH_MK |
| 18 | ART_ANDROID_COMMON_PATH_MK := true |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 19 | |
Martin Stjernholm | 21dafaf | 2021-02-17 20:39:45 +0000 | [diff] [blame] | 20 | # We cannot build things that require host core images from prebuilts, because |
| 21 | # they aren't present there. Set up a variable to skip all build rules that |
| 22 | # relate to them, because `m checkbuild` complains on rules with nonexisting |
| 23 | # dependencies, even if they won't get called. |
| 24 | # TODO(b/172480617): Remove this when ART sources are no longer in platform manifests. |
| 25 | ifeq (true,$(SOONG_CONFIG_art_module_source_build)) |
| 26 | my_art_module_source_build := true |
| 27 | else ifeq (false,$(SOONG_CONFIG_art_module_source_build)) |
| 28 | my_art_module_source_build := false |
| 29 | else |
| 30 | $(error SOONG_CONFIG_art_module_source_build is neither true nor false - mk file ordering problem?) |
| 31 | endif |
| 32 | |
Martin Stjernholm | 1dc77ab | 2021-05-10 17:44:05 +0100 | [diff] [blame^] | 33 | ifeq (true,$(my_art_module_source_build)) |
| 34 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 35 | include art/build/Android.common.mk |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 36 | include art/build/Android.common_build.mk |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 37 | |
| 38 | # Directory used for dalvik-cache on device. |
| 39 | ART_TARGET_DALVIK_CACHE_DIR := /data/dalvik-cache |
| 40 | |
| 41 | # Directory used for gtests on device. |
Andreas Gampe | 1fe5e5c | 2014-07-11 21:14:35 -0700 | [diff] [blame] | 42 | # $(TARGET_OUT_DATA_NATIVE_TESTS) will evaluate to the nativetest directory in the target part on |
| 43 | # the host, so we can strip everything but the directory to find out whether it is "nativetest" or |
| 44 | # "nativetest64." |
| 45 | ART_TARGET_NATIVETEST_DIR := /data/$(notdir $(TARGET_OUT_DATA_NATIVE_TESTS))/art |
| 46 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 47 | ART_TARGET_NATIVETEST_OUT := $(TARGET_OUT_DATA_NATIVE_TESTS)/art |
| 48 | |
| 49 | # Directory used for oat tests on device. |
| 50 | ART_TARGET_TEST_DIR := /data/art-test |
| 51 | ART_TARGET_TEST_OUT := $(TARGET_OUT_DATA)/art-test |
| 52 | |
Vladimir Marko | 0ace563 | 2018-12-14 11:11:47 +0000 | [diff] [blame] | 53 | # Modules to compile for core.art. |
Victor Chang | d20e51d | 2020-05-05 16:01:19 +0100 | [diff] [blame] | 54 | CORE_IMG_JARS := core-oj core-libart okhttp bouncycastle apache-xml |
Vladimir Marko | 0ace563 | 2018-12-14 11:11:47 +0000 | [diff] [blame] | 55 | HOST_CORE_IMG_JARS := $(addsuffix -hostdex,$(CORE_IMG_JARS)) |
Nicolas Geoffray | 31e0dc2 | 2020-03-20 15:48:09 +0000 | [diff] [blame] | 56 | TARGET_CORE_IMG_JARS := $(CORE_IMG_JARS) |
Vladimir Marko | 0ace563 | 2018-12-14 11:11:47 +0000 | [diff] [blame] | 57 | HOST_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(HOST_CORE_IMG_JARS), $(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar) |
| 58 | ifeq ($(ART_TEST_ANDROID_ROOT),) |
Nicolas Geoffray | a144c27 | 2019-02-20 12:03:53 +0000 | [diff] [blame] | 59 | TARGET_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(TARGET_CORE_IMG_JARS),/$(ART_DEXPREOPT_BOOT_JAR_DIR)/$(jar).jar) |
Vladimir Marko | 0ace563 | 2018-12-14 11:11:47 +0000 | [diff] [blame] | 60 | else |
| 61 | TARGET_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(TARGET_CORE_IMG_JARS),$(ART_TEST_ANDROID_ROOT)/$(jar).jar) |
| 62 | endif |
| 63 | HOST_CORE_IMG_DEX_FILES := $(foreach jar,$(HOST_CORE_IMG_JARS), $(call intermediates-dir-for,JAVA_LIBRARIES,$(jar),t,COMMON)/javalib.jar) |
Nicolas Geoffray | 31e0dc2 | 2020-03-20 15:48:09 +0000 | [diff] [blame] | 64 | TARGET_CORE_IMG_DEX_FILES := $(foreach jar,$(TARGET_CORE_IMG_JARS),$(call intermediates-dir-for,JAVA_LIBRARIES,$(jar).com.android.art.testing, ,COMMON)/javalib.jar) |
Vladimir Marko | 0ace563 | 2018-12-14 11:11:47 +0000 | [diff] [blame] | 65 | |
David Srbecky | 0c0f302 | 2020-02-13 15:53:01 +0000 | [diff] [blame] | 66 | # Also copy the jar files next to host boot.art image. |
| 67 | HOST_BOOT_IMAGE_JARS := $(foreach jar,$(CORE_IMG_JARS),$(HOST_OUT)/apex/com.android.art/javalib/$(jar).jar) |
| 68 | $(HOST_BOOT_IMAGE_JARS): $(HOST_OUT)/apex/com.android.art/javalib/%.jar : $(HOST_OUT_JAVA_LIBRARIES)/%-hostdex.jar |
| 69 | $(copy-file-to-target) |
Martin Stjernholm | 21dafaf | 2021-02-17 20:39:45 +0000 | [diff] [blame] | 70 | |
David Srbecky | 0c0f302 | 2020-02-13 15:53:01 +0000 | [diff] [blame] | 71 | HOST_BOOT_IMAGE_JARS += $(HOST_OUT)/apex/com.android.conscrypt/javalib/conscrypt.jar |
| 72 | $(HOST_OUT)/apex/com.android.conscrypt/javalib/conscrypt.jar : $(HOST_OUT_JAVA_LIBRARIES)/conscrypt-hostdex.jar |
| 73 | $(copy-file-to-target) |
Victor Chang | d20e51d | 2020-05-05 16:01:19 +0100 | [diff] [blame] | 74 | HOST_BOOT_IMAGE_JARS += $(HOST_OUT)/apex/com.android.i18n/javalib/core-icu4j.jar |
| 75 | $(HOST_OUT)/apex/com.android.i18n/javalib/core-icu4j.jar : $(HOST_OUT_JAVA_LIBRARIES)/core-icu4j-hostdex.jar |
| 76 | $(copy-file-to-target) |
David Srbecky | 0c0f302 | 2020-02-13 15:53:01 +0000 | [diff] [blame] | 77 | |
David Srbecky | 42df1c7 | 2020-04-07 15:53:47 +0100 | [diff] [blame] | 78 | HOST_CORE_IMG_OUTS += $(HOST_BOOT_IMAGE_JARS) $(HOST_BOOT_IMAGE) $(2ND_HOST_BOOT_IMAGE) |
| 79 | |
Victor Chang | d20e51d | 2020-05-05 16:01:19 +0100 | [diff] [blame] | 80 | HOST_TEST_CORE_JARS := $(addsuffix -hostdex,$(CORE_IMG_JARS) core-icu4j conscrypt) |
Vladimir Marko | 7a85e70 | 2018-12-03 18:47:23 +0000 | [diff] [blame] | 81 | ART_HOST_DEX_DEPENDENCIES := $(foreach jar,$(HOST_TEST_CORE_JARS),$(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar) |
Victor Chang | d20e51d | 2020-05-05 16:01:19 +0100 | [diff] [blame] | 82 | ART_TARGET_DEX_DEPENDENCIES := com.android.art.testing com.android.conscrypt com.android.i18n |
Richard Uhler | c5a0004 | 2016-07-01 13:10:56 -0700 | [diff] [blame] | 83 | |
Victor Chang | d20e51d | 2020-05-05 16:01:19 +0100 | [diff] [blame] | 84 | ART_CORE_SHARED_LIBRARIES := libjavacore libopenjdk libopenjdkjvm libopenjdkjvmti |
Alex Light | 7b497ee | 2017-05-25 09:54:15 -0700 | [diff] [blame] | 85 | ART_CORE_SHARED_DEBUG_LIBRARIES := libopenjdkd libopenjdkjvmd libopenjdkjvmtid |
Nicolas Geoffray | c69b3f8 | 2020-06-22 12:33:38 +0000 | [diff] [blame] | 86 | ART_HOST_CORE_SHARED_LIBRARIES := $(ART_CORE_SHARED_LIBRARIES) libicuuc-host libicui18n-host libicu_jni |
Victor Chang | d20e51d | 2020-05-05 16:01:19 +0100 | [diff] [blame] | 87 | ART_HOST_SHARED_LIBRARY_DEPENDENCIES := $(foreach lib,$(ART_HOST_CORE_SHARED_LIBRARIES), $(ART_HOST_OUT_SHARED_LIBRARIES)/$(lib)$(ART_HOST_SHLIB_EXTENSION)) |
Alex Light | 7b497ee | 2017-05-25 09:54:15 -0700 | [diff] [blame] | 88 | ART_HOST_SHARED_LIBRARY_DEBUG_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(ART_HOST_OUT_SHARED_LIBRARIES)/$(lib)$(ART_HOST_SHLIB_EXTENSION)) |
Richard Uhler | c5a0004 | 2016-07-01 13:10:56 -0700 | [diff] [blame] | 89 | ifdef HOST_2ND_ARCH |
Victor Chang | d20e51d | 2020-05-05 16:01:19 +0100 | [diff] [blame] | 90 | ART_HOST_SHARED_LIBRARY_DEPENDENCIES += $(foreach lib,$(ART_HOST_CORE_SHARED_LIBRARIES), $(2ND_HOST_OUT_SHARED_LIBRARIES)/$(lib).so) |
Alex Light | 7b497ee | 2017-05-25 09:54:15 -0700 | [diff] [blame] | 91 | ART_HOST_SHARED_LIBRARY_DEBUG_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(2ND_HOST_OUT_SHARED_LIBRARIES)/$(lib).so) |
Richard Uhler | c5a0004 | 2016-07-01 13:10:56 -0700 | [diff] [blame] | 92 | endif |
| 93 | |
Jiyong Park | 066dd902 | 2019-12-19 02:11:59 +0000 | [diff] [blame] | 94 | # Both the primary and the secondary arches of the libs are built by depending |
| 95 | # on the module name. |
| 96 | ART_DEBUG_TARGET_SHARED_LIBRARY_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_LIBRARIES), $(lib).com.android.art.debug) |
Alex Light | 7b497ee | 2017-05-25 09:54:15 -0700 | [diff] [blame] | 97 | ART_TARGET_SHARED_LIBRARY_DEBUG_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(TARGET_OUT_SHARED_LIBRARIES)/$(lib).so) |
Richard Uhler | c5a0004 | 2016-07-01 13:10:56 -0700 | [diff] [blame] | 98 | ifdef TARGET_2ND_ARCH |
Alex Light | 7b497ee | 2017-05-25 09:54:15 -0700 | [diff] [blame] | 99 | ART_TARGET_SHARED_LIBRARY_DEBUG_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(2ND_TARGET_OUT_SHARED_LIBRARIES)/$(lib).so) |
Richard Uhler | c5a0004 | 2016-07-01 13:10:56 -0700 | [diff] [blame] | 100 | endif |
| 101 | |
Colin Cross | 02a7335 | 2016-09-13 16:47:02 -0700 | [diff] [blame] | 102 | ART_CORE_DEBUGGABLE_EXECUTABLES := \ |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 103 | dex2oat \ |
Calin Juravle | 36eb313 | 2017-01-13 16:32:38 -0800 | [diff] [blame] | 104 | dexoptanalyzer \ |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 105 | imgdiag \ |
| 106 | oatdump \ |
Orion Hodson | 4c3ade6 | 2021-02-10 14:07:10 +0000 | [diff] [blame] | 107 | odrefresh \ |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 108 | profman \ |
| 109 | |
Colin Cross | 02a7335 | 2016-09-13 16:47:02 -0700 | [diff] [blame] | 110 | ART_CORE_EXECUTABLES := \ |
| 111 | dalvikvm \ |
| 112 | dexlist \ |
| 113 | |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 114 | # Depend on the -target or -host phony targets generated by the build system |
| 115 | # for each module |
Colin Cross | 02a7335 | 2016-09-13 16:47:02 -0700 | [diff] [blame] | 116 | ART_TARGET_EXECUTABLES := |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 117 | ifneq ($(ART_BUILD_TARGET_NDEBUG),false) |
Colin Cross | 02a7335 | 2016-09-13 16:47:02 -0700 | [diff] [blame] | 118 | ART_TARGET_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES) $(ART_CORE_DEBUGGABLE_EXECUTABLES),$(name)-target) |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 119 | endif |
| 120 | ifneq ($(ART_BUILD_TARGET_DEBUG),false) |
Colin Cross | 02a7335 | 2016-09-13 16:47:02 -0700 | [diff] [blame] | 121 | ART_TARGET_EXECUTABLES += $(foreach name,$(ART_CORE_DEBUGGABLE_EXECUTABLES),$(name)d-target) |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 122 | endif |
| 123 | |
Colin Cross | 02a7335 | 2016-09-13 16:47:02 -0700 | [diff] [blame] | 124 | ART_HOST_EXECUTABLES := |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 125 | ifneq ($(ART_BUILD_HOST_NDEBUG),false) |
Colin Cross | 02a7335 | 2016-09-13 16:47:02 -0700 | [diff] [blame] | 126 | ART_HOST_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES) $(ART_CORE_DEBUGGABLE_EXECUTABLES),$(name)-host) |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 127 | endif |
| 128 | ifneq ($(ART_BUILD_HOST_DEBUG),false) |
Colin Cross | 02a7335 | 2016-09-13 16:47:02 -0700 | [diff] [blame] | 129 | ART_HOST_EXECUTABLES += $(foreach name,$(ART_CORE_DEBUGGABLE_EXECUTABLES),$(name)d-host) |
Colin Cross | 3196360 | 2016-08-30 16:18:42 -0700 | [diff] [blame] | 130 | endif |
| 131 | |
Martin Stjernholm | 84e5bb9 | 2019-09-05 19:56:46 +0100 | [diff] [blame] | 132 | # Release ART APEX, included by default in "user" builds. |
Martin Stjernholm | 3e9abfc | 2020-10-09 22:17:51 +0100 | [diff] [blame] | 133 | RELEASE_ART_APEX := com.android.art |
Martin Stjernholm | 84e5bb9 | 2019-09-05 19:56:46 +0100 | [diff] [blame] | 134 | # Debug ART APEX, included by default in "userdebug" and "eng" |
Roland Levillain | 8d5a215 | 2019-07-02 19:40:28 +0100 | [diff] [blame] | 135 | # builds and used in ART device benchmarking. |
Martin Stjernholm | 84e5bb9 | 2019-09-05 19:56:46 +0100 | [diff] [blame] | 136 | DEBUG_ART_APEX := com.android.art.debug |
| 137 | # Testing ART APEX, used in ART device testing. |
| 138 | TESTING_ART_APEX := com.android.art.testing |
Roland Levillain | f0b1de8 | 2019-07-02 19:25:58 +0100 | [diff] [blame] | 139 | |
Martin Stjernholm | 4bb9f67 | 2020-05-19 01:33:47 +0100 | [diff] [blame] | 140 | RUNTIME_APEX := com.android.runtime |
Orion Hodson | c4d13ae | 2020-01-07 12:46:25 +0000 | [diff] [blame] | 141 | CONSCRYPT_APEX := com.android.conscrypt |
Victor Chang | d20e51d | 2020-05-05 16:01:19 +0100 | [diff] [blame] | 142 | I18N_APEX := com.android.i18n |
Martin Stjernholm | 4e01411 | 2021-03-08 14:24:44 +0000 | [diff] [blame] | 143 | STATSD_APEX := com.android.os.statsd |
Nicolas Geoffray | caac87a | 2021-01-11 09:51:03 +0000 | [diff] [blame] | 144 | TZDATA_APEX := com.android.tzdata |
Orion Hodson | c4d13ae | 2020-01-07 12:46:25 +0000 | [diff] [blame] | 145 | |
Nicolas Geoffray | 5ece8ff | 2020-07-29 18:20:59 +0100 | [diff] [blame] | 146 | # A phony file to create the ICU data file for host. |
Nicolas Geoffray | 1525960 | 2020-07-30 09:31:15 +0100 | [diff] [blame] | 147 | HOST_I18N_DATA := $(HOST_OUT)/$(I18N_APEX)/timestamp |
Nicolas Geoffray | caac87a | 2021-01-11 09:51:03 +0000 | [diff] [blame] | 148 | # A phony file to create the tz data file for host. |
| 149 | HOST_TZDATA_DATA := $(HOST_OUT)/$(TZDATA_APEX)/timestamp |
Nicolas Geoffray | 5ece8ff | 2020-07-29 18:20:59 +0100 | [diff] [blame] | 150 | |
Martin Stjernholm | 1dc77ab | 2021-05-10 17:44:05 +0100 | [diff] [blame^] | 151 | endif # ifeq (true,$(my_art_module_source_build)) |
| 152 | |
Igor Murashkin | 3774335 | 2014-11-13 14:38:00 -0800 | [diff] [blame] | 153 | endif # ART_ANDROID_COMMON_PATH_MK |