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 17ifndef ART_ANDROID_COMMON_PATH_MK 18ART_ANDROID_COMMON_PATH_MK := true 19 20include art/build/Android.common.mk 21include art/build/Android.common_build.mk 22 23# Directory used for dalvik-cache on device. 24ART_TARGET_DALVIK_CACHE_DIR := /data/dalvik-cache 25 26# Directory used for gtests on device. 27# $(TARGET_OUT_DATA_NATIVE_TESTS) will evaluate to the nativetest directory in the target part on 28# the host, so we can strip everything but the directory to find out whether it is "nativetest" or 29# "nativetest64." 30ART_TARGET_NATIVETEST_DIR := /data/$(notdir $(TARGET_OUT_DATA_NATIVE_TESTS))/art 31 32ART_TARGET_NATIVETEST_OUT := $(TARGET_OUT_DATA_NATIVE_TESTS)/art 33 34# Directory used for oat tests on device. 35ART_TARGET_TEST_DIR := /data/art-test 36ART_TARGET_TEST_OUT := $(TARGET_OUT_DATA)/art-test 37 38# Modules to compile for core.art. 39CORE_IMG_JARS := core-oj core-libart okhttp bouncycastle apache-xml 40HOST_CORE_IMG_JARS := $(addsuffix -hostdex,$(CORE_IMG_JARS)) 41TARGET_CORE_IMG_JARS := $(CORE_IMG_JARS) 42HOST_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(HOST_CORE_IMG_JARS), $(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar) 43ifeq ($(ART_TEST_ANDROID_ROOT),) 44TARGET_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(TARGET_CORE_IMG_JARS),/$(ART_DEXPREOPT_BOOT_JAR_DIR)/$(jar).jar) 45else 46TARGET_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(TARGET_CORE_IMG_JARS),$(ART_TEST_ANDROID_ROOT)/$(jar).jar) 47endif 48HOST_CORE_IMG_DEX_FILES := $(foreach jar,$(HOST_CORE_IMG_JARS), $(call intermediates-dir-for,JAVA_LIBRARIES,$(jar),t,COMMON)/javalib.jar) 49TARGET_CORE_IMG_DEX_FILES := $(foreach jar,$(TARGET_CORE_IMG_JARS),$(call intermediates-dir-for,JAVA_LIBRARIES,$(jar).com.android.art.testing, ,COMMON)/javalib.jar) 50 51# Also copy the jar files next to host boot.art image. 52# `dexpreopt_bootjars.go` uses a single source of input regardless of variants, so we should use the 53# same source for `CORE_IMG_JARS` to avoid checksum mismatches on the oat files. 54HOST_BOOT_IMAGE_JARS := $(foreach jar,$(CORE_IMG_JARS),$(HOST_OUT)/apex/com.android.art/javalib/$(jar).jar) 55CORE_IMG_JAR_DIR := $(OUT_DIR)/soong/dexpreopt_$(TARGET_ARCH)/dex_artjars_input 56$(HOST_BOOT_IMAGE_JARS): $(HOST_OUT)/apex/com.android.art/javalib/%.jar : $(CORE_IMG_JAR_DIR)/%.jar 57 $(copy-file-to-target) 58 59# We can still use the host variant of `conscrypt` and `core-icu4j` because they don't go into the 60# primary boot image that is used in host gtests, and hence can't lead to checksum mismatches. 61HOST_BOOT_IMAGE_JARS += $(HOST_OUT)/apex/com.android.conscrypt/javalib/conscrypt.jar 62$(HOST_OUT)/apex/com.android.conscrypt/javalib/conscrypt.jar : $(HOST_OUT_JAVA_LIBRARIES)/conscrypt-hostdex.jar 63 $(copy-file-to-target) 64HOST_BOOT_IMAGE_JARS += $(HOST_OUT)/apex/com.android.i18n/javalib/core-icu4j.jar 65$(HOST_OUT)/apex/com.android.i18n/javalib/core-icu4j.jar : $(HOST_OUT_JAVA_LIBRARIES)/core-icu4j-hostdex.jar 66 $(copy-file-to-target) 67 68HOST_CORE_IMG_OUTS += $(HOST_BOOT_IMAGE_JARS) $(HOST_BOOT_IMAGE) $(2ND_HOST_BOOT_IMAGE) 69 70HOST_TEST_CORE_JARS := $(addsuffix -hostdex,$(CORE_IMG_JARS) core-icu4j conscrypt) 71ART_HOST_DEX_DEPENDENCIES := $(foreach jar,$(HOST_TEST_CORE_JARS),$(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar) 72ART_TARGET_DEX_DEPENDENCIES := com.android.art.testing com.android.conscrypt com.android.i18n 73 74ART_CORE_SHARED_LIBRARIES := libjavacore libopenjdk libopenjdkjvm libopenjdkjvmti libjdwp 75ART_CORE_SHARED_DEBUG_LIBRARIES := libopenjdkd libopenjdkjvmd libopenjdkjvmtid 76ART_HOST_CORE_SHARED_LIBRARIES := $(ART_CORE_SHARED_LIBRARIES) libicuuc-host libicui18n-host libicu_jni 77ART_HOST_SHARED_LIBRARY_DEPENDENCIES := $(foreach lib,$(ART_HOST_CORE_SHARED_LIBRARIES), $(ART_HOST_OUT_SHARED_LIBRARIES)/$(lib)$(ART_HOST_SHLIB_EXTENSION)) 78ART_HOST_SHARED_LIBRARY_DEBUG_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(ART_HOST_OUT_SHARED_LIBRARIES)/$(lib)$(ART_HOST_SHLIB_EXTENSION)) 79ifdef HOST_2ND_ARCH 80ART_HOST_SHARED_LIBRARY_DEPENDENCIES += $(foreach lib,$(ART_HOST_CORE_SHARED_LIBRARIES), $(2ND_HOST_OUT_SHARED_LIBRARIES)/$(lib).so) 81ART_HOST_SHARED_LIBRARY_DEBUG_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(2ND_HOST_OUT_SHARED_LIBRARIES)/$(lib).so) 82endif 83 84# Both the primary and the secondary arches of the libs are built by depending 85# on the module name. 86ART_DEBUG_TARGET_SHARED_LIBRARY_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_LIBRARIES), $(lib).com.android.art.debug) 87ART_TARGET_SHARED_LIBRARY_DEBUG_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(TARGET_OUT_SHARED_LIBRARIES)/$(lib).so) 88ifdef TARGET_2ND_ARCH 89ART_TARGET_SHARED_LIBRARY_DEBUG_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(2ND_TARGET_OUT_SHARED_LIBRARIES)/$(lib).so) 90endif 91 92ART_CORE_DEBUGGABLE_EXECUTABLES_COMMON := \ 93 dex2oat \ 94 dexoptanalyzer \ 95 imgdiag \ 96 oatdump \ 97 profman \ 98 99ART_CORE_DEBUGGABLE_EXECUTABLES_TARGET := $(ART_CORE_DEBUGGABLE_EXECUTABLES_COMMON) odrefresh 100ART_CORE_DEBUGGABLE_EXECUTABLES_HOST := $(ART_CORE_DEBUGGABLE_EXECUTABLES_COMMON) 101 102ART_CORE_EXECUTABLES := \ 103 dalvikvm \ 104 dexlist \ 105 106# Depend on the -target or -host phony targets generated by the build system 107# for each module 108ART_TARGET_EXECUTABLES := 109ifneq ($(ART_BUILD_TARGET_NDEBUG),false) 110ART_TARGET_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES) $(ART_CORE_DEBUGGABLE_EXECUTABLES_TARGET),$(name)-target) 111endif 112ifneq ($(ART_BUILD_TARGET_DEBUG),false) 113ART_TARGET_EXECUTABLES += $(foreach name,$(ART_CORE_DEBUGGABLE_EXECUTABLES_TARGET),$(name)d-target) 114endif 115 116ART_HOST_EXECUTABLES := 117ifneq ($(ART_BUILD_HOST_NDEBUG),false) 118ART_HOST_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES) $(ART_CORE_DEBUGGABLE_EXECUTABLES_HOST),$(name)-host) 119endif 120ifneq ($(ART_BUILD_HOST_DEBUG),false) 121ART_HOST_EXECUTABLES += $(foreach name,$(ART_CORE_DEBUGGABLE_EXECUTABLES_HOST),$(name)d-host) 122endif 123 124# Release ART APEX, included by default in "user" builds. 125RELEASE_ART_APEX := com.android.art 126# Debug ART APEX, included by default in "userdebug" and "eng" 127# builds and used in ART device benchmarking. 128DEBUG_ART_APEX := com.android.art.debug 129# Testing ART APEX, used in ART device testing. 130TESTING_ART_APEX := com.android.art.testing 131 132RUNTIME_APEX := com.android.runtime 133CONSCRYPT_APEX := com.android.conscrypt 134I18N_APEX := com.android.i18n 135STATSD_APEX := com.android.os.statsd 136TZDATA_APEX := com.android.tzdata 137 138# A phony file to create the ICU data file for host. 139HOST_I18N_DATA := $(HOST_OUT)/$(I18N_APEX)/timestamp 140# A phony file to create the tz data file for host. 141HOST_TZDATA_DATA := $(HOST_OUT)/$(TZDATA_APEX)/timestamp 142 143endif # ART_ANDROID_COMMON_PATH_MK 144