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_MK
18ART_ANDROID_COMMON_MK = true
19
20ART_TARGET_SUPPORTED_ARCH := arm arm64 x86 x86_64
21ART_HOST_SUPPORTED_ARCH := x86 x86_64
22ART_DEXPREOPT_BOOT_JAR_DIR := system/framework
23
24ifneq ($(HOST_OS),darwin)
25  ART_HOST_SUPPORTED_ARCH := x86 x86_64
26else
27  # Mac OS doesn't support low-4GB allocation in a 64-bit process. So we won't be able to create
28  # our heaps.
29  ART_HOST_SUPPORTED_ARCH := x86
30endif
31
32ART_COVERAGE := false
33
34ifeq ($(ART_COVERAGE),true)
35# https://gcc.gnu.org/onlinedocs/gcc/Cross-profiling.html
36GCOV_PREFIX := /data/local/tmp/gcov
37# GCOV_PREFIX_STRIP is an integer that defines how many levels should be
38# stripped off the beginning of the path. We want the paths in $GCOV_PREFIX to
39# be relative to $ANDROID_BUILD_TOP so we can just adb pull from the top and not
40# have to worry about placing things ourselves.
41GCOV_PREFIX_STRIP := $(shell echo $(ANDROID_BUILD_TOP) | grep -o / | wc -l)
42GCOV_ENV := GCOV_PREFIX=$(GCOV_PREFIX) GCOV_PREFIX_STRIP=$(GCOV_PREFIX_STRIP)
43else
44GCOV_ENV :=
45endif
46
47ifeq (,$(filter $(TARGET_ARCH),$(ART_TARGET_SUPPORTED_ARCH)))
48$(warning unsupported TARGET_ARCH=$(TARGET_ARCH))
49endif
50ifeq (,$(filter $(HOST_ARCH),$(ART_HOST_SUPPORTED_ARCH)))
51$(warning unsupported HOST_ARCH=$(HOST_ARCH))
52endif
53
54# Primary vs. secondary
552ND_TARGET_ARCH := $(TARGET_2ND_ARCH)
56TARGET_INSTRUCTION_SET_FEATURES := $(DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES)
572ND_TARGET_INSTRUCTION_SET_FEATURES := $($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES)
58ifdef TARGET_2ND_ARCH
59  ifneq ($(filter %64,$(TARGET_ARCH)),)
60    ART_PHONY_TEST_TARGET_SUFFIX := 64
61    2ND_ART_PHONY_TEST_TARGET_SUFFIX := 32
62  else
63    ART_PHONY_TEST_TARGET_SUFFIX := 32
64    2ND_ART_PHONY_TEST_TARGET_SUFFIX :=
65  endif
66else
67  ifneq ($(filter %64,$(TARGET_ARCH)),)
68    ART_PHONY_TEST_TARGET_SUFFIX := 64
69    2ND_ART_PHONY_TEST_TARGET_SUFFIX :=
70  else
71    ART_PHONY_TEST_TARGET_SUFFIX := 32
72    2ND_ART_PHONY_TEST_TARGET_SUFFIX :=
73  endif
74endif
75
76ART_HOST_SHLIB_EXTENSION := $(HOST_SHLIB_SUFFIX)
77ART_HOST_SHLIB_EXTENSION ?= .so
78ifeq ($(HOST_PREFER_32_BIT),true)
79  ART_PHONY_TEST_HOST_SUFFIX := 32
80  2ND_ART_PHONY_TEST_HOST_SUFFIX :=
81  ART_HOST_ARCH := x86
82  2ND_ART_HOST_ARCH :=
83  2ND_HOST_ARCH :=
84  ART_HOST_OUT_SHARED_LIBRARIES := $(2ND_HOST_OUT_SHARED_LIBRARIES)
85  2ND_ART_HOST_OUT_SHARED_LIBRARIES :=
86else
87  ART_PHONY_TEST_HOST_SUFFIX := 64
88  2ND_ART_PHONY_TEST_HOST_SUFFIX := 32
89  ART_HOST_ARCH := x86_64
90  2ND_ART_HOST_ARCH := x86
91  2ND_HOST_ARCH := x86
92  ART_HOST_OUT_SHARED_LIBRARIES := $(HOST_OUT_SHARED_LIBRARIES)
93  2ND_ART_HOST_OUT_SHARED_LIBRARIES := $(2ND_HOST_OUT_SHARED_LIBRARIES)
94endif
95
96ADB_EXECUTABLE := $(HOST_OUT_EXECUTABLES)/adb
97ADB ?= $(ADB_EXECUTABLE)
98
99endif # ART_ANDROID_COMMON_MK
100