1*795d594fSAndroid Build Coastguard Worker# 2*795d594fSAndroid Build Coastguard Worker# Copyright (C) 2011 The Android Open Source Project 3*795d594fSAndroid Build Coastguard Worker# 4*795d594fSAndroid Build Coastguard Worker# Licensed under the Apache License, Version 2.0 (the "License"); 5*795d594fSAndroid Build Coastguard Worker# you may not use this file except in compliance with the License. 6*795d594fSAndroid Build Coastguard Worker# You may obtain a copy of the License at 7*795d594fSAndroid Build Coastguard Worker# 8*795d594fSAndroid Build Coastguard Worker# http://www.apache.org/licenses/LICENSE-2.0 9*795d594fSAndroid Build Coastguard Worker# 10*795d594fSAndroid Build Coastguard Worker# Unless required by applicable law or agreed to in writing, software 11*795d594fSAndroid Build Coastguard Worker# distributed under the License is distributed on an "AS IS" BASIS, 12*795d594fSAndroid Build Coastguard Worker# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13*795d594fSAndroid Build Coastguard Worker# See the License for the specific language governing permissions and 14*795d594fSAndroid Build Coastguard Worker# limitations under the License. 15*795d594fSAndroid Build Coastguard Worker# 16*795d594fSAndroid Build Coastguard Worker 17*795d594fSAndroid Build Coastguard Workerifndef ART_ANDROID_COMMON_PATH_MK 18*795d594fSAndroid Build Coastguard WorkerART_ANDROID_COMMON_PATH_MK := true 19*795d594fSAndroid Build Coastguard Worker 20*795d594fSAndroid Build Coastguard Workerinclude art/build/Android.common.mk 21*795d594fSAndroid Build Coastguard Workerinclude art/build/Android.common_build.mk 22*795d594fSAndroid Build Coastguard Worker 23*795d594fSAndroid Build Coastguard Worker# Directory used for dalvik-cache on device. 24*795d594fSAndroid Build Coastguard WorkerART_TARGET_DALVIK_CACHE_DIR := /data/dalvik-cache 25*795d594fSAndroid Build Coastguard Worker 26*795d594fSAndroid Build Coastguard Worker# Directory used for gtests on device. 27*795d594fSAndroid Build Coastguard Worker# $(TARGET_OUT_DATA_NATIVE_TESTS) will evaluate to the nativetest directory in the target part on 28*795d594fSAndroid Build Coastguard Worker# the host, so we can strip everything but the directory to find out whether it is "nativetest" or 29*795d594fSAndroid Build Coastguard Worker# "nativetest64." 30*795d594fSAndroid Build Coastguard WorkerART_TARGET_NATIVETEST_DIR := /data/$(notdir $(TARGET_OUT_DATA_NATIVE_TESTS))/art 31*795d594fSAndroid Build Coastguard Worker 32*795d594fSAndroid Build Coastguard WorkerART_TARGET_NATIVETEST_OUT := $(TARGET_OUT_DATA_NATIVE_TESTS)/art 33*795d594fSAndroid Build Coastguard Worker 34*795d594fSAndroid Build Coastguard Worker# Directory used for oat tests on device. 35*795d594fSAndroid Build Coastguard WorkerART_TARGET_TEST_DIR := /data/art-test 36*795d594fSAndroid Build Coastguard WorkerART_TARGET_TEST_OUT := $(TARGET_OUT_DATA)/art-test 37*795d594fSAndroid Build Coastguard Worker 38*795d594fSAndroid Build Coastguard Worker# Modules to compile for core.art. 39*795d594fSAndroid Build Coastguard WorkerCORE_IMG_JARS := core-oj core-libart okhttp bouncycastle apache-xml 40*795d594fSAndroid Build Coastguard WorkerHOST_CORE_IMG_JARS := $(addsuffix -hostdex,$(CORE_IMG_JARS)) 41*795d594fSAndroid Build Coastguard WorkerTARGET_CORE_IMG_JARS := $(CORE_IMG_JARS) 42*795d594fSAndroid Build Coastguard WorkerHOST_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(HOST_CORE_IMG_JARS), $(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar) 43*795d594fSAndroid Build Coastguard Workerifeq ($(ART_TEST_ANDROID_ROOT),) 44*795d594fSAndroid Build Coastguard WorkerTARGET_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(TARGET_CORE_IMG_JARS),/$(ART_DEXPREOPT_BOOT_JAR_DIR)/$(jar).jar) 45*795d594fSAndroid Build Coastguard Workerelse 46*795d594fSAndroid Build Coastguard WorkerTARGET_CORE_IMG_DEX_LOCATIONS := $(foreach jar,$(TARGET_CORE_IMG_JARS),$(ART_TEST_ANDROID_ROOT)/$(jar).jar) 47*795d594fSAndroid Build Coastguard Workerendif 48*795d594fSAndroid Build Coastguard WorkerHOST_CORE_IMG_DEX_FILES := $(foreach jar,$(HOST_CORE_IMG_JARS), $(call intermediates-dir-for,JAVA_LIBRARIES,$(jar),t,COMMON)/javalib.jar) 49*795d594fSAndroid Build Coastguard WorkerTARGET_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*795d594fSAndroid Build Coastguard Worker 51*795d594fSAndroid Build Coastguard Worker# Also copy the jar files next to host boot.art image. 52*795d594fSAndroid Build Coastguard Worker# `dexpreopt_bootjars.go` uses a single source of input regardless of variants, so we should use the 53*795d594fSAndroid Build Coastguard Worker# same source for `CORE_IMG_JARS` to avoid checksum mismatches on the oat files. 54*795d594fSAndroid Build Coastguard WorkerHOST_BOOT_IMAGE_JARS := $(foreach jar,$(CORE_IMG_JARS),$(HOST_OUT)/apex/com.android.art/javalib/$(jar).jar) 55*795d594fSAndroid Build Coastguard WorkerCORE_IMG_JAR_DIR := $(OUT_DIR)/soong/dexpreopt_$(TARGET_ARCH)/dex_artjars_input 56*795d594fSAndroid Build Coastguard Worker$(HOST_BOOT_IMAGE_JARS): $(HOST_OUT)/apex/com.android.art/javalib/%.jar : $(CORE_IMG_JAR_DIR)/%.jar 57*795d594fSAndroid Build Coastguard Worker $(copy-file-to-target) 58*795d594fSAndroid Build Coastguard Worker 59*795d594fSAndroid Build Coastguard Worker# We can still use the host variant of `conscrypt` and `core-icu4j` because they don't go into the 60*795d594fSAndroid Build Coastguard Worker# primary boot image that is used in host gtests, and hence can't lead to checksum mismatches. 61*795d594fSAndroid Build Coastguard WorkerHOST_BOOT_IMAGE_JARS += $(HOST_OUT)/apex/com.android.conscrypt/javalib/conscrypt.jar 62*795d594fSAndroid Build Coastguard Worker$(HOST_OUT)/apex/com.android.conscrypt/javalib/conscrypt.jar : $(HOST_OUT_JAVA_LIBRARIES)/conscrypt-hostdex.jar 63*795d594fSAndroid Build Coastguard Worker $(copy-file-to-target) 64*795d594fSAndroid Build Coastguard WorkerHOST_BOOT_IMAGE_JARS += $(HOST_OUT)/apex/com.android.i18n/javalib/core-icu4j.jar 65*795d594fSAndroid Build Coastguard Worker$(HOST_OUT)/apex/com.android.i18n/javalib/core-icu4j.jar : $(HOST_OUT_JAVA_LIBRARIES)/core-icu4j-hostdex.jar 66*795d594fSAndroid Build Coastguard Worker $(copy-file-to-target) 67*795d594fSAndroid Build Coastguard Worker 68*795d594fSAndroid Build Coastguard WorkerHOST_CORE_IMG_OUTS += $(HOST_BOOT_IMAGE_JARS) 69*795d594fSAndroid Build Coastguard Worker 70*795d594fSAndroid Build Coastguard WorkerHOST_TEST_CORE_JARS := $(addsuffix -hostdex,$(CORE_IMG_JARS) core-icu4j conscrypt) 71*795d594fSAndroid Build Coastguard WorkerART_HOST_DEX_DEPENDENCIES := $(foreach jar,$(HOST_TEST_CORE_JARS),$(HOST_OUT_JAVA_LIBRARIES)/$(jar).jar) 72*795d594fSAndroid Build Coastguard WorkerART_TARGET_DEX_DEPENDENCIES := com.android.art.testing com.android.conscrypt com.android.i18n 73*795d594fSAndroid Build Coastguard Worker 74*795d594fSAndroid Build Coastguard WorkerART_CORE_SHARED_LIBRARIES := libjavacore libopenjdk libopenjdkjvm libopenjdkjvmti libjdwp 75*795d594fSAndroid Build Coastguard WorkerART_CORE_SHARED_DEBUG_LIBRARIES := libopenjdkd libopenjdkjvmd libopenjdkjvmtid 76*795d594fSAndroid Build Coastguard WorkerART_HOST_CORE_SHARED_LIBRARIES := $(ART_CORE_SHARED_LIBRARIES) libicuuc-host libicui18n-host libicu_jni 77*795d594fSAndroid Build Coastguard WorkerART_HOST_SHARED_LIBRARY_DEPENDENCIES := $(foreach lib,$(ART_HOST_CORE_SHARED_LIBRARIES), $(ART_HOST_OUT_SHARED_LIBRARIES)/$(lib)$(ART_HOST_SHLIB_EXTENSION)) 78*795d594fSAndroid Build Coastguard WorkerART_HOST_SHARED_LIBRARY_DEBUG_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(ART_HOST_OUT_SHARED_LIBRARIES)/$(lib)$(ART_HOST_SHLIB_EXTENSION)) 79*795d594fSAndroid Build Coastguard Workerifdef HOST_2ND_ARCH 80*795d594fSAndroid Build Coastguard WorkerART_HOST_SHARED_LIBRARY_DEPENDENCIES += $(foreach lib,$(ART_HOST_CORE_SHARED_LIBRARIES), $(2ND_HOST_OUT_SHARED_LIBRARIES)/$(lib).so) 81*795d594fSAndroid Build Coastguard WorkerART_HOST_SHARED_LIBRARY_DEBUG_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(2ND_HOST_OUT_SHARED_LIBRARIES)/$(lib).so) 82*795d594fSAndroid Build Coastguard Workerendif 83*795d594fSAndroid Build Coastguard Worker 84*795d594fSAndroid Build Coastguard Worker# Both the primary and the secondary arches of the libs are built by depending 85*795d594fSAndroid Build Coastguard Worker# on the module name. 86*795d594fSAndroid Build Coastguard WorkerART_DEBUG_TARGET_SHARED_LIBRARY_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_LIBRARIES), $(lib).com.android.art.debug) 87*795d594fSAndroid Build Coastguard WorkerART_TARGET_SHARED_LIBRARY_DEBUG_DEPENDENCIES := $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(TARGET_OUT_SHARED_LIBRARIES)/$(lib).so) 88*795d594fSAndroid Build Coastguard Workerifdef TARGET_2ND_ARCH 89*795d594fSAndroid Build Coastguard WorkerART_TARGET_SHARED_LIBRARY_DEBUG_DEPENDENCIES += $(foreach lib,$(ART_CORE_SHARED_DEBUG_LIBRARIES), $(2ND_TARGET_OUT_SHARED_LIBRARIES)/$(lib).so) 90*795d594fSAndroid Build Coastguard Workerendif 91*795d594fSAndroid Build Coastguard Worker 92*795d594fSAndroid Build Coastguard WorkerART_CORE_DEBUGGABLE_EXECUTABLES_COMMON := \ 93*795d594fSAndroid Build Coastguard Worker dex2oat \ 94*795d594fSAndroid Build Coastguard Worker dexoptanalyzer \ 95*795d594fSAndroid Build Coastguard Worker imgdiag \ 96*795d594fSAndroid Build Coastguard Worker oatdump \ 97*795d594fSAndroid Build Coastguard Worker profman \ 98*795d594fSAndroid Build Coastguard Worker 99*795d594fSAndroid Build Coastguard WorkerART_CORE_DEBUGGABLE_EXECUTABLES_TARGET := $(ART_CORE_DEBUGGABLE_EXECUTABLES_COMMON) odrefresh 100*795d594fSAndroid Build Coastguard WorkerART_CORE_DEBUGGABLE_EXECUTABLES_HOST := $(ART_CORE_DEBUGGABLE_EXECUTABLES_COMMON) 101*795d594fSAndroid Build Coastguard Worker 102*795d594fSAndroid Build Coastguard WorkerART_CORE_EXECUTABLES := \ 103*795d594fSAndroid Build Coastguard Worker dalvikvm \ 104*795d594fSAndroid Build Coastguard Worker dexlist \ 105*795d594fSAndroid Build Coastguard Worker 106*795d594fSAndroid Build Coastguard Worker# Depend on the -target or -host phony targets generated by the build system 107*795d594fSAndroid Build Coastguard Worker# for each module 108*795d594fSAndroid Build Coastguard WorkerART_TARGET_EXECUTABLES := 109*795d594fSAndroid Build Coastguard Workerifneq ($(ART_BUILD_TARGET_NDEBUG),false) 110*795d594fSAndroid Build Coastguard WorkerART_TARGET_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES) $(ART_CORE_DEBUGGABLE_EXECUTABLES_TARGET),$(name)-target) 111*795d594fSAndroid Build Coastguard Workerendif 112*795d594fSAndroid Build Coastguard Workerifneq ($(ART_BUILD_TARGET_DEBUG),false) 113*795d594fSAndroid Build Coastguard WorkerART_TARGET_EXECUTABLES += $(foreach name,$(ART_CORE_DEBUGGABLE_EXECUTABLES_TARGET),$(name)d-target) 114*795d594fSAndroid Build Coastguard Workerendif 115*795d594fSAndroid Build Coastguard Worker 116*795d594fSAndroid Build Coastguard WorkerART_HOST_EXECUTABLES := 117*795d594fSAndroid Build Coastguard Workerifneq ($(ART_BUILD_HOST_NDEBUG),false) 118*795d594fSAndroid Build Coastguard WorkerART_HOST_EXECUTABLES += $(foreach name,$(ART_CORE_EXECUTABLES) $(ART_CORE_DEBUGGABLE_EXECUTABLES_HOST),$(name)-host) 119*795d594fSAndroid Build Coastguard Workerendif 120*795d594fSAndroid Build Coastguard Workerifneq ($(ART_BUILD_HOST_DEBUG),false) 121*795d594fSAndroid Build Coastguard WorkerART_HOST_EXECUTABLES += $(foreach name,$(ART_CORE_DEBUGGABLE_EXECUTABLES_HOST),$(name)d-host) 122*795d594fSAndroid Build Coastguard Workerendif 123*795d594fSAndroid Build Coastguard Worker 124*795d594fSAndroid Build Coastguard Worker# Release ART APEX, included by default in "user" builds. 125*795d594fSAndroid Build Coastguard WorkerRELEASE_ART_APEX := com.android.art 126*795d594fSAndroid Build Coastguard Worker# Debug ART APEX, included by default in "userdebug" and "eng" 127*795d594fSAndroid Build Coastguard Worker# builds and used in ART device benchmarking. 128*795d594fSAndroid Build Coastguard WorkerDEBUG_ART_APEX := com.android.art.debug 129*795d594fSAndroid Build Coastguard Worker# Testing ART APEX, used in ART device testing. 130*795d594fSAndroid Build Coastguard WorkerTESTING_ART_APEX := com.android.art.testing 131*795d594fSAndroid Build Coastguard Worker 132*795d594fSAndroid Build Coastguard WorkerRUNTIME_APEX := com.android.runtime 133*795d594fSAndroid Build Coastguard WorkerCONSCRYPT_APEX := com.android.conscrypt 134*795d594fSAndroid Build Coastguard WorkerI18N_APEX := com.android.i18n 135*795d594fSAndroid Build Coastguard WorkerSTATSD_APEX := art_fake_com.android.os.statsd 136*795d594fSAndroid Build Coastguard WorkerTZDATA_APEX := com.android.tzdata 137*795d594fSAndroid Build Coastguard Worker 138*795d594fSAndroid Build Coastguard Worker# A phony file to create the ICU data file for host. 139*795d594fSAndroid Build Coastguard WorkerHOST_I18N_DATA := $(HOST_OUT)/$(I18N_APEX)/timestamp 140*795d594fSAndroid Build Coastguard Worker# A phony file to create the tz data file for host. 141*795d594fSAndroid Build Coastguard WorkerHOST_TZDATA_DATA := $(HOST_OUT)/$(TZDATA_APEX)/timestamp 142*795d594fSAndroid Build Coastguard Worker 143*795d594fSAndroid Build Coastguard Workerendif # ART_ANDROID_COMMON_PATH_MK 144