blob: d48551826d08ee0a908f8772a69172a1d751893b [file] [log] [blame]
Ian Rogersafd9acc2014-06-17 08:21:54 -07001#
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 Murashkin37743352014-11-13 14:38:00 -080017ifndef ART_ANDROID_COMMON_PATH_MK
18ART_ANDROID_COMMON_PATH_MK := true
Ian Rogersafd9acc2014-06-17 08:21:54 -070019
Martin Stjernholm21dafaf2021-02-17 20:39:45 +000020# 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.
25ifeq (true,$(SOONG_CONFIG_art_module_source_build))
26 my_art_module_source_build := true
27else ifeq (false,$(SOONG_CONFIG_art_module_source_build))
28 my_art_module_source_build := false
29else
30 $(error SOONG_CONFIG_art_module_source_build is neither true nor false - mk file ordering problem?)
31endif
32
Ian Rogersafd9acc2014-06-17 08:21:54 -070033include art/build/Android.common.mk
Colin Cross31963602016-08-30 16:18:42 -070034include art/build/Android.common_build.mk
Ian Rogersafd9acc2014-06-17 08:21:54 -070035
36# Directory used for dalvik-cache on device.
37ART_TARGET_DALVIK_CACHE_DIR := /data/dalvik-cache
38
39# Directory used for gtests on device.
Andreas Gampe1fe5e5c2014-07-11 21:14:35 -070040# $(TARGET_OUT_DATA_NATIVE_TESTS) will evaluate to the nativetest directory in the target part on
41# the host, so we can strip everything but the directory to find out whether it is "nativetest" or
42# "nativetest64."
43ART_TARGET_NATIVETEST_DIR := /data/$(notdir $(TARGET_OUT_DATA_NATIVE_TESTS))/art
44
Ian Rogersafd9acc2014-06-17 08:21:54 -070045ART_TARGET_NATIVETEST_OUT := $(TARGET_OUT_DATA_NATIVE_TESTS)/art
46
47# Directory used for oat tests on device.
48ART_TARGET_TEST_DIR := /data/art-test
49ART_TARGET_TEST_OUT := $(TARGET_OUT_DATA)/art-test
50
Vladimir Marko0ace5632018-12-14 11:11:47 +000051# Modules to compile for core.art.
Victor Changd20e51d2020-05-05 16:01:19 +010052CORE_IMG_JARS := core-oj core-libart okhttp bouncycastle apache-xml
Vladimir Marko0ace5632018-12-14 11:11:47 +000053HOST_CORE_IMG_JARS := $(addsuffix -hostdex,$(CORE_IMG_JARS))
Nicolas Geoffray31e0dc22020-03-20 15:48:09 +000054TARGET_CORE_IMG_JARS := $(CORE_IMG_JARS)
Vladimir Marko0ace5632018-12-14 11:11:47 +000055HOST_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(HOST_CORE_IMG_JARS), $(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar)
56ifeq ($(ART_TEST_ANDROID_ROOT),)
Nicolas Geoffraya144c272019-02-20 12:03:53 +000057TARGET_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(TARGET_CORE_IMG_JARS),/$(ART_DEXPREOPT_BOOT_JAR_DIR)/$(jar).jar)
Vladimir Marko0ace5632018-12-14 11:11:47 +000058else
59TARGET_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(TARGET_CORE_IMG_JARS),$(ART_TEST_ANDROID_ROOT)/$(jar).jar)
60endif
61HOST_CORE_IMG_DEX_FILES := $(foreach jar,$(HOST_CORE_IMG_JARS), $(call intermediates-dir-for,JAVA_LIBRARIES,$(jar),t,COMMON)/javalib.jar)
Nicolas Geoffray31e0dc22020-03-20 15:48:09 +000062TARGET_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 Marko0ace5632018-12-14 11:11:47 +000063
Martin Stjernholm21dafaf2021-02-17 20:39:45 +000064ifeq (true,$(my_art_module_source_build))
65
David Srbecky0c0f3022020-02-13 15:53:01 +000066# Also copy the jar files next to host boot.art image.
67HOST_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 Stjernholm21dafaf2021-02-17 20:39:45 +000070
David Srbecky0c0f3022020-02-13 15:53:01 +000071HOST_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 Changd20e51d2020-05-05 16:01:19 +010074HOST_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 Srbecky0c0f3022020-02-13 15:53:01 +000077
Martin Stjernholm21dafaf2021-02-17 20:39:45 +000078endif # ifeq (true,$(my_art_module_source_build))
79
David Srbecky42df1c72020-04-07 15:53:47 +010080HOST_CORE_IMG_OUTS += $(HOST_BOOT_IMAGE_JARS) $(HOST_BOOT_IMAGE) $(2ND_HOST_BOOT_IMAGE)
81
Victor Changd20e51d2020-05-05 16:01:19 +010082HOST_TEST_CORE_JARS := $(addsuffix -hostdex,$(CORE_IMG_JARS) core-icu4j conscrypt)
Vladimir Marko7a85e702018-12-03 18:47:23 +000083ART_HOST_DEX_DEPENDENCIES := $(foreach jar,$(HOST_TEST_CORE_JARS),$(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar)
Victor Changd20e51d2020-05-05 16:01:19 +010084ART_TARGET_DEX_DEPENDENCIES := com.android.art.testing com.android.conscrypt com.android.i18n
Richard Uhlerc5a00042016-07-01 13:10:56 -070085
Victor Changd20e51d2020-05-05 16:01:19 +010086ART_CORE_SHARED_LIBRARIES := libjavacore libopenjdk libopenjdkjvm libopenjdkjvmti
Alex Light7b497ee2017-05-25 09:54:15 -070087ART_CORE_SHARED_DEBUG_LIBRARIES := libopenjdkd libopenjdkjvmd libopenjdkjvmtid
Nicolas Geoffrayc69b3f82020-06-22 12:33:38 +000088ART_HOST_CORE_SHARED_LIBRARIES := $(ART_CORE_SHARED_LIBRARIES) libicuuc-host libicui18n-host libicu_jni
Victor Changd20e51d2020-05-05 16:01:19 +010089ART_HOST_SHARED_LIBRARY_DEPENDENCIES := $(foreach lib,$(ART_HOST_CORE_SHARED_LIBRARIES), $(ART_HOST_OUT_SHARED_LIBRARIES)/$(lib)$(ART_HOST_SHLIB_EXTENSION))
Alex Light7b497ee2017-05-25 09:54:15 -070090ART_HOST_SHARED_LIBRARY_DEBUG_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(ART_HOST_OUT_SHARED_LIBRARIES)/$(lib)$(ART_HOST_SHLIB_EXTENSION))
Richard Uhlerc5a00042016-07-01 13:10:56 -070091ifdef HOST_2ND_ARCH
Victor Changd20e51d2020-05-05 16:01:19 +010092ART_HOST_SHARED_LIBRARY_DEPENDENCIES += $(foreach lib,$(ART_HOST_CORE_SHARED_LIBRARIES), $(2ND_HOST_OUT_SHARED_LIBRARIES)/$(lib).so)
Alex Light7b497ee2017-05-25 09:54:15 -070093ART_HOST_SHARED_LIBRARY_DEBUG_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(2ND_HOST_OUT_SHARED_LIBRARIES)/$(lib).so)
Richard Uhlerc5a00042016-07-01 13:10:56 -070094endif
95
Jiyong Park066dd9022019-12-19 02:11:59 +000096# Both the primary and the secondary arches of the libs are built by depending
97# on the module name.
98ART_DEBUG_TARGET_SHARED_LIBRARY_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_LIBRARIES), $(lib).com.android.art.debug)
Alex Light7b497ee2017-05-25 09:54:15 -070099ART_TARGET_SHARED_LIBRARY_DEBUG_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(TARGET_OUT_SHARED_LIBRARIES)/$(lib).so)
Richard Uhlerc5a00042016-07-01 13:10:56 -0700100ifdef TARGET_2ND_ARCH
Alex Light7b497ee2017-05-25 09:54:15 -0700101ART_TARGET_SHARED_LIBRARY_DEBUG_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(2ND_TARGET_OUT_SHARED_LIBRARIES)/$(lib).so)
Richard Uhlerc5a00042016-07-01 13:10:56 -0700102endif
103
Colin Cross02a73352016-09-13 16:47:02 -0700104ART_CORE_DEBUGGABLE_EXECUTABLES := \
Colin Cross31963602016-08-30 16:18:42 -0700105 dex2oat \
Calin Juravle36eb3132017-01-13 16:32:38 -0800106 dexoptanalyzer \
Colin Cross31963602016-08-30 16:18:42 -0700107 imgdiag \
108 oatdump \
Orion Hodson4c3ade62021-02-10 14:07:10 +0000109 odrefresh \
Colin Cross31963602016-08-30 16:18:42 -0700110 profman \
111
Colin Cross02a73352016-09-13 16:47:02 -0700112ART_CORE_EXECUTABLES := \
113 dalvikvm \
114 dexlist \
115
Colin Cross31963602016-08-30 16:18:42 -0700116# Depend on the -target or -host phony targets generated by the build system
117# for each module
Colin Cross02a73352016-09-13 16:47:02 -0700118ART_TARGET_EXECUTABLES :=
Colin Cross31963602016-08-30 16:18:42 -0700119ifneq ($(ART_BUILD_TARGET_NDEBUG),false)
Colin Cross02a73352016-09-13 16:47:02 -0700120ART_TARGET_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES) $(ART_CORE_DEBUGGABLE_EXECUTABLES),$(name)-target)
Colin Cross31963602016-08-30 16:18:42 -0700121endif
122ifneq ($(ART_BUILD_TARGET_DEBUG),false)
Colin Cross02a73352016-09-13 16:47:02 -0700123ART_TARGET_EXECUTABLES += $(foreach name,$(ART_CORE_DEBUGGABLE_EXECUTABLES),$(name)d-target)
Colin Cross31963602016-08-30 16:18:42 -0700124endif
125
Colin Cross02a73352016-09-13 16:47:02 -0700126ART_HOST_EXECUTABLES :=
Colin Cross31963602016-08-30 16:18:42 -0700127ifneq ($(ART_BUILD_HOST_NDEBUG),false)
Colin Cross02a73352016-09-13 16:47:02 -0700128ART_HOST_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES) $(ART_CORE_DEBUGGABLE_EXECUTABLES),$(name)-host)
Colin Cross31963602016-08-30 16:18:42 -0700129endif
130ifneq ($(ART_BUILD_HOST_DEBUG),false)
Colin Cross02a73352016-09-13 16:47:02 -0700131ART_HOST_EXECUTABLES += $(foreach name,$(ART_CORE_DEBUGGABLE_EXECUTABLES),$(name)d-host)
Colin Cross31963602016-08-30 16:18:42 -0700132endif
133
Martin Stjernholm84e5bb92019-09-05 19:56:46 +0100134# Release ART APEX, included by default in "user" builds.
Martin Stjernholm3e9abfc2020-10-09 22:17:51 +0100135RELEASE_ART_APEX := com.android.art
Martin Stjernholm84e5bb92019-09-05 19:56:46 +0100136# Debug ART APEX, included by default in "userdebug" and "eng"
Roland Levillain8d5a2152019-07-02 19:40:28 +0100137# builds and used in ART device benchmarking.
Martin Stjernholm84e5bb92019-09-05 19:56:46 +0100138DEBUG_ART_APEX := com.android.art.debug
139# Testing ART APEX, used in ART device testing.
140TESTING_ART_APEX := com.android.art.testing
Roland Levillainf0b1de82019-07-02 19:25:58 +0100141
Martin Stjernholm4bb9f672020-05-19 01:33:47 +0100142RUNTIME_APEX := com.android.runtime
Orion Hodsonc4d13ae2020-01-07 12:46:25 +0000143CONSCRYPT_APEX := com.android.conscrypt
Victor Changd20e51d2020-05-05 16:01:19 +0100144I18N_APEX := com.android.i18n
Martin Stjernholm4e014112021-03-08 14:24:44 +0000145STATSD_APEX := com.android.os.statsd
Nicolas Geoffraycaac87a2021-01-11 09:51:03 +0000146TZDATA_APEX := com.android.tzdata
Orion Hodsonc4d13ae2020-01-07 12:46:25 +0000147
Nicolas Geoffray5ece8ff2020-07-29 18:20:59 +0100148# A phony file to create the ICU data file for host.
Nicolas Geoffray15259602020-07-30 09:31:15 +0100149HOST_I18N_DATA := $(HOST_OUT)/$(I18N_APEX)/timestamp
Nicolas Geoffraycaac87a2021-01-11 09:51:03 +0000150# A phony file to create the tz data file for host.
151HOST_TZDATA_DATA := $(HOST_OUT)/$(TZDATA_APEX)/timestamp
Nicolas Geoffray5ece8ff2020-07-29 18:20:59 +0100152
Igor Murashkin37743352014-11-13 14:38:00 -0800153endif # ART_ANDROID_COMMON_PATH_MK