Home | History | Annotate | Download | only in art
      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 
     17 LOCAL_PATH := $(call my-dir)
     18 
     19 art_path := $(LOCAL_PATH)
     20 
     21 ########################################################################
     22 # clean-oat rules
     23 #
     24 
     25 include $(art_path)/build/Android.common_path.mk
     26 include $(art_path)/build/Android.oat.mk
     27 
     28 # Following the example of build's dont_bother for clean targets.
     29 art_dont_bother := false
     30 ifneq (,$(filter clean-oat%,$(MAKECMDGOALS)))
     31   art_dont_bother := true
     32 endif
     33 
     34 # Don't bother with tests unless there is a test-art*, build-art*, or related target.
     35 art_test_bother := false
     36 ifneq (,$(filter tests test-art% valgrind-test-art% build-art% checkbuild,$(MAKECMDGOALS)))
     37   art_test_bother := true
     38 endif
     39 
     40 .PHONY: clean-oat
     41 clean-oat: clean-oat-host clean-oat-target
     42 
     43 .PHONY: clean-oat-host
     44 clean-oat-host:
     45 	find $(OUT_DIR) -name "*.oat" -o -name "*.odex" -o -name "*.art" -o -name '*.vdex' | xargs rm -f
     46 ifneq ($(TMPDIR),)
     47 	rm -rf $(TMPDIR)/$(USER)/test-*/dalvik-cache/*
     48 	rm -rf $(TMPDIR)/android-data/dalvik-cache/*
     49 else
     50 	rm -rf /tmp/$(USER)/test-*/dalvik-cache/*
     51 	rm -rf /tmp/android-data/dalvik-cache/*
     52 endif
     53 
     54 .PHONY: clean-oat-target
     55 clean-oat-target:
     56 	adb root
     57 	adb wait-for-device remount
     58 	adb shell rm -rf $(ART_TARGET_NATIVETEST_DIR)
     59 	adb shell rm -rf $(ART_TARGET_TEST_DIR)
     60 	adb shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*/*
     61 	adb shell rm -rf $(DEXPREOPT_BOOT_JAR_DIR)/$(DEX2OAT_TARGET_ARCH)
     62 	adb shell rm -rf system/app/$(DEX2OAT_TARGET_ARCH)
     63 ifdef TARGET_2ND_ARCH
     64 	adb shell rm -rf $(DEXPREOPT_BOOT_JAR_DIR)/$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH)
     65 	adb shell rm -rf system/app/$($(TARGET_2ND_ARCH_VAR_PREFIX)DEX2OAT_TARGET_ARCH)
     66 endif
     67 	adb shell rm -rf data/run-test/test-*/dalvik-cache/*
     68 
     69 ifneq ($(art_dont_bother),true)
     70 
     71 ########################################################################
     72 # cpplint rules to style check art source files
     73 
     74 include $(art_path)/build/Android.cpplint.mk
     75 
     76 ########################################################################
     77 # product rules
     78 
     79 include $(art_path)/oatdump/Android.mk
     80 include $(art_path)/tools/Android.mk
     81 include $(art_path)/tools/ahat/Android.mk
     82 include $(art_path)/tools/dexfuzz/Android.mk
     83 include $(art_path)/libart_fake/Android.mk
     84 include $(art_path)/test/Android.run-test-jvmti-java-library.mk
     85 
     86 ART_HOST_DEPENDENCIES := \
     87   $(ART_HOST_EXECUTABLES) \
     88   $(ART_HOST_DEX_DEPENDENCIES) \
     89   $(ART_HOST_SHARED_LIBRARY_DEPENDENCIES)
     90 ART_TARGET_DEPENDENCIES := \
     91   $(ART_TARGET_EXECUTABLES) \
     92   $(ART_TARGET_DEX_DEPENDENCIES) \
     93   $(ART_TARGET_SHARED_LIBRARY_DEPENDENCIES)
     94 
     95 ########################################################################
     96 # test rules
     97 
     98 ifeq ($(art_test_bother),true)
     99 
    100 # All the dependencies that must be built ahead of sync-ing them onto the target device.
    101 TEST_ART_TARGET_SYNC_DEPS :=
    102 
    103 include $(art_path)/build/Android.common_test.mk
    104 include $(art_path)/build/Android.gtest.mk
    105 include $(art_path)/test/Android.run-test.mk
    106 
    107 TEST_ART_ADB_ROOT_AND_REMOUNT := \
    108     (adb root && \
    109      adb wait-for-device remount && \
    110      ((adb shell touch /system/testfile && \
    111        (adb shell rm /system/testfile || true)) || \
    112       (adb disable-verity && \
    113        adb reboot && \
    114        adb wait-for-device root && \
    115        adb wait-for-device remount)))
    116 
    117 # Sync test files to the target, depends upon all things that must be pushed to the target.
    118 .PHONY: test-art-target-sync
    119 # Check if we need to sync. In case ART_TEST_ANDROID_ROOT is not empty,
    120 # the code below uses 'adb push' instead of 'adb sync', which does not
    121 # check if the files on the device have changed.
    122 ifneq ($(ART_TEST_NO_SYNC),true)
    123 ifeq ($(ART_TEST_ANDROID_ROOT),)
    124 test-art-target-sync: $(TEST_ART_TARGET_SYNC_DEPS)
    125 	$(TEST_ART_ADB_ROOT_AND_REMOUNT)
    126 	adb sync
    127 else
    128 test-art-target-sync: $(TEST_ART_TARGET_SYNC_DEPS)
    129 	$(TEST_ART_ADB_ROOT_AND_REMOUNT)
    130 	adb wait-for-device push $(ANDROID_PRODUCT_OUT)/system $(ART_TEST_ANDROID_ROOT)
    131 # Push the contents of the `data` dir into `/data` on the device.  If
    132 # `/data` already exists on the device, it is not overwritten, but its
    133 # contents are updated.
    134 	adb push $(ANDROID_PRODUCT_OUT)/data /
    135 endif
    136 endif
    137 
    138 # "mm test-art" to build and run all tests on host and device
    139 .PHONY: test-art
    140 test-art: test-art-host test-art-target
    141 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    142 
    143 .PHONY: test-art-gtest
    144 test-art-gtest: test-art-host-gtest test-art-target-gtest
    145 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    146 
    147 .PHONY: test-art-run-test
    148 test-art-run-test: test-art-host-run-test test-art-target-run-test
    149 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    150 
    151 ########################################################################
    152 # host test rules
    153 
    154 VIXL_TEST_DEPENDENCY :=
    155 # We can only run the vixl tests on 64-bit hosts (vixl testing issue) when its a
    156 # top-level build (to declare the vixl test rule).
    157 ifneq ($(HOST_PREFER_32_BIT),true)
    158 ifeq ($(ONE_SHOT_MAKEFILE),)
    159 VIXL_TEST_DEPENDENCY := run-vixl-tests
    160 endif
    161 endif
    162 
    163 .PHONY: test-art-host-vixl
    164 test-art-host-vixl: $(VIXL_TEST_DEPENDENCY)
    165 
    166 # "mm test-art-host" to build and run all host tests.
    167 .PHONY: test-art-host
    168 test-art-host: test-art-host-gtest test-art-host-run-test \
    169                test-art-host-vixl test-art-host-dexdump
    170 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    171 
    172 # All host tests that run solely with the default compiler.
    173 .PHONY: test-art-host-default
    174 test-art-host-default: test-art-host-run-test-default
    175 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    176 
    177 # All host tests that run solely with the optimizing compiler.
    178 .PHONY: test-art-host-optimizing
    179 test-art-host-optimizing: test-art-host-run-test-optimizing
    180 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    181 
    182 # All host tests that run solely on the interpreter.
    183 .PHONY: test-art-host-interpreter
    184 test-art-host-interpreter: test-art-host-run-test-interpreter
    185 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    186 
    187 # All host tests that run solely on the jit.
    188 .PHONY: test-art-host-jit
    189 test-art-host-jit: test-art-host-run-test-jit
    190 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    191 
    192 # Primary host architecture variants:
    193 .PHONY: test-art-host$(ART_PHONY_TEST_HOST_SUFFIX)
    194 test-art-host$(ART_PHONY_TEST_HOST_SUFFIX): test-art-host-gtest$(ART_PHONY_TEST_HOST_SUFFIX) \
    195     test-art-host-run-test$(ART_PHONY_TEST_HOST_SUFFIX)
    196 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    197 
    198 .PHONY: test-art-host-default$(ART_PHONY_TEST_HOST_SUFFIX)
    199 test-art-host-default$(ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-default$(ART_PHONY_TEST_HOST_SUFFIX)
    200 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    201 
    202 .PHONY: test-art-host-optimizing$(ART_PHONY_TEST_HOST_SUFFIX)
    203 test-art-host-optimizing$(ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-optimizing$(ART_PHONY_TEST_HOST_SUFFIX)
    204 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    205 
    206 .PHONY: test-art-host-interpreter$(ART_PHONY_TEST_HOST_SUFFIX)
    207 test-art-host-interpreter$(ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-interpreter$(ART_PHONY_TEST_HOST_SUFFIX)
    208 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    209 
    210 .PHONY: test-art-host-jit$(ART_PHONY_TEST_HOST_SUFFIX)
    211 test-art-host-jit$(ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-jit$(ART_PHONY_TEST_HOST_SUFFIX)
    212 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    213 
    214 # Secondary host architecture variants:
    215 ifneq ($(HOST_PREFER_32_BIT),true)
    216 .PHONY: test-art-host$(2ND_ART_PHONY_TEST_HOST_SUFFIX)
    217 test-art-host$(2ND_ART_PHONY_TEST_HOST_SUFFIX): test-art-host-gtest$(2ND_ART_PHONY_TEST_HOST_SUFFIX) \
    218     test-art-host-run-test$(2ND_ART_PHONY_TEST_HOST_SUFFIX)
    219 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    220 
    221 .PHONY: test-art-host-default$(2ND_ART_PHONY_TEST_HOST_SUFFIX)
    222 test-art-host-default$(2ND_ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-default$(2ND_ART_PHONY_TEST_HOST_SUFFIX)
    223 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    224 
    225 .PHONY: test-art-host-optimizing$(2ND_ART_PHONY_TEST_HOST_SUFFIX)
    226 test-art-host-optimizing$(2ND_ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-optimizing$(2ND_ART_PHONY_TEST_HOST_SUFFIX)
    227 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    228 
    229 .PHONY: test-art-host-interpreter$(2ND_ART_PHONY_TEST_HOST_SUFFIX)
    230 test-art-host-interpreter$(2ND_ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-interpreter$(2ND_ART_PHONY_TEST_HOST_SUFFIX)
    231 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    232 
    233 .PHONY: test-art-host-jit$(2ND_ART_PHONY_TEST_HOST_SUFFIX)
    234 test-art-host-jit$(2ND_ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-jit$(2ND_ART_PHONY_TEST_HOST_SUFFIX)
    235 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    236 endif
    237 
    238 # Dexdump/list regression test.
    239 .PHONY: test-art-host-dexdump
    240 test-art-host-dexdump: $(addprefix $(HOST_OUT_EXECUTABLES)/, dexdump2 dexlist)
    241 	ANDROID_HOST_OUT=$(realpath $(HOST_OUT)) art/test/dexdump/run-all-tests
    242 
    243 # Valgrind.
    244 .PHONY: valgrind-test-art-host
    245 valgrind-test-art-host: valgrind-test-art-host-gtest
    246 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    247 
    248 .PHONY: valgrind-test-art-host32
    249 valgrind-test-art-host32: valgrind-test-art-host-gtest32
    250 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    251 
    252 .PHONY: valgrind-test-art-host64
    253 valgrind-test-art-host64: valgrind-test-art-host-gtest64
    254 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    255 
    256 ########################################################################
    257 # target test rules
    258 
    259 # "mm test-art-target" to build and run all target tests.
    260 .PHONY: test-art-target
    261 test-art-target: test-art-target-gtest test-art-target-run-test
    262 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    263 
    264 # All target tests that run solely with the default compiler.
    265 .PHONY: test-art-target-default
    266 test-art-target-default: test-art-target-run-test-default
    267 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    268 
    269 # All target tests that run solely with the optimizing compiler.
    270 .PHONY: test-art-target-optimizing
    271 test-art-target-optimizing: test-art-target-run-test-optimizing
    272 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    273 
    274 # All target tests that run solely on the interpreter.
    275 .PHONY: test-art-target-interpreter
    276 test-art-target-interpreter: test-art-target-run-test-interpreter
    277 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    278 
    279 # All target tests that run solely on the jit.
    280 .PHONY: test-art-target-jit
    281 test-art-target-jit: test-art-target-run-test-jit
    282 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    283 
    284 # Primary target architecture variants:
    285 .PHONY: test-art-target$(ART_PHONY_TEST_TARGET_SUFFIX)
    286 test-art-target$(ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-gtest$(ART_PHONY_TEST_TARGET_SUFFIX) \
    287     test-art-target-run-test$(ART_PHONY_TEST_TARGET_SUFFIX)
    288 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    289 
    290 .PHONY: test-art-target-default$(ART_PHONY_TEST_TARGET_SUFFIX)
    291 test-art-target-default$(ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-default$(ART_PHONY_TEST_TARGET_SUFFIX)
    292 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    293 
    294 .PHONY: test-art-target-optimizing$(ART_PHONY_TEST_TARGET_SUFFIX)
    295 test-art-target-optimizing$(ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-optimizing$(ART_PHONY_TEST_TARGET_SUFFIX)
    296 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    297 
    298 .PHONY: test-art-target-interpreter$(ART_PHONY_TEST_TARGET_SUFFIX)
    299 test-art-target-interpreter$(ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-interpreter$(ART_PHONY_TEST_TARGET_SUFFIX)
    300 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    301 
    302 .PHONY: test-art-target-jit$(ART_PHONY_TEST_TARGET_SUFFIX)
    303 test-art-target-jit$(ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-jit$(ART_PHONY_TEST_TARGET_SUFFIX)
    304 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    305 
    306 # Secondary target architecture variants:
    307 ifdef TARGET_2ND_ARCH
    308 .PHONY: test-art-target$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
    309 test-art-target$(2ND_ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-gtest$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) \
    310     test-art-target-run-test$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
    311 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    312 
    313 .PHONY: test-art-target-default$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
    314 test-art-target-default$(2ND_ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-default$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
    315 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    316 
    317 .PHONY: test-art-target-optimizing$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
    318 test-art-target-optimizing$(2ND_ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-optimizing$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
    319 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    320 
    321 .PHONY: test-art-target-interpreter$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
    322 test-art-target-interpreter$(2ND_ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-interpreter$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
    323 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    324 
    325 .PHONY: test-art-target-jit$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
    326 test-art-target-jit$(2ND_ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-jit$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
    327 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    328 endif
    329 
    330 # Valgrind.
    331 .PHONY: valgrind-test-art-target
    332 valgrind-test-art-target: valgrind-test-art-target-gtest
    333 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    334 
    335 .PHONY: valgrind-test-art-target32
    336 valgrind-test-art-target32: valgrind-test-art-target-gtest32
    337 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    338 
    339 .PHONY: valgrind-test-art-target64
    340 valgrind-test-art-target64: valgrind-test-art-target-gtest64
    341 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    342 
    343 endif  # art_test_bother
    344 
    345 ####################################################################################################
    346 # Fake packages to ensure generation of libopenjdkd when one builds with mm/mmm/mmma.
    347 #
    348 # The library is required for starting a runtime in debug mode, but libartd does not depend on it
    349 # (dependency cycle otherwise).
    350 #
    351 # Note: * As the package is phony to create a dependency the package name is irrelevant.
    352 #       * We make MULTILIB explicit to "both," just to state here that we want both libraries on
    353 #         64-bit systems, even if it is the default.
    354 
    355 # ART on the host.
    356 ifeq ($(ART_BUILD_HOST_DEBUG),true)
    357 include $(CLEAR_VARS)
    358 LOCAL_MODULE := art-libartd-libopenjdkd-host-dependency
    359 LOCAL_MULTILIB := both
    360 LOCAL_REQUIRED_MODULES := libopenjdkd
    361 LOCAL_IS_HOST_MODULE := true
    362 include $(BUILD_PHONY_PACKAGE)
    363 endif
    364 
    365 # ART on the target.
    366 ifeq ($(ART_BUILD_TARGET_DEBUG),true)
    367 include $(CLEAR_VARS)
    368 LOCAL_MODULE := art-libartd-libopenjdkd-target-dependency
    369 LOCAL_MULTILIB := both
    370 LOCAL_REQUIRED_MODULES := libopenjdkd
    371 include $(BUILD_PHONY_PACKAGE)
    372 endif
    373 
    374 ########################################################################
    375 # "m build-art" for quick minimal build
    376 .PHONY: build-art
    377 build-art: build-art-host build-art-target
    378 
    379 .PHONY: build-art-host
    380 build-art-host:   $(HOST_OUT_EXECUTABLES)/art $(ART_HOST_DEPENDENCIES) $(HOST_CORE_IMG_OUTS)
    381 
    382 .PHONY: build-art-target
    383 build-art-target: $(TARGET_OUT_EXECUTABLES)/art $(ART_TARGET_DEPENDENCIES) $(TARGET_CORE_IMG_OUTS)
    384 
    385 ########################################################################
    386 # Phony target for only building what go/lem requires on target.
    387 .PHONY: build-art-target-golem
    388 # Also include libartbenchmark, we always include it when running golem.
    389 # libstdc++ is needed when building for ART_TARGET_LINUX.
    390 ART_TARGET_SHARED_LIBRARY_BENCHMARK := $(TARGET_OUT_SHARED_LIBRARIES)/libartbenchmark.so
    391 build-art-target-golem: dex2oat dalvikvm patchoat linker libstdc++ \
    392                         $(TARGET_OUT_EXECUTABLES)/art \
    393                         $(TARGET_OUT)/etc/public.libraries.txt \
    394                         $(ART_TARGET_DEX_DEPENDENCIES) \
    395                         $(ART_TARGET_SHARED_LIBRARY_DEPENDENCIES) \
    396                         $(ART_TARGET_SHARED_LIBRARY_BENCHMARK) \
    397                         $(TARGET_CORE_IMG_OUT_BASE).art \
    398                         $(TARGET_CORE_IMG_OUT_BASE)-interpreter.art
    399 	sed -i '/libartd.so/d' $(TARGET_OUT)/etc/public.libraries.txt
    400 	# remove libartd.so from public.libraries.txt because golem builds won't have it.
    401 
    402 ########################################################################
    403 # Phony target for building what go/lem requires on host.
    404 .PHONY: build-art-host-golem
    405 # Also include libartbenchmark, we always include it when running golem.
    406 ART_HOST_SHARED_LIBRARY_BENCHMARK := $(ART_HOST_OUT_SHARED_LIBRARIES)/libartbenchmark.so
    407 build-art-host-golem: build-art-host \
    408                       $(ART_HOST_SHARED_LIBRARY_BENCHMARK)
    409 
    410 ########################################################################
    411 # Rules for building all dependencies for tests.
    412 
    413 .PHONY: build-art-host-tests
    414 build-art-host-tests:   build-art-host $(TEST_ART_RUN_TEST_DEPENDENCIES) $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES) $(ART_TEST_HOST_GTEST_DEPENDENCIES) | $(TEST_ART_RUN_TEST_ORDERONLY_DEPENDENCIES)
    415 
    416 .PHONY: build-art-target-tests
    417 build-art-target-tests:   build-art-target $(TEST_ART_RUN_TEST_DEPENDENCIES) $(TEST_ART_TARGET_SYNC_DEPS) | $(TEST_ART_RUN_TEST_ORDERONLY_DEPENDENCIES)
    418 
    419 ########################################################################
    420 # targets to switch back and forth from libdvm to libart
    421 
    422 .PHONY: use-art
    423 use-art:
    424 	adb root
    425 	adb wait-for-device shell stop
    426 	adb shell setprop persist.sys.dalvik.vm.lib.2 libart.so
    427 	adb shell start
    428 
    429 .PHONY: use-artd
    430 use-artd:
    431 	adb root
    432 	adb wait-for-device shell stop
    433 	adb shell setprop persist.sys.dalvik.vm.lib.2 libartd.so
    434 	adb shell start
    435 
    436 .PHONY: use-dalvik
    437 use-dalvik:
    438 	adb root
    439 	adb wait-for-device shell stop
    440 	adb shell setprop persist.sys.dalvik.vm.lib.2 libdvm.so
    441 	adb shell start
    442 
    443 .PHONY: use-art-full
    444 use-art-full:
    445 	adb root
    446 	adb wait-for-device shell stop
    447 	adb shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*
    448 	adb shell setprop dalvik.vm.dex2oat-filter \"\"
    449 	adb shell setprop dalvik.vm.image-dex2oat-filter \"\"
    450 	adb shell setprop persist.sys.dalvik.vm.lib.2 libart.so
    451 	adb shell setprop dalvik.vm.usejit false
    452 	adb shell start
    453 
    454 .PHONY: use-artd-full
    455 use-artd-full:
    456 	adb root
    457 	adb wait-for-device shell stop
    458 	adb shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*
    459 	adb shell setprop dalvik.vm.dex2oat-filter \"\"
    460 	adb shell setprop dalvik.vm.image-dex2oat-filter \"\"
    461 	adb shell setprop persist.sys.dalvik.vm.lib.2 libartd.so
    462 	adb shell setprop dalvik.vm.usejit false
    463 	adb shell start
    464 
    465 .PHONY: use-art-jit
    466 use-art-jit:
    467 	adb root
    468 	adb wait-for-device shell stop
    469 	adb shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*
    470 	adb shell setprop dalvik.vm.dex2oat-filter "verify-at-runtime"
    471 	adb shell setprop dalvik.vm.image-dex2oat-filter "verify-at-runtime"
    472 	adb shell setprop persist.sys.dalvik.vm.lib.2 libart.so
    473 	adb shell setprop dalvik.vm.usejit true
    474 	adb shell start
    475 
    476 .PHONY: use-art-interpret-only
    477 use-art-interpret-only:
    478 	adb root
    479 	adb wait-for-device shell stop
    480 	adb shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*
    481 	adb shell setprop dalvik.vm.dex2oat-filter "interpret-only"
    482 	adb shell setprop dalvik.vm.image-dex2oat-filter "interpret-only"
    483 	adb shell setprop persist.sys.dalvik.vm.lib.2 libart.so
    484 	adb shell setprop dalvik.vm.usejit false
    485 	adb shell start
    486 
    487 .PHONY: use-artd-interpret-only
    488 use-artd-interpret-only:
    489 	adb root
    490 	adb wait-for-device shell stop
    491 	adb shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*
    492 	adb shell setprop dalvik.vm.dex2oat-filter "interpret-only"
    493 	adb shell setprop dalvik.vm.image-dex2oat-filter "interpret-only"
    494 	adb shell setprop persist.sys.dalvik.vm.lib.2 libartd.so
    495 	adb shell setprop dalvik.vm.usejit false
    496 	adb shell start
    497 
    498 .PHONY: use-art-verify-none
    499 use-art-verify-none:
    500 	adb root
    501 	adb wait-for-device shell stop
    502 	adb shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*
    503 	adb shell setprop dalvik.vm.dex2oat-filter "verify-none"
    504 	adb shell setprop dalvik.vm.image-dex2oat-filter "verify-none"
    505 	adb shell setprop persist.sys.dalvik.vm.lib.2 libart.so
    506 	adb shell setprop dalvik.vm.usejit false
    507 	adb shell start
    508 
    509 ########################################################################
    510 
    511 endif # !art_dont_bother
    512 
    513 # Clear locally used variables.
    514 art_dont_bother :=
    515 art_test_bother :=
    516 TEST_ART_TARGET_SYNC_DEPS :=
    517 
    518 # Helper target that depends on boot image creation.
    519 #
    520 # Can be used, for example, to dump initialization failures:
    521 #   m art-boot-image ART_BOOT_IMAGE_EXTRA_ARGS=--dump-init-failures=fails.txt
    522 .PHONY: art-boot-image
    523 art-boot-image: $(DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME)
    524 
    525 .PHONY: art-job-images
    526 art-job-images: \
    527   $(DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) \
    528   $(2ND_DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) \
    529   $(HOST_OUT_EXECUTABLES)/dex2oats \
    530   $(HOST_OUT_EXECUTABLES)/dex2oatds \
    531   $(HOST_OUT_EXECUTABLES)/profman
    532