OSDN Git Service

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