blob: 9ca4d0f1bc85504c1aa45414d8d085f890f652aa [file] [log] [blame]
Carl Shapiro7b216702011-06-17 15:09:26 -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_MK
18ART_ANDROID_COMMON_MK = true
Dragos Sbirlea37c19bc2013-07-29 09:38:31 -070019
Vladimir Markobe0d3cf2020-02-12 10:52:22 +000020ART_TARGET_SUPPORTED_ARCH := arm arm64 x86 x86_64
Ian Rogersafd9acc2014-06-17 08:21:54 -070021ART_HOST_SUPPORTED_ARCH := x86 x86_64
Nicolas Geoffray31e0dc22020-03-20 15:48:09 +000022ART_DEXPREOPT_BOOT_JAR_DIR := apex/com.android.art/javalib
23CONSCRYPT_DEXPREOPT_BOOT_JAR_DIR := apex/com.android.conscrypt/javalib
Colin Crossdc781a12014-02-04 16:22:03 -080024
Ying Wang754a4452015-07-21 12:05:30 -070025ifneq ($(HOST_OS),darwin)
26 ART_HOST_SUPPORTED_ARCH := x86 x86_64
27else
28 # Mac OS doesn't support low-4GB allocation in a 64-bit process. So we won't be able to create
29 # our heaps.
30 ART_HOST_SUPPORTED_ARCH := x86
Ying Wang754a4452015-07-21 12:05:30 -070031endif
32
Dan Albert31fb2602014-09-30 22:10:10 -070033ART_COVERAGE := false
34
35ifeq ($(ART_COVERAGE),true)
36# https://gcc.gnu.org/onlinedocs/gcc/Cross-profiling.html
37GCOV_PREFIX := /data/local/tmp/gcov
38# GCOV_PREFIX_STRIP is an integer that defines how many levels should be
39# stripped off the beginning of the path. We want the paths in $GCOV_PREFIX to
40# be relative to $ANDROID_BUILD_TOP so we can just adb pull from the top and not
41# have to worry about placing things ourselves.
42GCOV_PREFIX_STRIP := $(shell echo $(ANDROID_BUILD_TOP) | grep -o / | wc -l)
43GCOV_ENV := GCOV_PREFIX=$(GCOV_PREFIX) GCOV_PREFIX_STRIP=$(GCOV_PREFIX_STRIP)
44else
45GCOV_ENV :=
46endif
47
Ian Rogersafd9acc2014-06-17 08:21:54 -070048ifeq (,$(filter $(TARGET_ARCH),$(ART_TARGET_SUPPORTED_ARCH)))
Colin Crossdc781a12014-02-04 16:22:03 -080049$(warning unsupported TARGET_ARCH=$(TARGET_ARCH))
50endif
Ian Rogersafd9acc2014-06-17 08:21:54 -070051ifeq (,$(filter $(HOST_ARCH),$(ART_HOST_SUPPORTED_ARCH)))
52$(warning unsupported HOST_ARCH=$(HOST_ARCH))
Brian Carlstromafdc5602014-06-10 15:42:52 -070053endif
Andreas Gampe922141a2014-03-12 10:59:26 -070054
Andreas Gampeafbaa1a2014-03-25 18:09:32 -070055# Primary vs. secondary
562ND_TARGET_ARCH := $(TARGET_2ND_ARCH)
Ian Rogersafd9acc2014-06-17 08:21:54 -070057TARGET_INSTRUCTION_SET_FEATURES := $(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES)
582ND_TARGET_INSTRUCTION_SET_FEATURES := $($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES)
Andreas Gampeafbaa1a2014-03-25 18:09:32 -070059ifdef TARGET_2ND_ARCH
Andreas Gampeafbaa1a2014-03-25 18:09:32 -070060 ifneq ($(filter %64,$(TARGET_ARCH)),)
Andreas Gampeafbaa1a2014-03-25 18:09:32 -070061 ART_PHONY_TEST_TARGET_SUFFIX := 64
62 2ND_ART_PHONY_TEST_TARGET_SUFFIX := 32
Andreas Gampeafbaa1a2014-03-25 18:09:32 -070063 else
Ying Wang6a63bac2016-03-16 19:40:00 -070064 ART_PHONY_TEST_TARGET_SUFFIX := 32
65 2ND_ART_PHONY_TEST_TARGET_SUFFIX :=
Andreas Gampeafbaa1a2014-03-25 18:09:32 -070066 endif
Andreas Gampeafbaa1a2014-03-25 18:09:32 -070067else
Nicolas Geoffray7372b762014-11-07 10:10:39 +000068 ifneq ($(filter %64,$(TARGET_ARCH)),)
69 ART_PHONY_TEST_TARGET_SUFFIX := 64
70 2ND_ART_PHONY_TEST_TARGET_SUFFIX :=
Nicolas Geoffray7372b762014-11-07 10:10:39 +000071 else
72 ART_PHONY_TEST_TARGET_SUFFIX := 32
73 2ND_ART_PHONY_TEST_TARGET_SUFFIX :=
Nicolas Geoffray7372b762014-11-07 10:10:39 +000074 endif
Andreas Gampeafbaa1a2014-03-25 18:09:32 -070075endif
Brian Carlstrom47a0d5a2011-10-12 21:20:05 -070076
Ian Rogers665de8a2014-06-24 21:34:09 -070077ART_HOST_SHLIB_EXTENSION := $(HOST_SHLIB_SUFFIX)
78ART_HOST_SHLIB_EXTENSION ?= .so
Ian Rogersafd9acc2014-06-17 08:21:54 -070079ifeq ($(HOST_PREFER_32_BIT),true)
80 ART_PHONY_TEST_HOST_SUFFIX := 32
81 2ND_ART_PHONY_TEST_HOST_SUFFIX :=
Ian Rogersafd9acc2014-06-17 08:21:54 -070082 ART_HOST_ARCH := x86
83 2ND_ART_HOST_ARCH :=
84 2ND_HOST_ARCH :=
85 ART_HOST_OUT_SHARED_LIBRARIES := $(2ND_HOST_OUT_SHARED_LIBRARIES)
86 2ND_ART_HOST_OUT_SHARED_LIBRARIES :=
Elliott Hughes1d3f1142011-09-13 12:00:00 -070087else
Ian Rogersafd9acc2014-06-17 08:21:54 -070088 ART_PHONY_TEST_HOST_SUFFIX := 64
89 2ND_ART_PHONY_TEST_HOST_SUFFIX := 32
Ian Rogersafd9acc2014-06-17 08:21:54 -070090 ART_HOST_ARCH := x86_64
91 2ND_ART_HOST_ARCH := x86
92 2ND_HOST_ARCH := x86
93 ART_HOST_OUT_SHARED_LIBRARIES := $(HOST_OUT_SHARED_LIBRARIES)
94 2ND_ART_HOST_OUT_SHARED_LIBRARIES := $(2ND_HOST_OUT_SHARED_LIBRARIES)
Elliott Hughes1d3f1142011-09-13 12:00:00 -070095endif
Andreas Gampe2fe07922014-04-21 07:50:39 -070096
Nicolas Geoffray64c2d772018-08-31 09:22:44 +010097ADB_EXECUTABLE := $(HOST_OUT_EXECUTABLES)/adb
Nicolas Geoffrayc8d58132018-10-12 10:46:28 +010098ADB ?= $(ADB_EXECUTABLE)
Nicolas Geoffray64c2d772018-08-31 09:22:44 +010099
Igor Murashkin37743352014-11-13 14:38:00 -0800100endif # ART_ANDROID_COMMON_MK