OSDN Git Service

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