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 |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 40 | # $(1): compiler - default, optimizing, jit, interpreter or interpreter-access-checks. |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 41 | # $(2): pic/no-pic |
| 42 | # $(3): 2ND_ or undefined, 2ND_ for 32-bit host builds. |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 43 | # $(4): wrapper, e.g., valgrind. |
| 44 | # $(5): dex2oat suffix, e.g, valgrind requires 32 right now. |
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 := |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 52 | core_pic_infix := |
Nicolas Geoffray | a136ab5 | 2014-10-31 10:48:25 +0000 | [diff] [blame] | 53 | core_dex2oat_dependency := $(DEX2OAT_DEPENDENCY) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 54 | |
Nicolas Geoffray | 5d672a6 | 2014-12-04 14:39:31 +0000 | [diff] [blame] | 55 | # With the optimizing compiler, we want to rerun dex2oat whenever there is |
| 56 | # a dex2oat change to catch regressions early. |
| 57 | ifeq ($(ART_USE_OPTIMIZING_COMPILER), true) |
| 58 | core_dex2oat_dependency := $(DEX2OAT) |
Nicolas Geoffray | c9338b9 | 2014-12-03 13:36:10 +0000 | [diff] [blame] | 59 | endif |
Nicolas Geoffray | 5d672a6 | 2014-12-04 14:39:31 +0000 | [diff] [blame] | 60 | |
Nicolas Geoffray | 6427df1 | 2014-12-17 12:34:15 +0000 | [diff] [blame] | 61 | ifeq ($(1),default) |
| 62 | core_compile_options += --compiler-backend=Quick |
| 63 | endif |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 64 | ifeq ($(1),optimizing) |
Nicolas Geoffray | a136ab5 | 2014-10-31 10:48:25 +0000 | [diff] [blame] | 65 | core_compile_options += --compiler-backend=Optimizing |
Nicolas Geoffray | a136ab5 | 2014-10-31 10:48:25 +0000 | [diff] [blame] | 66 | core_dex2oat_dependency := $(DEX2OAT) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 67 | core_infix := -optimizing |
| 68 | endif |
| 69 | ifeq ($(1),interpreter) |
| 70 | core_compile_options += --compiler-filter=interpret-only |
| 71 | core_infix := -interpreter |
| 72 | endif |
Andreas Gampe | 825570c | 2015-07-26 10:26:03 -0700 | [diff] [blame] | 73 | ifeq ($(1),interp-ac) |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 74 | core_compile_options += --compiler-filter=verify-at-runtime --runtime-arg -Xverify:softfail |
Andreas Gampe | 825570c | 2015-07-26 10:26:03 -0700 | [diff] [blame] | 75 | core_infix := -interp-ac |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 76 | endif |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 77 | ifeq ($(1),default) |
| 78 | # Default has no infix, no compile options. |
| 79 | endif |
Andreas Gampe | 825570c | 2015-07-26 10:26:03 -0700 | [diff] [blame] | 80 | ifneq ($(filter-out default interpreter interp-ac jit optimizing,$(1)),) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 81 | #Technically this test is not precise, but hopefully good enough. |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 82 | $$(error found $(1) expected default, interpreter, interpreter-access-checks, jit or optimizing) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 83 | endif |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 84 | |
| 85 | ifeq ($(2),pic) |
| 86 | core_compile_options += --compile-pic |
| 87 | core_pic_infix := -pic |
| 88 | endif |
| 89 | ifeq ($(2),no-pic) |
| 90 | # No change for non-pic |
| 91 | endif |
| 92 | ifneq ($(filter-out pic no-pic,$(2)),) |
| 93 | # Technically this test is not precise, but hopefully good enough. |
| 94 | $$(error found $(2) expected pic or no-pic) |
| 95 | endif |
| 96 | |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 97 | core_image_name := $($(3)HOST_CORE_IMG_OUT_BASE)$$(core_infix)$$(core_pic_infix)$(4)$(CORE_IMG_SUFFIX) |
| 98 | core_oat_name := $($(3)HOST_CORE_OAT_OUT_BASE)$$(core_infix)$$(core_pic_infix)$(4)$(CORE_OAT_SUFFIX) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 99 | |
| 100 | # Using the bitness suffix makes it easier to add as a dependency for the run-test mk. |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 101 | ifeq ($(3),) |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 102 | $(4)HOST_CORE_IMAGE_$(1)_$(2)_64 := $$(core_image_name) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 103 | else |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 104 | $(4)HOST_CORE_IMAGE_$(1)_$(2)_32 := $$(core_image_name) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 105 | endif |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 106 | $(4)HOST_CORE_IMG_OUTS += $$(core_image_name) |
| 107 | $(4)HOST_CORE_OAT_OUTS += $$(core_oat_name) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 108 | |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 109 | # If we have a wrapper, make the target phony. |
| 110 | ifneq ($(4),) |
| 111 | .PHONY: $$(core_image_name) |
| 112 | endif |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 113 | $$(core_image_name): PRIVATE_CORE_COMPILE_OPTIONS := $$(core_compile_options) |
| 114 | $$(core_image_name): PRIVATE_CORE_IMG_NAME := $$(core_image_name) |
| 115 | $$(core_image_name): PRIVATE_CORE_OAT_NAME := $$(core_oat_name) |
Nicolas Geoffray | a136ab5 | 2014-10-31 10:48:25 +0000 | [diff] [blame] | 116 | $$(core_image_name): $$(HOST_CORE_DEX_LOCATIONS) $$(core_dex2oat_dependency) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 117 | @echo "host dex2oat: $$@ ($$?)" |
| 118 | @mkdir -p $$(dir $$@) |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 119 | $$(hide) $(4) $$(DEX2OAT)$(5) --runtime-arg -Xms$(DEX2OAT_IMAGE_XMS) \ |
| 120 | --runtime-arg -Xmx$(DEX2OAT_IMAGE_XMX) \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 121 | --image-classes=$$(PRELOADED_CLASSES) $$(addprefix --dex-file=,$$(HOST_CORE_DEX_FILES)) \ |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 122 | $$(addprefix --dex-location=,$$(HOST_CORE_DEX_LOCATIONS)) --oat-file=$$(PRIVATE_CORE_OAT_NAME) \ |
| 123 | --oat-location=$$(PRIVATE_CORE_OAT_NAME) --image=$$(PRIVATE_CORE_IMG_NAME) \ |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 124 | --base=$$(LIBART_IMG_HOST_BASE_ADDRESS) --instruction-set=$$($(3)ART_HOST_ARCH) \ |
Andreas Gampe | 4d2ef33 | 2015-08-05 09:24:45 -0700 | [diff] [blame] | 125 | $$(LOCAL_$(3)DEX2OAT_HOST_INSTRUCTION_SET_FEATURES_OPTION) \ |
David Srbecky | 461d72a | 2015-06-11 01:27:56 +0100 | [diff] [blame] | 126 | --host --android-root=$$(HOST_OUT) --include-patch-information --generate-debug-info \ |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 127 | $$(PRIVATE_CORE_COMPILE_OPTIONS) |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 128 | |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 129 | $$(core_oat_name): $$(core_image_name) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 130 | |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 131 | # Clean up locally used variables. |
Nicolas Geoffray | a136ab5 | 2014-10-31 10:48:25 +0000 | [diff] [blame] | 132 | core_dex2oat_dependency := |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 133 | core_compile_options := |
| 134 | core_image_name := |
| 135 | core_oat_name := |
| 136 | core_infix := |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 137 | core_pic_infix := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 138 | endef # create-core-oat-host-rules |
| 139 | |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 140 | # $(1): compiler - default, optimizing, jit, interpreter or interpreter-access-checks. |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 141 | # $(2): wrapper. |
| 142 | # $(3): dex2oat suffix. |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 143 | define create-core-oat-host-rule-combination |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 144 | $(call create-core-oat-host-rules,$(1),no-pic,,$(2),$(3)) |
| 145 | $(call create-core-oat-host-rules,$(1),pic,,$(2),$(3)) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 146 | |
| 147 | ifneq ($(HOST_PREFER_32_BIT),true) |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 148 | $(call create-core-oat-host-rules,$(1),no-pic,2ND_,$(2),$(3)) |
| 149 | $(call create-core-oat-host-rules,$(1),pic,2ND_,$(2),$(3)) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 150 | endif |
| 151 | endef |
| 152 | |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 153 | $(eval $(call create-core-oat-host-rule-combination,default,,)) |
| 154 | $(eval $(call create-core-oat-host-rule-combination,optimizing,,)) |
| 155 | $(eval $(call create-core-oat-host-rule-combination,interpreter,,)) |
Andreas Gampe | 825570c | 2015-07-26 10:26:03 -0700 | [diff] [blame] | 156 | $(eval $(call create-core-oat-host-rule-combination,interp-ac,,)) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 157 | |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 158 | valgrindHOST_CORE_IMG_OUTS := |
| 159 | valgrindHOST_CORE_OAT_OUTS := |
| 160 | $(eval $(call create-core-oat-host-rule-combination,default,valgrind,32)) |
| 161 | $(eval $(call create-core-oat-host-rule-combination,optimizing,valgrind,32)) |
| 162 | $(eval $(call create-core-oat-host-rule-combination,interpreter,valgrind,32)) |
Andreas Gampe | 825570c | 2015-07-26 10:26:03 -0700 | [diff] [blame] | 163 | $(eval $(call create-core-oat-host-rule-combination,interp-ac,valgrind,32)) |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 164 | |
| 165 | valgrind-test-art-host-dex2oat-host: $(valgrindHOST_CORE_IMG_OUTS) |
Brian Carlstrom | 2b7cdf4 | 2011-10-13 11:18:28 -0700 | [diff] [blame] | 166 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 167 | define create-core-oat-target-rules |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 168 | core_compile_options := |
| 169 | core_image_name := |
| 170 | core_oat_name := |
| 171 | core_infix := |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 172 | core_pic_infix := |
Nicolas Geoffray | a136ab5 | 2014-10-31 10:48:25 +0000 | [diff] [blame] | 173 | core_dex2oat_dependency := $(DEX2OAT_DEPENDENCY) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 174 | |
Nicolas Geoffray | 5d672a6 | 2014-12-04 14:39:31 +0000 | [diff] [blame] | 175 | # With the optimizing compiler, we want to rerun dex2oat whenever there is |
| 176 | # a dex2oat change to catch regressions early. |
| 177 | ifeq ($(ART_USE_OPTIMIZING_COMPILER), true) |
| 178 | core_dex2oat_dependency := $(DEX2OAT) |
Nicolas Geoffray | c9338b9 | 2014-12-03 13:36:10 +0000 | [diff] [blame] | 179 | endif |
Nicolas Geoffray | 5d672a6 | 2014-12-04 14:39:31 +0000 | [diff] [blame] | 180 | |
Nicolas Geoffray | 6427df1 | 2014-12-17 12:34:15 +0000 | [diff] [blame] | 181 | ifeq ($(1),default) |
| 182 | core_compile_options += --compiler-backend=Quick |
| 183 | endif |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 184 | ifeq ($(1),optimizing) |
Serban Constantinescu | 010cf91 | 2014-12-04 18:12:21 +0000 | [diff] [blame] | 185 | core_compile_options += --compiler-backend=Optimizing |
| 186 | core_dex2oat_dependency := $(DEX2OAT) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 187 | core_infix := -optimizing |
| 188 | endif |
| 189 | ifeq ($(1),interpreter) |
| 190 | core_compile_options += --compiler-filter=interpret-only |
| 191 | core_infix := -interpreter |
| 192 | endif |
Andreas Gampe | 825570c | 2015-07-26 10:26:03 -0700 | [diff] [blame] | 193 | ifeq ($(1),interp-ac) |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 194 | core_compile_options += --compiler-filter=verify-at-runtime --runtime-arg -Xverify:softfail |
Andreas Gampe | 825570c | 2015-07-26 10:26:03 -0700 | [diff] [blame] | 195 | core_infix := -interp-ac |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 196 | endif |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 197 | ifeq ($(1),default) |
| 198 | # Default has no infix, no compile options. |
| 199 | endif |
Andreas Gampe | 825570c | 2015-07-26 10:26:03 -0700 | [diff] [blame] | 200 | ifneq ($(filter-out default interpreter interp-ac jit optimizing,$(1)),) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 201 | # Technically this test is not precise, but hopefully good enough. |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 202 | $$(error found $(1) expected default, interpreter, interpreter-access-checks, jit or optimizing) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 203 | endif |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 204 | |
| 205 | ifeq ($(2),pic) |
| 206 | core_compile_options += --compile-pic |
| 207 | core_pic_infix := -pic |
| 208 | endif |
| 209 | ifeq ($(2),no-pic) |
| 210 | # No change for non-pic |
| 211 | endif |
| 212 | ifneq ($(filter-out pic no-pic,$(2)),) |
| 213 | #Technically this test is not precise, but hopefully good enough. |
| 214 | $$(error found $(2) expected pic or no-pic) |
| 215 | endif |
| 216 | |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 217 | core_image_name := $($(3)TARGET_CORE_IMG_OUT_BASE)$$(core_infix)$$(core_pic_infix)$(4)$(CORE_IMG_SUFFIX) |
| 218 | core_oat_name := $($(3)TARGET_CORE_OAT_OUT_BASE)$$(core_infix)$$(core_pic_infix)$(4)$(CORE_OAT_SUFFIX) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 219 | |
| 220 | # Using the bitness suffix makes it easier to add as a dependency for the run-test mk. |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 221 | ifeq ($(3),) |
| 222 | ifdef TARGET_2ND_ARCH |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 223 | $(4)TARGET_CORE_IMAGE_$(1)_$(2)_64 := $$(core_image_name) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 224 | else |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 225 | $(4)TARGET_CORE_IMAGE_$(1)_$(2)_32 := $$(core_image_name) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 226 | endif |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 227 | else |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 228 | $(4)TARGET_CORE_IMAGE_$(1)_$(2)_32 := $$(core_image_name) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 229 | endif |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 230 | $(4)TARGET_CORE_IMG_OUTS += $$(core_image_name) |
| 231 | $(4)TARGET_CORE_OAT_OUTS += $$(core_oat_name) |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 232 | |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 233 | # If we have a wrapper, make the target phony. |
| 234 | ifneq ($(4),) |
| 235 | .PHONY: $$(core_image_name) |
| 236 | endif |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 237 | $$(core_image_name): PRIVATE_CORE_COMPILE_OPTIONS := $$(core_compile_options) |
| 238 | $$(core_image_name): PRIVATE_CORE_IMG_NAME := $$(core_image_name) |
| 239 | $$(core_image_name): PRIVATE_CORE_OAT_NAME := $$(core_oat_name) |
Nicolas Geoffray | a136ab5 | 2014-10-31 10:48:25 +0000 | [diff] [blame] | 240 | $$(core_image_name): $$(TARGET_CORE_DEX_FILES) $$(core_dex2oat_dependency) |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 241 | @echo "target dex2oat: $$@ ($$?)" |
| 242 | @mkdir -p $$(dir $$@) |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 243 | $$(hide) $(4) $$(DEX2OAT)$(5) --runtime-arg -Xms$(DEX2OAT_IMAGE_XMS) \ |
| 244 | --runtime-arg -Xmx$(DEX2OAT_IMAGE_XMX) \ |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 245 | --image-classes=$$(PRELOADED_CLASSES) $$(addprefix --dex-file=,$$(TARGET_CORE_DEX_FILES)) \ |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 246 | $$(addprefix --dex-location=,$$(TARGET_CORE_DEX_LOCATIONS)) --oat-file=$$(PRIVATE_CORE_OAT_NAME) \ |
| 247 | --oat-location=$$(PRIVATE_CORE_OAT_NAME) --image=$$(PRIVATE_CORE_IMG_NAME) \ |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 248 | --base=$$(LIBART_IMG_TARGET_BASE_ADDRESS) --instruction-set=$$($(3)TARGET_ARCH) \ |
Douglas Leung | 3d12ead | 2015-03-18 11:29:14 -0700 | [diff] [blame] | 249 | --instruction-set-variant=$$($(3)DEX2OAT_TARGET_CPU_VARIANT) \ |
Ian Rogers | d582fa4 | 2014-11-05 23:46:43 -0800 | [diff] [blame] | 250 | --instruction-set-features=$$($(3)DEX2OAT_TARGET_INSTRUCTION_SET_FEATURES) \ |
David Srbecky | 461d72a | 2015-06-11 01:27:56 +0100 | [diff] [blame] | 251 | --android-root=$$(PRODUCT_OUT)/system --include-patch-information --generate-debug-info \ |
Nicolas Geoffray | 130bd1b | 2014-11-03 16:23:48 +0000 | [diff] [blame] | 252 | $$(PRIVATE_CORE_COMPILE_OPTIONS) || (rm $$(PRIVATE_CORE_OAT_NAME); exit 1) |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 253 | |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 254 | $$(core_oat_name): $$(core_image_name) |
Andreas Gampe | 2fe0792 | 2014-04-21 07:50:39 -0700 | [diff] [blame] | 255 | |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 256 | # Clean up locally used variables. |
Nicolas Geoffray | a136ab5 | 2014-10-31 10:48:25 +0000 | [diff] [blame] | 257 | core_dex2oat_dependency := |
Andreas Gampe | 63fc30e | 2014-10-24 21:58:16 -0700 | [diff] [blame] | 258 | core_compile_options := |
| 259 | core_image_name := |
| 260 | core_oat_name := |
| 261 | core_infix := |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 262 | core_pic_infix := |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 263 | endef # create-core-oat-target-rules |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 264 | |
Igor Murashkin | 7617abd | 2015-07-10 18:27:47 -0700 | [diff] [blame] | 265 | # $(1): compiler - default, optimizing, jit, interpreter or interpreter-access-checks. |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 266 | # $(2): wrapper. |
| 267 | # $(3): dex2oat suffix. |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 268 | define create-core-oat-target-rule-combination |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 269 | $(call create-core-oat-target-rules,$(1),no-pic,,$(2),$(3)) |
| 270 | $(call create-core-oat-target-rules,$(1),pic,,$(2),$(3)) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 271 | |
| 272 | ifdef TARGET_2ND_ARCH |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 273 | $(call create-core-oat-target-rules,$(1),no-pic,2ND_,$(2),$(3)) |
| 274 | $(call create-core-oat-target-rules,$(1),pic,2ND_,$(2),$(3)) |
Andreas Gampe | c23c9c9 | 2014-10-28 14:47:25 -0700 | [diff] [blame] | 275 | endif |
| 276 | endef |
| 277 | |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 278 | $(eval $(call create-core-oat-target-rule-combination,default,,)) |
| 279 | $(eval $(call create-core-oat-target-rule-combination,optimizing,,)) |
| 280 | $(eval $(call create-core-oat-target-rule-combination,interpreter,,)) |
Andreas Gampe | 825570c | 2015-07-26 10:26:03 -0700 | [diff] [blame] | 281 | $(eval $(call create-core-oat-target-rule-combination,interp-ac,,)) |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 282 | |
| 283 | valgrindTARGET_CORE_IMG_OUTS := |
| 284 | valgrindTARGET_CORE_OAT_OUTS := |
| 285 | $(eval $(call create-core-oat-target-rule-combination,default,valgrind,32)) |
| 286 | $(eval $(call create-core-oat-target-rule-combination,optimizing,valgrind,32)) |
| 287 | $(eval $(call create-core-oat-target-rule-combination,interpreter,valgrind,32)) |
Andreas Gampe | 825570c | 2015-07-26 10:26:03 -0700 | [diff] [blame] | 288 | $(eval $(call create-core-oat-target-rule-combination,interp-ac,valgrind,32)) |
Andreas Gampe | 088b16e | 2014-12-03 21:59:27 -0800 | [diff] [blame] | 289 | |
| 290 | valgrind-test-art-host-dex2oat-target: $(valgrindTARGET_CORE_IMG_OUTS) |
| 291 | |
| 292 | valgrind-test-art-host-dex2oat: valgrind-test-art-host-dex2oat-host valgrind-test-art-host-dex2oat-target |