Brian Carlstrom | 1619286 | 2011-09-12 17:50:06 -0700 | [diff] [blame] | 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 | |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 17 | ######################################################################## |
Brian Carlstrom | 7ab763c | 2013-12-09 00:38:02 -0800 | [diff] [blame] | 18 | # Rules to build a smaller "core" image to support core libraries |
| 19 | # (that is, non-Android frameworks) testing on the host and target |
| 20 | # |
| 21 | # The main rules to build the default "boot" image are in |
| 22 | # build/core/dex_preopt_libart.mk |
Brian Carlstrom | 1619286 | 2011-09-12 17:50:06 -0700 | [diff] [blame] | 23 | |
Nicolas Geoffray | 611e1db | 2014-10-09 17:34:45 +0100 | [diff] [blame] | 24 | include art/build/Android.common_build.mk |
Dave Allison | 7020278 | 2013-10-22 17:52:19 -0700 | [diff] [blame] | 25 | |
Andreas Gampe | 4d2ef33 | 2015-08-05 09:24:45 -0700 | [diff] [blame] | 26 | LOCAL_DEX2OAT_HOST_INSTRUCTION_SET_FEATURES_OPTION := |
Ian Rogers | d582fa4 | 2014-11-05 23:46:43 -0800 | [diff] [blame] | 27 | ifeq ($(DEX2OAT_HOST_INSTRUCTION_SET_FEATURES),) |
Andreas Gampe | 4d2ef33 | 2015-08-05 09:24:45 -0700 | [diff] [blame] | 28 | LOCAL_DEX2OAT_HOST_INSTRUCTION_SET_FEATURES_OPTION := --instruction-set-features=default |
| 29 | else |
| 30 | LOCAL_DEX2OAT_HOST_INSTRUCTION_SET_FEATURES_OPTION := --instruction-set-features=$(DEX2OAT_HOST_INSTRUCTION_SET_FEATURES) |
Ian Rogers | d582fa4 | 2014-11-05 23:46:43 -0800 | [diff] [blame] | 31 | endif |
Andreas Gampe | 4d2ef33 | 2015-08-05 09:24:45 -0700 | [diff] [blame] | 32 | LOCAL_$(HOST_2ND_ARCH_VAR_PREFIX)DEX2OAT_HOST_INSTRUCTION_SET_FEATURES_OPTION := |
Ian Rogers | d582fa4 | 2014-11-05 23:46:43 -0800 | [diff] [blame] | 33 | ifeq ($($(HOST_2ND_ARCH_VAR_PREFIX)DEX2OAT_HOST_INSTRUCTION_SET_FEATURES),) |
Andreas Gampe | 4d2ef33 | 2015-08-05 09:24:45 -0700 | [diff] [blame] | 34 | LOCAL_$(HOST_2ND_ARCH_VAR_PREFIX)DEX2OAT_HOST_INSTRUCTION_SET_FEATURES_OPTION := --instruction-set-features=default |
| 35 | else |
| 36 | LOCAL_$(HOST_2ND_ARCH_VAR_PREFIX)DEX2OAT_HOST_INSTRUCTION_SET_FEATURES_OPTION := --instruction-set-features=$($(HOST_2ND_ARCH_VAR_PREFIX)DEX2OAT_HOST_INSTRUCTION_SET_FEATURES) |
Ian Rogers | d582fa4 | 2014-11-05 23:46:43 -0800 | [diff] [blame] | 37 | endif |
| 38 | |
Nicolas Geoffray | 1db132d | 2014-03-26 10:56:24 +0000 | [diff] [blame] | 39 | # Use dex2oat debug version for better error reporting |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 40 | # $(1): compiler - optimizing, interpreter or interpreter-access-checks. |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 41 | # $(2): 2ND_ or undefined, 2ND_ for 32-bit host builds. |
| 42 | # $(3): wrapper, e.g., valgrind. |
| 43 | # $(4): dex2oat suffix, e.g, valgrind requires 32 right now. |
| 44 | # $(5): multi-image. |
Alex Light | 1ef4ce8 | 2014-08-27 11:13:47 -0700 | [diff] [blame] | 45 | # NB depending on HOST_CORE_DEX_LOCATIONS so we are sure to have the dex files in frameworks for |
| 46 | # run-test --no-image |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 47 | define create-core-oat-host-rules |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 48 | core_compile_options := |
| 49 | core_image_name := |
| 50 | core_oat_name := |
| 51 | core_infix := |
Nicolas Geoffray | a136ab5 | 2014-10-31 10:48:25 +0000 | [diff] [blame] | 52 | core_dex2oat_dependency := $(DEX2OAT_DEPENDENCY) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 53 | |
| 54 | ifeq ($(1),optimizing) |
Nicolas Geoffray | a136ab5 | 2014-10-31 10:48:25 +0000 | [diff] [blame] | 55 | core_compile_options += --compiler-backend=Optimizing |
Nicolas Geoffray | c13f13a | 2015-10-06 12:39:17 +0100 | [diff] [blame] | 56 | core_dex2oat_dependency := $(DEX2OAT) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 57 | endif |
| 58 | ifeq ($(1),interpreter) |
Nicolas Geoffray | 49cda06 | 2017-04-21 13:08:25 +0100 | [diff] [blame] | 59 | core_compile_options += --compiler-filter=quicken |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 60 | core_infix := -interpreter |
| 61 | endif |
Andreas Gampe | 825570c | 2015-07-26 10:26:03 -0700 | [diff] [blame] | 62 | ifeq ($(1),interp-ac) |
Nicolas Geoffray | 49cda06 | 2017-04-21 13:08:25 +0100 | [diff] [blame] | 63 | core_compile_options += --compiler-filter=extract --runtime-arg -Xverify:softfail |
Andreas Gampe | 825570c | 2015-07-26 10:26:03 -0700 | [diff] [blame] | 64 | core_infix := -interp-ac |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 65 | endif |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 66 | ifneq ($(filter-out interpreter interp-ac optimizing,$(1)),) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 67 | #Technically this test is not precise, but hopefully good enough. |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 68 | $$(error found $(1) expected interpreter, interpreter-access-checks, or optimizing) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 69 | endif |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 70 | |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 71 | # If $(5) is true, generate a multi-image. |
| 72 | ifeq ($(5),true) |
Jeff Hao | dcdc85b | 2015-12-04 14:06:18 -0800 | [diff] [blame] | 73 | core_multi_infix := -multi |
| 74 | core_multi_param := --multi-image --no-inline-from=core-oj-hostdex.jar |
| 75 | core_multi_group := _multi |
| 76 | else |
| 77 | core_multi_infix := |
| 78 | core_multi_param := |
| 79 | core_multi_group := |
| 80 | endif |
| 81 | |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 82 | core_image_name := $($(2)HOST_CORE_IMG_OUT_BASE)$$(core_infix)$$(core_multi_infix)$(3)$(CORE_IMG_SUFFIX) |
| 83 | core_oat_name := $($(2)HOST_CORE_OAT_OUT_BASE)$$(core_infix)$$(core_multi_infix)$(3)$(CORE_OAT_SUFFIX) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 84 | |
| 85 | # Using the bitness suffix makes it easier to add as a dependency for the run-test mk. |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 86 | ifeq ($(2),) |
| 87 | $(3)HOST_CORE_IMAGE_$(1)$$(core_multi_group)_64 := $$(core_image_name) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 88 | else |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 89 | $(3)HOST_CORE_IMAGE_$(1)$$(core_multi_group)_32 := $$(core_image_name) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 90 | endif |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 91 | $(3)HOST_CORE_IMG_OUTS += $$(core_image_name) |
| 92 | $(3)HOST_CORE_OAT_OUTS += $$(core_oat_name) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 93 | |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 94 | # If we have a wrapper, make the target phony. |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 95 | ifneq ($(3),) |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 96 | .PHONY: $$(core_image_name) |
| 97 | endif |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 98 | $$(core_image_name): PRIVATE_CORE_COMPILE_OPTIONS := $$(core_compile_options) |
| 99 | $$(core_image_name): PRIVATE_CORE_IMG_NAME := $$(core_image_name) |
| 100 | $$(core_image_name): PRIVATE_CORE_OAT_NAME := $$(core_oat_name) |
Jeff Hao | dcdc85b | 2015-12-04 14:06:18 -0800 | [diff] [blame] | 101 | $$(core_image_name): PRIVATE_CORE_MULTI_PARAM := $$(core_multi_param) |
Nicolas Geoffray | a136ab5 | 2014-10-31 10:48:25 +0000 | [diff] [blame] | 102 | $$(core_image_name): $$(HOST_CORE_DEX_LOCATIONS) $$(core_dex2oat_dependency) |
Shinichiro Hamaji | c5d2905 | 2015-12-18 15:51:51 +0900 | [diff] [blame] | 103 | @echo "host dex2oat: $$@" |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 104 | @mkdir -p $$(dir $$@) |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 105 | $$(hide) $(3) $$(DEX2OAT)$(4) --runtime-arg -Xms$(DEX2OAT_IMAGE_XMS) \ |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 106 | --runtime-arg -Xmx$(DEX2OAT_IMAGE_XMX) \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 107 | --image-classes=$$(PRELOADED_CLASSES) $$(addprefix --dex-file=,$$(HOST_CORE_DEX_FILES)) \ |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 108 | $$(addprefix --dex-location=,$$(HOST_CORE_DEX_LOCATIONS)) --oat-file=$$(PRIVATE_CORE_OAT_NAME) \ |
| 109 | --oat-location=$$(PRIVATE_CORE_OAT_NAME) --image=$$(PRIVATE_CORE_IMG_NAME) \ |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 110 | --base=$$(LIBART_IMG_HOST_BASE_ADDRESS) --instruction-set=$$($(2)ART_HOST_ARCH) \ |
| 111 | $$(LOCAL_$(2)DEX2OAT_HOST_INSTRUCTION_SET_FEATURES_OPTION) \ |
Richard Uhler | 556cba0 | 2017-02-28 17:06:29 +0000 | [diff] [blame] | 112 | --host --android-root=$$(HOST_OUT) \ |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 113 | --generate-debug-info --generate-build-id --compile-pic \ |
Jeff Hao | dcdc85b | 2015-12-04 14:06:18 -0800 | [diff] [blame] | 114 | $$(PRIVATE_CORE_MULTI_PARAM) $$(PRIVATE_CORE_COMPILE_OPTIONS) |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 115 | |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 116 | $$(core_oat_name): $$(core_image_name) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 117 | |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 118 | # Clean up locally used variables. |
Nicolas Geoffray | a136ab5 | 2014-10-31 10:48:25 +0000 | [diff] [blame] | 119 | core_dex2oat_dependency := |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 120 | core_compile_options := |
| 121 | core_image_name := |
| 122 | core_oat_name := |
| 123 | core_infix := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 124 | endef # create-core-oat-host-rules |
| 125 | |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 126 | # $(1): compiler - optimizing, interpreter or interpreter-access-checks. |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 127 | # $(2): wrapper. |
| 128 | # $(3): dex2oat suffix. |
Jeff Hao | dcdc85b | 2015-12-04 14:06:18 -0800 | [diff] [blame] | 129 | # $(4): multi-image. |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 130 | define create-core-oat-host-rule-combination |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 131 | $(call create-core-oat-host-rules,$(1),,$(2),$(3),$(4)) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 132 | |
| 133 | ifneq ($(HOST_PREFER_32_BIT),true) |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 134 | $(call create-core-oat-host-rules,$(1),2ND_,$(2),$(3),$(4)) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 135 | endif |
| 136 | endef |
| 137 | |
Jeff Hao | dcdc85b | 2015-12-04 14:06:18 -0800 | [diff] [blame] | 138 | $(eval $(call create-core-oat-host-rule-combination,optimizing,,,false)) |
| 139 | $(eval $(call create-core-oat-host-rule-combination,interpreter,,,false)) |
| 140 | $(eval $(call create-core-oat-host-rule-combination,interp-ac,,,false)) |
Jeff Hao | dcdc85b | 2015-12-04 14:06:18 -0800 | [diff] [blame] | 141 | $(eval $(call create-core-oat-host-rule-combination,optimizing,,,true)) |
| 142 | $(eval $(call create-core-oat-host-rule-combination,interpreter,,,true)) |
| 143 | $(eval $(call create-core-oat-host-rule-combination,interp-ac,,,true)) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 144 | |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 145 | valgrindHOST_CORE_IMG_OUTS := |
| 146 | valgrindHOST_CORE_OAT_OUTS := |
Jeff Hao | dcdc85b | 2015-12-04 14:06:18 -0800 | [diff] [blame] | 147 | $(eval $(call create-core-oat-host-rule-combination,optimizing,valgrind,32,false)) |
| 148 | $(eval $(call create-core-oat-host-rule-combination,interpreter,valgrind,32,false)) |
| 149 | $(eval $(call create-core-oat-host-rule-combination,interp-ac,valgrind,32,false)) |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 150 | |
| 151 | valgrind-test-art-host-dex2oat-host: $(valgrindHOST_CORE_IMG_OUTS) |
Brian Carlstrom | 2b7cdf4 | 2011-10-13 11:18:28 -0700 | [diff] [blame] | 152 | |
Jeff Hao | dcdc85b | 2015-12-04 14:06:18 -0800 | [diff] [blame] | 153 | test-art-host-dex2oat-host: $(HOST_CORE_IMG_OUTS) |
| 154 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 155 | define create-core-oat-target-rules |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 156 | core_compile_options := |
| 157 | core_image_name := |
| 158 | core_oat_name := |
| 159 | core_infix := |
Nicolas Geoffray | a136ab5 | 2014-10-31 10:48:25 +0000 | [diff] [blame] | 160 | core_dex2oat_dependency := $(DEX2OAT_DEPENDENCY) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 161 | |
| 162 | ifeq ($(1),optimizing) |
Serban Constantinescu | 010cf91 | 2014-12-04 18:12:21 +0000 | [diff] [blame] | 163 | core_compile_options += --compiler-backend=Optimizing |
Nicolas Geoffray | 7701d10 | 2015-10-05 09:51:36 +0100 | [diff] [blame] | 164 | # With the optimizing compiler, we want to rerun dex2oat whenever there is |
| 165 | # a dex2oat change to catch regressions early. |
| 166 | core_dex2oat_dependency := $(DEX2OAT) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 167 | endif |
| 168 | ifeq ($(1),interpreter) |
Nicolas Geoffray | 49cda06 | 2017-04-21 13:08:25 +0100 | [diff] [blame] | 169 | core_compile_options += --compiler-filter=quicken |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 170 | core_infix := -interpreter |
| 171 | endif |
Andreas Gampe | 825570c | 2015-07-26 10:26:03 -0700 | [diff] [blame] | 172 | ifeq ($(1),interp-ac) |
Nicolas Geoffray | 49cda06 | 2017-04-21 13:08:25 +0100 | [diff] [blame] | 173 | core_compile_options += --compiler-filter=extract --runtime-arg -Xverify:softfail |
Andreas Gampe | 825570c | 2015-07-26 10:26:03 -0700 | [diff] [blame] | 174 | core_infix := -interp-ac |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 175 | endif |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 176 | ifneq ($(filter-out interpreter interp-ac optimizing,$(1)),) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 177 | # Technically this test is not precise, but hopefully good enough. |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 178 | $$(error found $(1) expected interpreter, interpreter-access-checks, or optimizing) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 179 | endif |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 180 | |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 181 | core_image_name := $($(2)TARGET_CORE_IMG_OUT_BASE)$$(core_infix)$(3)$(CORE_IMG_SUFFIX) |
| 182 | core_oat_name := $($(2)TARGET_CORE_OAT_OUT_BASE)$$(core_infix)$(3)$(CORE_OAT_SUFFIX) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 183 | |
| 184 | # Using the bitness suffix makes it easier to add as a dependency for the run-test mk. |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 185 | ifeq ($(2),) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 186 | ifdef TARGET_2ND_ARCH |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 187 | $(3)TARGET_CORE_IMAGE_$(1)_64 := $$(core_image_name) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 188 | else |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 189 | $(3)TARGET_CORE_IMAGE_$(1)_32 := $$(core_image_name) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 190 | endif |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 191 | else |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 192 | $(3)TARGET_CORE_IMAGE_$(1)_32 := $$(core_image_name) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 193 | endif |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 194 | $(3)TARGET_CORE_IMG_OUTS += $$(core_image_name) |
| 195 | $(3)TARGET_CORE_OAT_OUTS += $$(core_oat_name) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 196 | |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 197 | # If we have a wrapper, make the target phony. |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 198 | ifneq ($(3),) |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 199 | .PHONY: $$(core_image_name) |
| 200 | endif |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 201 | $$(core_image_name): PRIVATE_CORE_COMPILE_OPTIONS := $$(core_compile_options) |
| 202 | $$(core_image_name): PRIVATE_CORE_IMG_NAME := $$(core_image_name) |
| 203 | $$(core_image_name): PRIVATE_CORE_OAT_NAME := $$(core_oat_name) |
Nicolas Geoffray | a136ab5 | 2014-10-31 10:48:25 +0000 | [diff] [blame] | 204 | $$(core_image_name): $$(TARGET_CORE_DEX_FILES) $$(core_dex2oat_dependency) |
Shinichiro Hamaji | c5d2905 | 2015-12-18 15:51:51 +0900 | [diff] [blame] | 205 | @echo "target dex2oat: $$@" |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 206 | @mkdir -p $$(dir $$@) |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 207 | $$(hide) $(4) $$(DEX2OAT)$(5) --runtime-arg -Xms$(DEX2OAT_IMAGE_XMS) \ |
| 208 | --runtime-arg -Xmx$(DEX2OAT_IMAGE_XMX) \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 209 | --image-classes=$$(PRELOADED_CLASSES) $$(addprefix --dex-file=,$$(TARGET_CORE_DEX_FILES)) \ |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 210 | $$(addprefix --dex-location=,$$(TARGET_CORE_DEX_LOCATIONS)) --oat-file=$$(PRIVATE_CORE_OAT_NAME) \ |
| 211 | --oat-location=$$(PRIVATE_CORE_OAT_NAME) --image=$$(PRIVATE_CORE_IMG_NAME) \ |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 212 | --base=$$(LIBART_IMG_TARGET_BASE_ADDRESS) --instruction-set=$$($(2)TARGET_ARCH) \ |
| 213 | --instruction-set-variant=$$($(2)DEX2OAT_TARGET_CPU_VARIANT) \ |
| 214 | --instruction-set-features=$$($(2)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) \ |
Richard Uhler | 556cba0 | 2017-02-28 17:06:29 +0000 | [diff] [blame] | 215 | --android-root=$$(PRODUCT_OUT)/system \ |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 216 | --generate-debug-info --generate-build-id --compile-pic \ |
Nicolas Geoffray | 130bd1b | 2014-11-03 16:23:48 +0000 | [diff] [blame] | 217 | $$(PRIVATE_CORE_COMPILE_OPTIONS) || (rm $$(PRIVATE_CORE_OAT_NAME); exit 1) |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 218 | |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 219 | $$(core_oat_name): $$(core_image_name) |
Andreas Gampe | 2fe0792 | 2014-04-21 07:50:39 -0700 | [diff] [blame] | 220 | |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 221 | # Clean up locally used variables. |
Nicolas Geoffray | a136ab5 | 2014-10-31 10:48:25 +0000 | [diff] [blame] | 222 | core_dex2oat_dependency := |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 223 | core_compile_options := |
| 224 | core_image_name := |
| 225 | core_oat_name := |
| 226 | core_infix := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 227 | endef # create-core-oat-target-rules |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 228 | |
Nicolas Geoffray | b76bc78 | 2016-09-14 12:33:34 +0000 | [diff] [blame] | 229 | # $(1): compiler - optimizing, interpreter or interpreter-access-checks. |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 230 | # $(2): wrapper. |
| 231 | # $(3): dex2oat suffix. |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 232 | define create-core-oat-target-rule-combination |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 233 | $(call create-core-oat-target-rules,$(1),,$(2),$(3)) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 234 | |
| 235 | ifdef TARGET_2ND_ARCH |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 236 | $(call create-core-oat-target-rules,$(1),2ND_,$(2),$(3)) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 237 | endif |
| 238 | endef |
| 239 | |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 240 | $(eval $(call create-core-oat-target-rule-combination,optimizing,,)) |
| 241 | $(eval $(call create-core-oat-target-rule-combination,interpreter,,)) |
Andreas Gampe | 825570c | 2015-07-26 10:26:03 -0700 | [diff] [blame] | 242 | $(eval $(call create-core-oat-target-rule-combination,interp-ac,,)) |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 243 | |
| 244 | valgrindTARGET_CORE_IMG_OUTS := |
| 245 | valgrindTARGET_CORE_OAT_OUTS := |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 246 | $(eval $(call create-core-oat-target-rule-combination,optimizing,valgrind,32)) |
| 247 | $(eval $(call create-core-oat-target-rule-combination,interpreter,valgrind,32)) |
Andreas Gampe | 825570c | 2015-07-26 10:26:03 -0700 | [diff] [blame] | 248 | $(eval $(call create-core-oat-target-rule-combination,interp-ac,valgrind,32)) |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 249 | |
| 250 | valgrind-test-art-host-dex2oat-target: $(valgrindTARGET_CORE_IMG_OUTS) |
| 251 | |
| 252 | valgrind-test-art-host-dex2oat: valgrind-test-art-host-dex2oat-host valgrind-test-art-host-dex2oat-target |
Richard Uhler | 67e1dc5 | 2017-02-06 16:50:17 +0000 | [diff] [blame] | 253 | |
| 254 | # Define a default core image that can be used for things like gtests that |
| 255 | # need some image to run, but don't otherwise care which image is used. |
Richard Uhler | bb00f81 | 2017-02-16 14:21:10 +0000 | [diff] [blame] | 256 | HOST_CORE_IMAGE_DEFAULT_32 := $(HOST_CORE_IMAGE_optimizing_32) |
| 257 | HOST_CORE_IMAGE_DEFAULT_64 := $(HOST_CORE_IMAGE_optimizing_64) |
| 258 | TARGET_CORE_IMAGE_DEFAULT_32 := $(TARGET_CORE_IMAGE_optimizing_32) |
| 259 | TARGET_CORE_IMAGE_DEFAULT_64 := $(TARGET_CORE_IMAGE_optimizing_64) |