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