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