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 
     85 ART_HOST_DEPENDENCIES := \
     86   $(ART_HOST_EXECUTABLES) \
     87   $(ART_HOST_DEX_DEPENDENCIES) \
     88   $(ART_HOST_SHARED_LIBRARY_DEPENDENCIES)
     89 
     90 ifeq ($(ART_BUILD_HOST_DEBUG),true)
     91 ART_HOST_DEPENDENCIES += $(ART_HOST_SHARED_LIBRARY_DEBUG_DEPENDENCIES)
     92 endif
     93 
     94 ART_TARGET_DEPENDENCIES := \
     95   $(ART_TARGET_EXECUTABLES) \
     96   $(ART_TARGET_DEX_DEPENDENCIES) \
     97   $(ART_TARGET_SHARED_LIBRARY_DEPENDENCIES)
     98 
     99 ifeq ($(ART_BUILD_TARGET_DEBUG),true)
    100 ART_TARGET_DEPENDENCIES += $(ART_TARGET_SHARED_LIBRARY_DEBUG_DEPENDENCIES)
    101 endif
    102 
    103 ########################################################################
    104 # test rules
    105 
    106 ifeq ($(art_test_bother),true)
    107 
    108 # All the dependencies that must be built ahead of sync-ing them onto the target device.
    109 TEST_ART_TARGET_SYNC_DEPS :=
    110 
    111 include $(art_path)/build/Android.common_test.mk
    112 include $(art_path)/build/Android.gtest.mk
    113 include $(art_path)/test/Android.run-test.mk
    114 
    115 TEST_ART_ADB_ROOT_AND_REMOUNT := \
    116     (adb root && \
    117      adb wait-for-device remount && \
    118      ((adb shell touch /system/testfile && \
    119        (adb shell rm /system/testfile || true)) || \
    120       (adb disable-verity && \
    121        adb reboot && \
    122        adb wait-for-device root && \
    123        adb wait-for-device remount)))
    124 
    125 # Sync test files to the target, depends upon all things that must be pushed to the target.
    126 .PHONY: test-art-target-sync
    127 # Check if we need to sync. In case ART_TEST_ANDROID_ROOT is not empty,
    128 # the code below uses 'adb push' instead of 'adb sync', which does not
    129 # check if the files on the device have changed.
    130 ifneq ($(ART_TEST_NO_SYNC),true)
    131 ifeq ($(ART_TEST_ANDROID_ROOT),)
    132 test-art-target-sync: $(TEST_ART_TARGET_SYNC_DEPS)
    133 	$(TEST_ART_ADB_ROOT_AND_REMOUNT)
    134 	adb sync system && adb sync data
    135 else
    136 test-art-target-sync: $(TEST_ART_TARGET_SYNC_DEPS)
    137 	$(TEST_ART_ADB_ROOT_AND_REMOUNT)
    138 	adb wait-for-device push $(ANDROID_PRODUCT_OUT)/system $(ART_TEST_ANDROID_ROOT)
    139 # Push the contents of the `data` dir into `/data` on the device.  If
    140 # `/data` already exists on the device, it is not overwritten, but its
    141 # contents are updated.
    142 	adb push $(ANDROID_PRODUCT_OUT)/data /
    143 endif
    144 endif
    145 
    146 # "mm test-art" to build and run all tests on host and device
    147 .PHONY: test-art
    148 test-art: test-art-host test-art-target
    149 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    150 
    151 .PHONY: test-art-gtest
    152 test-art-gtest: test-art-host-gtest test-art-target-gtest
    153 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    154 
    155 .PHONY: test-art-run-test
    156 test-art-run-test: test-art-host-run-test test-art-target-run-test
    157 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    158 
    159 ########################################################################
    160 # host test rules
    161 
    162 VIXL_TEST_DEPENDENCY :=
    163 # We can only run the vixl tests on 64-bit hosts (vixl testing issue) when its a
    164 # top-level build (to declare the vixl test rule).
    165 ifneq ($(HOST_PREFER_32_BIT),true)
    166 ifeq ($(ONE_SHOT_MAKEFILE),)
    167 VIXL_TEST_DEPENDENCY := run-vixl-tests
    168 endif
    169 endif
    170 
    171 .PHONY: test-art-host-vixl
    172 test-art-host-vixl: $(VIXL_TEST_DEPENDENCY)
    173 
    174 # "mm test-art-host" to build and run all host tests.
    175 .PHONY: test-art-host
    176 test-art-host: test-art-host-gtest test-art-host-run-test \
    177                test-art-host-vixl test-art-host-dexdump
    178 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    179 
    180 # All host tests that run solely with the default compiler.
    181 .PHONY: test-art-host-default
    182 test-art-host-default: test-art-host-run-test-default
    183 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    184 
    185 # All host tests that run solely with the optimizing compiler.
    186 .PHONY: test-art-host-optimizing
    187 test-art-host-optimizing: test-art-host-run-test-optimizing
    188 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    189 
    190 # All host tests that run solely on the interpreter.
    191 .PHONY: test-art-host-interpreter
    192 test-art-host-interpreter: test-art-host-run-test-interpreter
    193 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    194 
    195 # All host tests that run solely on the jit.
    196 .PHONY: test-art-host-jit
    197 test-art-host-jit: test-art-host-run-test-jit
    198 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    199 
    200 # Primary host architecture variants:
    201 .PHONY: test-art-host$(ART_PHONY_TEST_HOST_SUFFIX)
    202 test-art-host$(ART_PHONY_TEST_HOST_SUFFIX): test-art-host-gtest$(ART_PHONY_TEST_HOST_SUFFIX) \
    203     test-art-host-run-test$(ART_PHONY_TEST_HOST_SUFFIX)
    204 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    205 
    206 .PHONY: test-art-host-default$(ART_PHONY_TEST_HOST_SUFFIX)
    207 test-art-host-default$(ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-default$(ART_PHONY_TEST_HOST_SUFFIX)
    208 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    209 
    210 .PHONY: test-art-host-optimizing$(ART_PHONY_TEST_HOST_SUFFIX)
    211 test-art-host-optimizing$(ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-optimizing$(ART_PHONY_TEST_HOST_SUFFIX)
    212 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    213 
    214 .PHONY: test-art-host-interpreter$(ART_PHONY_TEST_HOST_SUFFIX)
    215 test-art-host-interpreter$(ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-interpreter$(ART_PHONY_TEST_HOST_SUFFIX)
    216 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    217 
    218 .PHONY: test-art-host-jit$(ART_PHONY_TEST_HOST_SUFFIX)
    219 test-art-host-jit$(ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-jit$(ART_PHONY_TEST_HOST_SUFFIX)
    220 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    221 
    222 # Secondary host architecture variants:
    223 ifneq ($(HOST_PREFER_32_BIT),true)
    224 .PHONY: test-art-host$(2ND_ART_PHONY_TEST_HOST_SUFFIX)
    225 test-art-host$(2ND_ART_PHONY_TEST_HOST_SUFFIX): test-art-host-gtest$(2ND_ART_PHONY_TEST_HOST_SUFFIX) \
    226     test-art-host-run-test$(2ND_ART_PHONY_TEST_HOST_SUFFIX)
    227 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    228 
    229 .PHONY: test-art-host-default$(2ND_ART_PHONY_TEST_HOST_SUFFIX)
    230 test-art-host-default$(2ND_ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-default$(2ND_ART_PHONY_TEST_HOST_SUFFIX)
    231 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    232 
    233 .PHONY: test-art-host-optimizing$(2ND_ART_PHONY_TEST_HOST_SUFFIX)
    234 test-art-host-optimizing$(2ND_ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-optimizing$(2ND_ART_PHONY_TEST_HOST_SUFFIX)
    235 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    236 
    237 .PHONY: test-art-host-interpreter$(2ND_ART_PHONY_TEST_HOST_SUFFIX)
    238 test-art-host-interpreter$(2ND_ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-interpreter$(2ND_ART_PHONY_TEST_HOST_SUFFIX)
    239 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    240 
    241 .PHONY: test-art-host-jit$(2ND_ART_PHONY_TEST_HOST_SUFFIX)
    242 test-art-host-jit$(2ND_ART_PHONY_TEST_HOST_SUFFIX): test-art-host-run-test-jit$(2ND_ART_PHONY_TEST_HOST_SUFFIX)
    243 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    244 endif
    245 
    246 # Dexdump/list regression test.
    247 .PHONY: test-art-host-dexdump
    248 test-art-host-dexdump: $(addprefix $(HOST_OUT_EXECUTABLES)/, dexdump2 dexlist)
    249 	ANDROID_HOST_OUT=$(realpath $(HOST_OUT)) art/test/dexdump/run-all-tests
    250 
    251 # Valgrind.
    252 .PHONY: valgrind-test-art-host
    253 valgrind-test-art-host: valgrind-test-art-host-gtest
    254 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    255 
    256 .PHONY: valgrind-test-art-host32
    257 valgrind-test-art-host32: valgrind-test-art-host-gtest32
    258 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    259 
    260 .PHONY: valgrind-test-art-host64
    261 valgrind-test-art-host64: valgrind-test-art-host-gtest64
    262 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    263 
    264 ########################################################################
    265 # target test rules
    266 
    267 # "mm test-art-target" to build and run all target tests.
    268 .PHONY: test-art-target
    269 test-art-target: test-art-target-gtest test-art-target-run-test
    270 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    271 
    272 # All target tests that run solely with the default compiler.
    273 .PHONY: test-art-target-default
    274 test-art-target-default: test-art-target-run-test-default
    275 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    276 
    277 # All target tests that run solely with the optimizing compiler.
    278 .PHONY: test-art-target-optimizing
    279 test-art-target-optimizing: test-art-target-run-test-optimizing
    280 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    281 
    282 # All target tests that run solely on the interpreter.
    283 .PHONY: test-art-target-interpreter
    284 test-art-target-interpreter: test-art-target-run-test-interpreter
    285 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    286 
    287 # All target tests that run solely on the jit.
    288 .PHONY: test-art-target-jit
    289 test-art-target-jit: test-art-target-run-test-jit
    290 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    291 
    292 # Primary target architecture variants:
    293 .PHONY: test-art-target$(ART_PHONY_TEST_TARGET_SUFFIX)
    294 test-art-target$(ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-gtest$(ART_PHONY_TEST_TARGET_SUFFIX) \
    295     test-art-target-run-test$(ART_PHONY_TEST_TARGET_SUFFIX)
    296 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    297 
    298 .PHONY: test-art-target-default$(ART_PHONY_TEST_TARGET_SUFFIX)
    299 test-art-target-default$(ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-default$(ART_PHONY_TEST_TARGET_SUFFIX)
    300 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    301 
    302 .PHONY: test-art-target-optimizing$(ART_PHONY_TEST_TARGET_SUFFIX)
    303 test-art-target-optimizing$(ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-optimizing$(ART_PHONY_TEST_TARGET_SUFFIX)
    304 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    305 
    306 .PHONY: test-art-target-interpreter$(ART_PHONY_TEST_TARGET_SUFFIX)
    307 test-art-target-interpreter$(ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-interpreter$(ART_PHONY_TEST_TARGET_SUFFIX)
    308 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    309 
    310 .PHONY: test-art-target-jit$(ART_PHONY_TEST_TARGET_SUFFIX)
    311 test-art-target-jit$(ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-jit$(ART_PHONY_TEST_TARGET_SUFFIX)
    312 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    313 
    314 # Secondary target architecture variants:
    315 ifdef TARGET_2ND_ARCH
    316 .PHONY: test-art-target$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
    317 test-art-target$(2ND_ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-gtest$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) \
    318     test-art-target-run-test$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
    319 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    320 
    321 .PHONY: test-art-target-default$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
    322 test-art-target-default$(2ND_ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-default$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
    323 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    324 
    325 .PHONY: test-art-target-optimizing$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
    326 test-art-target-optimizing$(2ND_ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-optimizing$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
    327 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    328 
    329 .PHONY: test-art-target-interpreter$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
    330 test-art-target-interpreter$(2ND_ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-interpreter$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
    331 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    332 
    333 .PHONY: test-art-target-jit$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
    334 test-art-target-jit$(2ND_ART_PHONY_TEST_TARGET_SUFFIX): test-art-target-run-test-jit$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)
    335 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    336 endif
    337 
    338 # Valgrind.
    339 .PHONY: valgrind-test-art-target
    340 valgrind-test-art-target: valgrind-test-art-target-gtest
    341 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    342 
    343 .PHONY: valgrind-test-art-target32
    344 valgrind-test-art-target32: valgrind-test-art-target-gtest32
    345 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    346 
    347 .PHONY: valgrind-test-art-target64
    348 valgrind-test-art-target64: valgrind-test-art-target-gtest64
    349 	$(hide) $(call ART_TEST_PREREQ_FINISHED,$@)
    350 
    351 endif  # art_test_bother
    352 
    353 #######################
    354 # Fake packages for ART
    355 
    356 # The art-runtime package depends on the core ART libraries and binaries. It exists so we can
    357 # manipulate the set of things shipped, e.g., add debug versions and so on.
    358 
    359 include $(CLEAR_VARS)
    360 LOCAL_MODULE := art-runtime
    361 
    362 # Base requirements.
    363 LOCAL_REQUIRED_MODULES := \
    364     dalvikvm \
    365     dex2oat \
    366     dexoptanalyzer \
    367     libart \
    368     libart-compiler \
    369     libopenjdkjvm \
    370     libopenjdkjvmti \
    371     patchoat \
    372     profman \
    373 
    374 # For nosy apps, we provide a fake library that avoids namespace issues and gives some warnings.
    375 LOCAL_REQUIRED_MODULES += libart_fake
    376 
    377 # Potentially add in debug variants:
    378 #
    379 # * We will never add them if PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD = false.
    380 # * We will always add them if PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD = true.
    381 # * Otherwise, we will add them by default to userdebug and eng builds.
    382 art_target_include_debug_build := $(PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD)
    383 ifneq (false,$(art_target_include_debug_build))
    384 ifneq (,$(filter userdebug eng,$(TARGET_BUILD_VARIANT)))
    385   art_target_include_debug_build := true
    386 endif
    387 ifeq (true,$(art_target_include_debug_build))
    388 LOCAL_REQUIRED_MODULES += \
    389     dex2oatd \
    390     dexoptanalyzerd \
    391     libartd \
    392     libartd-compiler \
    393     libopenjdkd \
    394     libopenjdkjvmd \
    395     libopenjdkjvmtid \
    396     patchoatd \
    397     profmand \
    398 
    399 endif
    400 endif
    401 
    402 include $(BUILD_PHONY_PACKAGE)
    403 
    404 # The art-tools package depends on helpers and tools that are useful for developers and on-device
    405 # investigations.
    406 
    407 include $(CLEAR_VARS)
    408 LOCAL_MODULE := art-tools
    409 LOCAL_REQUIRED_MODULES := \
    410     ahat \
    411     dexdiag \
    412     dexdump \
    413     dexlist \
    414     hprof-conv \
    415     oatdump \
    416 
    417 include $(BUILD_PHONY_PACKAGE)
    418 
    419 ####################################################################################################
    420 # Fake packages to ensure generation of libopenjdkd when one builds with mm/mmm/mmma.
    421 #
    422 # The library is required for starting a runtime in debug mode, but libartd does not depend on it
    423 # (dependency cycle otherwise).
    424 #
    425 # Note: * As the package is phony to create a dependency the package name is irrelevant.
    426 #       * We make MULTILIB explicit to "both," just to state here that we want both libraries on
    427 #         64-bit systems, even if it is the default.
    428 
    429 # ART on the host.
    430 ifeq ($(ART_BUILD_HOST_DEBUG),true)
    431 include $(CLEAR_VARS)
    432 LOCAL_MODULE := art-libartd-libopenjdkd-host-dependency
    433 LOCAL_MULTILIB := both
    434 LOCAL_REQUIRED_MODULES := libopenjdkd
    435 LOCAL_IS_HOST_MODULE := true
    436 include $(BUILD_PHONY_PACKAGE)
    437 endif
    438 
    439 # ART on the target.
    440 ifeq ($(ART_BUILD_TARGET_DEBUG),true)
    441 include $(CLEAR_VARS)
    442 LOCAL_MODULE := art-libartd-libopenjdkd-target-dependency
    443 LOCAL_MULTILIB := both
    444 LOCAL_REQUIRED_MODULES := libopenjdkd
    445 include $(BUILD_PHONY_PACKAGE)
    446 endif
    447 
    448 ########################################################################
    449 # "m build-art" for quick minimal build
    450 .PHONY: build-art
    451 build-art: build-art-host build-art-target
    452 
    453 .PHONY: build-art-host
    454 build-art-host:   $(HOST_OUT_EXECUTABLES)/art $(ART_HOST_DEPENDENCIES) $(HOST_CORE_IMG_OUTS)
    455 
    456 .PHONY: build-art-target
    457 build-art-target: $(TARGET_OUT_EXECUTABLES)/art $(ART_TARGET_DEPENDENCIES) $(TARGET_CORE_IMG_OUTS)
    458 
    459 ########################################################################
    460 # Phony target for only building what go/lem requires on target.
    461 .PHONY: build-art-target-golem
    462 # Also include libartbenchmark, we always include it when running golem.
    463 # libstdc++ is needed when building for ART_TARGET_LINUX.
    464 ART_TARGET_SHARED_LIBRARY_BENCHMARK := $(TARGET_OUT_SHARED_LIBRARIES)/libartbenchmark.so
    465 build-art-target-golem: dex2oat dalvikvm patchoat linker libstdc++ \
    466                         $(TARGET_OUT_EXECUTABLES)/art \
    467                         $(TARGET_OUT)/etc/public.libraries.txt \
    468                         $(ART_TARGET_DEX_DEPENDENCIES) \
    469                         $(ART_TARGET_SHARED_LIBRARY_DEPENDENCIES) \
    470                         $(ART_TARGET_SHARED_LIBRARY_BENCHMARK) \
    471                         $(TARGET_CORE_IMG_OUT_BASE).art \
    472                         $(TARGET_CORE_IMG_OUT_BASE)-interpreter.art
    473 	sed -i '/libartd.so/d' $(TARGET_OUT)/etc/public.libraries.txt
    474 	# remove libartd.so from public.libraries.txt because golem builds won't have it.
    475 
    476 ########################################################################
    477 # Phony target for building what go/lem requires on host.
    478 .PHONY: build-art-host-golem
    479 # Also include libartbenchmark, we always include it when running golem.
    480 ART_HOST_SHARED_LIBRARY_BENCHMARK := $(ART_HOST_OUT_SHARED_LIBRARIES)/libartbenchmark.so
    481 build-art-host-golem: build-art-host \
    482                       $(ART_HOST_SHARED_LIBRARY_BENCHMARK)
    483 
    484 ########################################################################
    485 # Rules for building all dependencies for tests.
    486 
    487 .PHONY: build-art-host-tests
    488 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)
    489 
    490 .PHONY: build-art-target-tests
    491 build-art-target-tests:   build-art-target $(TEST_ART_RUN_TEST_DEPENDENCIES) $(TEST_ART_TARGET_SYNC_DEPS) | $(TEST_ART_RUN_TEST_ORDERONLY_DEPENDENCIES)
    492 
    493 ########################################################################
    494 # targets to switch back and forth from libdvm to libart
    495 
    496 .PHONY: use-art
    497 use-art:
    498 	adb root
    499 	adb wait-for-device shell stop
    500 	adb shell setprop persist.sys.dalvik.vm.lib.2 libart.so
    501 	adb shell start
    502 
    503 .PHONY: use-artd
    504 use-artd:
    505 	adb root
    506 	adb wait-for-device shell stop
    507 	adb shell setprop persist.sys.dalvik.vm.lib.2 libartd.so
    508 	adb shell start
    509 
    510 .PHONY: use-dalvik
    511 use-dalvik:
    512 	adb root
    513 	adb wait-for-device shell stop
    514 	adb shell setprop persist.sys.dalvik.vm.lib.2 libdvm.so
    515 	adb shell start
    516 
    517 .PHONY: use-art-full
    518 use-art-full:
    519 	adb root
    520 	adb wait-for-device shell stop
    521 	adb shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*
    522 	adb shell setprop dalvik.vm.dex2oat-filter \"\"
    523 	adb shell setprop dalvik.vm.image-dex2oat-filter \"\"
    524 	adb shell setprop persist.sys.dalvik.vm.lib.2 libart.so
    525 	adb shell setprop dalvik.vm.usejit false
    526 	adb shell start
    527 
    528 .PHONY: use-artd-full
    529 use-artd-full:
    530 	adb root
    531 	adb wait-for-device shell stop
    532 	adb shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*
    533 	adb shell setprop dalvik.vm.dex2oat-filter \"\"
    534 	adb shell setprop dalvik.vm.image-dex2oat-filter \"\"
    535 	adb shell setprop persist.sys.dalvik.vm.lib.2 libartd.so
    536 	adb shell setprop dalvik.vm.usejit false
    537 	adb shell start
    538 
    539 .PHONY: use-art-jit
    540 use-art-jit:
    541 	adb root
    542 	adb wait-for-device shell stop
    543 	adb shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*
    544 	adb shell setprop dalvik.vm.dex2oat-filter "verify-at-runtime"
    545 	adb shell setprop dalvik.vm.image-dex2oat-filter "verify-at-runtime"
    546 	adb shell setprop persist.sys.dalvik.vm.lib.2 libart.so
    547 	adb shell setprop dalvik.vm.usejit true
    548 	adb shell start
    549 
    550 .PHONY: use-art-interpret-only
    551 use-art-interpret-only:
    552 	adb root
    553 	adb wait-for-device shell stop
    554 	adb shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*
    555 	adb shell setprop dalvik.vm.dex2oat-filter "interpret-only"
    556 	adb shell setprop dalvik.vm.image-dex2oat-filter "interpret-only"
    557 	adb shell setprop persist.sys.dalvik.vm.lib.2 libart.so
    558 	adb shell setprop dalvik.vm.usejit false
    559 	adb shell start
    560 
    561 .PHONY: use-artd-interpret-only
    562 use-artd-interpret-only:
    563 	adb root
    564 	adb wait-for-device shell stop
    565 	adb shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*
    566 	adb shell setprop dalvik.vm.dex2oat-filter "interpret-only"
    567 	adb shell setprop dalvik.vm.image-dex2oat-filter "interpret-only"
    568 	adb shell setprop persist.sys.dalvik.vm.lib.2 libartd.so
    569 	adb shell setprop dalvik.vm.usejit false
    570 	adb shell start
    571 
    572 .PHONY: use-art-verify-none
    573 use-art-verify-none:
    574 	adb root
    575 	adb wait-for-device shell stop
    576 	adb shell rm -rf $(ART_TARGET_DALVIK_CACHE_DIR)/*
    577 	adb shell setprop dalvik.vm.dex2oat-filter "verify-none"
    578 	adb shell setprop dalvik.vm.image-dex2oat-filter "verify-none"
    579 	adb shell setprop persist.sys.dalvik.vm.lib.2 libart.so
    580 	adb shell setprop dalvik.vm.usejit false
    581 	adb shell start
    582 
    583 ########################################################################
    584 
    585 endif # !art_dont_bother
    586 
    587 # Clear locally used variables.
    588 art_dont_bother :=
    589 art_test_bother :=
    590 TEST_ART_TARGET_SYNC_DEPS :=
    591 
    592 # Helper target that depends on boot image creation.
    593 #
    594 # Can be used, for example, to dump initialization failures:
    595 #   m art-boot-image ART_BOOT_IMAGE_EXTRA_ARGS=--dump-init-failures=fails.txt
    596 .PHONY: art-boot-image
    597 art-boot-image: $(DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME)
    598 
    599 .PHONY: art-job-images
    600 art-job-images: \
    601   $(DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) \
    602   $(2ND_DEFAULT_DEX_PREOPT_BUILT_IMAGE_FILENAME) \
    603   $(HOST_OUT_EXECUTABLES)/dex2oats \
    604   $(HOST_OUT_EXECUTABLES)/dex2oatds \
    605   $(HOST_OUT_EXECUTABLES)/profman
    606