OSDN Git Service

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