blob: 0b4b2316fd8a38b1a93ddc5210be45c54a10b214 [file] [log] [blame]
Carl Shapiro7b216702011-06-17 15:09:26 -07001#
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
17LOCAL_PATH := $(call my-dir)
Carl Shapiro7b216702011-06-17 15:09:26 -070018
Brian Carlstrom7940e442013-07-12 13:46:57 -070019art_path := $(LOCAL_PATH)
20art_build_path := $(art_path)/build
Brian Carlstromcdc8de42011-07-19 14:23:17 -070021
Brian Carlstromb2793372012-03-17 18:27:16 -070022########################################################################
Brian Carlstrom62e3ee32012-06-18 14:58:55 -070023# clean-oat targets
24#
25
26# following the example of build's dont_bother for clean targets
27ifneq (,$(filter clean-oat,$(MAKECMDGOALS)))
28art_dont_bother := true
29endif
30ifneq (,$(filter clean-oat-host,$(MAKECMDGOALS)))
31art_dont_bother := true
32endif
33ifneq (,$(filter clean-oat-target,$(MAKECMDGOALS)))
34art_dont_bother := true
35endif
36
37.PHONY: clean-oat
38clean-oat: clean-oat-host clean-oat-target
39
40.PHONY: clean-oat-host
41clean-oat-host:
Brian Carlstrom999cd432013-06-22 23:08:53 -070042 rm -f $(ART_NATIVETEST_OUT)/*.odex
Brian Carlstrom62e3ee32012-06-18 14:58:55 -070043 rm -f $(ART_NATIVETEST_OUT)/*.oat
44 rm -f $(ART_NATIVETEST_OUT)/*.art
Brian Carlstrom999cd432013-06-22 23:08:53 -070045 rm -f $(ART_TEST_OUT)/*.odex
Brian Carlstrom62e3ee32012-06-18 14:58:55 -070046 rm -f $(ART_TEST_OUT)/*.oat
47 rm -f $(ART_TEST_OUT)/*.art
Brian Carlstrom30e2ea42013-06-19 23:25:37 -070048 rm -f $(DALVIK_CACHE_OUT)/*@classes.dex
Brian Carlstrom7675e162013-06-10 16:18:04 -070049 rm -f $(DALVIK_CACHE_OUT)/*.oat
50 rm -f $(DALVIK_CACHE_OUT)/*.art
Brian Carlstrom999cd432013-06-22 23:08:53 -070051 rm -f $(HOST_OUT_JAVA_LIBRARIES)/*.odex
Brian Carlstrom62e3ee32012-06-18 14:58:55 -070052 rm -f $(HOST_OUT_JAVA_LIBRARIES)/*.oat
53 rm -f $(HOST_OUT_JAVA_LIBRARIES)/*.art
Brian Carlstrom999cd432013-06-22 23:08:53 -070054 rm -f $(TARGET_OUT_JAVA_LIBRARIES)/*.odex
Brian Carlstrom62e3ee32012-06-18 14:58:55 -070055 rm -f $(TARGET_OUT_JAVA_LIBRARIES)/*.oat
56 rm -f $(TARGET_OUT_JAVA_LIBRARIES)/*.art
Brian Carlstrom999cd432013-06-22 23:08:53 -070057 rm -f $(TARGET_OUT_UNSTRIPPED)/system/framework/*.odex
Brian Carlstrom1d6848c2013-03-06 15:03:52 -080058 rm -f $(TARGET_OUT_UNSTRIPPED)/system/framework/*.oat
Brian Carlstrom999cd432013-06-22 23:08:53 -070059 rm -f $(TARGET_OUT_APPS)/*.odex
Brian Carlstrom30e2ea42013-06-19 23:25:37 -070060 rm -f $(TARGET_OUT_INTERMEDIATES)/JAVA_LIBRARIES/*_intermediates/javalib.odex
61 rm -f $(TARGET_OUT_INTERMEDIATES)/APPS/*_intermediates/*.odex
62 rm -rf /tmp/test-*/dalvik-cache/*@classes.dex
Brian Carlstrom62e3ee32012-06-18 14:58:55 -070063
64.PHONY: clean-oat-target
65clean-oat-target:
66 adb remount
Brian Carlstrom30e2ea42013-06-19 23:25:37 -070067 adb shell rm $(ART_NATIVETEST_DIR)/*.odex
Brian Carlstrom62e3ee32012-06-18 14:58:55 -070068 adb shell rm $(ART_NATIVETEST_DIR)/*.oat
69 adb shell rm $(ART_NATIVETEST_DIR)/*.art
Brian Carlstrom30e2ea42013-06-19 23:25:37 -070070 adb shell rm $(ART_TEST_DIR)/*.odex
Brian Carlstrom62e3ee32012-06-18 14:58:55 -070071 adb shell rm $(ART_TEST_DIR)/*.oat
72 adb shell rm $(ART_TEST_DIR)/*.art
Brian Carlstrom30e2ea42013-06-19 23:25:37 -070073 adb shell rm $(DALVIK_CACHE_DIR)/*.dex
Brian Carlstrom7675e162013-06-10 16:18:04 -070074 adb shell rm $(DALVIK_CACHE_DIR)/*.oat
75 adb shell rm $(DALVIK_CACHE_DIR)/*.art
Brian Carlstrom62e3ee32012-06-18 14:58:55 -070076 adb shell rm $(DEXPREOPT_BOOT_JAR_DIR)/*.oat
77 adb shell rm $(DEXPREOPT_BOOT_JAR_DIR)/*.art
Brian Carlstrom30e2ea42013-06-19 23:25:37 -070078 adb shell rm system/app/*.odex
79 adb shell rm data/run-test/test-*/dalvik-cache/*@classes.dex
Brian Carlstrom62e3ee32012-06-18 14:58:55 -070080
81ifneq ($(art_dont_bother),true)
82
83########################################################################
Brian Carlstromb2793372012-03-17 18:27:16 -070084# product targets
Brian Carlstrom7940e442013-07-12 13:46:57 -070085include $(art_path)/runtime/Android.mk
86include $(art_path)/compiler/Android.mk
87include $(art_path)/dex2oat/Android.mk
Ian Rogers02ed4c02013-09-06 13:10:04 -070088include $(art_path)/disassembler/Android.mk
Brian Carlstrom7940e442013-07-12 13:46:57 -070089include $(art_path)/oatdump/Android.mk
Brian Carlstromfa50baa2013-08-02 01:00:27 -070090include $(art_path)/dalvikvm/Android.mk
91include $(art_path)/jdwpspy/Android.mk
Brian Carlstrom7940e442013-07-12 13:46:57 -070092include $(art_build_path)/Android.oat.mk
Carl Shapiro7b216702011-06-17 15:09:26 -070093
Brian Carlstromb2793372012-03-17 18:27:16 -070094# ART_HOST_DEPENDENCIES depends on Android.executable.mk above for ART_HOST_EXECUTABLES
Brian Carlstrom15803792012-03-13 00:53:08 -070095ART_HOST_DEPENDENCIES := $(ART_HOST_EXECUTABLES) $(HOST_OUT_JAVA_LIBRARIES)/core-hostdex.jar
Elliott Hughesf1eedca2012-04-20 16:00:32 -070096ART_HOST_DEPENDENCIES += $(HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION)
Brian Carlstrom15803792012-03-13 00:53:08 -070097ART_TARGET_DEPENDENCIES := $(ART_TARGET_EXECUTABLES) $(TARGET_OUT_JAVA_LIBRARIES)/core.jar $(TARGET_OUT_SHARED_LIBRARIES)/libjavacore.so
98
Brian Carlstromb2793372012-03-17 18:27:16 -070099########################################################################
100# test targets
Brian Carlstrom15803792012-03-13 00:53:08 -0700101
Brian Carlstrom7940e442013-07-12 13:46:57 -0700102include $(art_path)/test/Android.mk
103include $(art_build_path)/Android.gtest.mk
Brian Carlstromb2793372012-03-17 18:27:16 -0700104
105# The ART_*_TEST_DEPENDENCIES definitions:
106# - depend on Android.oattest.mk above for ART_TEST_*_DEX_FILES
Brian Carlstromb0aa9d32012-04-07 23:12:22 -0700107# - depend on Android.gtest.mk above for ART_*_TEST_EXECUTABLES
Brian Carlstromb2793372012-03-17 18:27:16 -0700108ART_HOST_TEST_DEPENDENCIES := $(ART_HOST_DEPENDENCIES) $(ART_HOST_TEST_EXECUTABLES) $(ART_TEST_HOST_DEX_FILES) $(HOST_CORE_IMG_OUT)
109ART_TARGET_TEST_DEPENDENCIES := $(ART_TARGET_DEPENDENCIES) $(ART_TARGET_TEST_EXECUTABLES) $(ART_TEST_TARGET_DEX_FILES) $(TARGET_CORE_IMG_OUT)
Brian Carlstrom16192862011-09-12 17:50:06 -0700110
Brian Carlstrom7940e442013-07-12 13:46:57 -0700111include $(art_build_path)/Android.libarttest.mk
Brian Carlstrom934486c2011-07-12 23:42:50 -0700112
Brian Carlstrom4a96b602011-07-26 16:40:23 -0700113# "mm test-art" to build and run all tests on host and device
114.PHONY: test-art
115test-art: test-art-host test-art-target
Brian Carlstrom395520e2011-09-25 19:35:00 -0700116 @echo test-art PASSED
Brian Carlstrom4a96b602011-07-26 16:40:23 -0700117
Brian Carlstrom47a0d5a2011-10-12 21:20:05 -0700118.PHONY: test-art-gtest
Brian Carlstromb2793372012-03-17 18:27:16 -0700119test-art-gtest: test-art-host-gtest test-art-target-gtest
Brian Carlstrom47a0d5a2011-10-12 21:20:05 -0700120 @echo test-art-gtest PASSED
121
Brian Carlstromb2793372012-03-17 18:27:16 -0700122.PHONY: test-art-oat
Brian Carlstromdbaa93a2013-07-31 15:13:10 -0700123test-art-oat: test-art-host-oat test-art-target-oat
Brian Carlstromb2793372012-03-17 18:27:16 -0700124 @echo test-art-oat PASSED
Elliott Hughes2cae5a22011-08-14 14:27:25 -0700125
Brian Carlstrom08981ab2012-05-25 18:40:15 -0700126.PHONY: test-art-run-test
Brian Carlstromdbaa93a2013-07-31 15:13:10 -0700127test-art-run-test: test-art-host-run-test test-art-target-run-test
Brian Carlstrom08981ab2012-05-25 18:40:15 -0700128 @echo test-art-run-test PASSED
129
Brian Carlstrombc2f3e32011-09-22 17:16:54 -0700130########################################################################
131# host test targets
132
Brian Carlstrom934486c2011-07-12 23:42:50 -0700133# "mm test-art-host" to build and run all host tests
134.PHONY: test-art-host
Brian Carlstromdbaa93a2013-07-31 15:13:10 -0700135test-art-host: test-art-host-gtest test-art-host-oat test-art-host-run-test
Brian Carlstrom395520e2011-09-25 19:35:00 -0700136 @echo test-art-host PASSED
Brian Carlstrom59848da2011-07-23 20:35:19 -0700137
Ian Rogers85d9ba62013-01-16 22:32:12 -0800138.PHONY: test-art-host-interpreter
Brian Carlstromdbaa93a2013-07-31 15:13:10 -0700139test-art-host-interpreter: test-art-host-oat-interpreter test-art-host-run-test-interpreter
Ian Rogers85d9ba62013-01-16 22:32:12 -0800140 @echo test-art-host-interpreter PASSED
141
Brian Carlstromb0aa9d32012-04-07 23:12:22 -0700142.PHONY: test-art-host-dependencies
Brian Carlstrom58805e42013-03-31 01:19:24 -0700143test-art-host-dependencies: $(ART_HOST_TEST_DEPENDENCIES) $(HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) $(HOST_CORE_DEX_LOCATIONS)
Brian Carlstromb0aa9d32012-04-07 23:12:22 -0700144
Brian Carlstromb2793372012-03-17 18:27:16 -0700145.PHONY: test-art-host-gtest
146test-art-host-gtest: $(ART_HOST_TEST_TARGETS)
147 @echo test-art-host-gtest PASSED
Elliott Hughes2cae5a22011-08-14 14:27:25 -0700148
Brian Carlstromb2793372012-03-17 18:27:16 -0700149define run-host-gtests-with
150 $(foreach file,$(sort $(ART_HOST_TEST_EXECUTABLES)),$(1) $(file) &&) true
151endef
152
153# "mm valgrind-test-art-host-gtest" to build and run the host gtests under valgrind.
154.PHONY: valgrind-test-art-host-gtest
Brian Carlstromb0aa9d32012-04-07 23:12:22 -0700155valgrind-test-art-host-gtest: test-art-host-dependencies
Brian Carlstromb2793372012-03-17 18:27:16 -0700156 $(call run-host-gtests-with,valgrind --leak-check=full)
157 @echo valgrind-test-art-host-gtest PASSED
158
Brian Carlstromdbaa93a2013-07-31 15:13:10 -0700159.PHONY: test-art-host-oat-default
160test-art-host-oat-default: $(ART_TEST_HOST_OAT_DEFAULT_TARGETS)
161 @echo test-art-host-oat-default PASSED
162
163.PHONY: test-art-host-oat-interpreter
164test-art-host-oat-interpreter: $(ART_TEST_HOST_OAT_INTERPRETER_TARGETS)
165 @echo test-art-host-oat-interpreter PASSED
166
Brian Carlstromb2793372012-03-17 18:27:16 -0700167.PHONY: test-art-host-oat
Brian Carlstromdbaa93a2013-07-31 15:13:10 -0700168test-art-host-oat: test-art-host-oat-default test-art-host-oat-interpreter
Brian Carlstromb2793372012-03-17 18:27:16 -0700169 @echo test-art-host-oat PASSED
Elliott Hughes5511f212011-08-12 18:07:45 -0700170
Brian Carlstrom4855cd52012-04-03 21:38:13 -0700171define declare-test-art-host-run-test
Brian Carlstromdbaa93a2013-07-31 15:13:10 -0700172.PHONY: test-art-host-run-test-default-$(1)
173test-art-host-run-test-default-$(1): test-art-host-dependencies
Brian Carlstrom4855cd52012-04-03 21:38:13 -0700174 art/test/run-test --host $(1)
Brian Carlstromdbaa93a2013-07-31 15:13:10 -0700175 @echo test-art-host-run-test-default-$(1) PASSED
Brian Carlstrom4855cd52012-04-03 21:38:13 -0700176
Brian Carlstromdbaa93a2013-07-31 15:13:10 -0700177TEST_ART_HOST_RUN_TEST_DEFAULT_TARGETS += test-art-host-run-test-default-$(1)
Ian Rogers27cedf82012-11-21 11:42:43 -0800178
Brian Carlstromdbaa93a2013-07-31 15:13:10 -0700179.PHONY: test-art-host-run-test-interpreter-$(1)
180test-art-host-run-test-interpreter-$(1): test-art-host-dependencies
Ian Rogers27cedf82012-11-21 11:42:43 -0800181 art/test/run-test --host --interpreter $(1)
Brian Carlstromdbaa93a2013-07-31 15:13:10 -0700182 @echo test-art-host-run-test-interpreter-$(1) PASSED
Ian Rogers27cedf82012-11-21 11:42:43 -0800183
Brian Carlstromdbaa93a2013-07-31 15:13:10 -0700184TEST_ART_HOST_RUN_TEST_INTERPRETER_TARGETS += test-art-host-run-test-interpreter-$(1)
Brian Carlstroma404db02013-08-28 09:37:40 -0700185
186.PHONY: test-art-host-run-test-$(1)
187test-art-host-run-test-$(1): test-art-host-run-test-default-$(1) test-art-host-run-test-interpreter-$(1)
188
Brian Carlstrom4855cd52012-04-03 21:38:13 -0700189endef
190
Elliott Hughes84a5bb42012-05-16 17:52:15 -0700191$(foreach test, $(wildcard art/test/[0-9]*), $(eval $(call declare-test-art-host-run-test,$(notdir $(test)))))
Brian Carlstrom4855cd52012-04-03 21:38:13 -0700192
Brian Carlstromdbaa93a2013-07-31 15:13:10 -0700193.PHONY: test-art-host-run-test-default
194test-art-host-run-test-default: $(TEST_ART_HOST_RUN_TEST_DEFAULT_TARGETS)
195 @echo test-art-host-run-test-default PASSED
Brian Carlstrom4855cd52012-04-03 21:38:13 -0700196
Brian Carlstromdbaa93a2013-07-31 15:13:10 -0700197.PHONY: test-art-host-run-test-interpreter
198test-art-host-run-test-interpreter: $(TEST_ART_HOST_RUN_TEST_INTERPRETER_TARGETS)
199 @echo test-art-host-run-test-interpreter PASSED
200
201.PHONY: test-art-host-run-test
202test-art-host-run-test: test-art-host-run-test-default test-art-host-run-test-interpreter
203 @echo test-art-host-run-test PASSED
Ian Rogers27cedf82012-11-21 11:42:43 -0800204
Brian Carlstrombc2f3e32011-09-22 17:16:54 -0700205########################################################################
206# target test targets
207
208# "mm test-art-target" to build and run all target tests
Brian Carlstrom4a96b602011-07-26 16:40:23 -0700209.PHONY: test-art-target
Brian Carlstrome24fa612011-09-29 00:53:55 -0700210test-art-target: test-art-target-gtest test-art-target-oat test-art-target-run-test
Brian Carlstrom395520e2011-09-25 19:35:00 -0700211 @echo test-art-target PASSED
Brian Carlstrom86927212011-09-15 11:31:11 -0700212
Brian Carlstromb0aa9d32012-04-07 23:12:22 -0700213.PHONY: test-art-target-dependencies
214test-art-target-dependencies: $(ART_TARGET_TEST_DEPENDENCIES) $(ART_TEST_OUT)/libarttest.so
215
Brian Carlstrom86927212011-09-15 11:31:11 -0700216.PHONY: test-art-target-sync
Brian Carlstromb0aa9d32012-04-07 23:12:22 -0700217test-art-target-sync: test-art-target-dependencies
Brian Carlstrom4a96b602011-07-26 16:40:23 -0700218 adb remount
219 adb sync
Brian Carlstrom47a0d5a2011-10-12 21:20:05 -0700220 adb shell mkdir -p $(ART_TEST_DIR)
Brian Carlstrom86927212011-09-15 11:31:11 -0700221
222.PHONY: test-art-target-gtest
Brian Carlstrom47a0d5a2011-10-12 21:20:05 -0700223test-art-target-gtest: $(ART_TARGET_TEST_TARGETS)
Brian Carlstrom86927212011-09-15 11:31:11 -0700224
225.PHONY: test-art-target-oat
Brian Carlstromb2793372012-03-17 18:27:16 -0700226test-art-target-oat: $(ART_TEST_TARGET_OAT_TARGETS)
Brian Carlstrom395520e2011-09-25 19:35:00 -0700227 @echo test-art-target-oat PASSED
Brian Carlstrom4a96b602011-07-26 16:40:23 -0700228
Brian Carlstrom37c44442012-03-06 22:21:18 -0800229define declare-test-art-target-run-test
230.PHONY: test-art-target-run-test-$(1)
231test-art-target-run-test-$(1): test-art-target-sync
232 art/test/run-test $(1)
233 @echo test-art-target-run-test-$(1) PASSED
Brian Carlstrome24fa612011-09-29 00:53:55 -0700234
Brian Carlstrom37c44442012-03-06 22:21:18 -0800235TEST_ART_TARGET_RUN_TEST_TARGETS += test-art-target-run-test-$(1)
Brian Carlstroma404db02013-08-28 09:37:40 -0700236
237test-art-run-test-$(1): test-art-host-run-test-$(1) test-art-target-run-test-$(1)
238
Brian Carlstrom37c44442012-03-06 22:21:18 -0800239endef
240
Elliott Hughes84a5bb42012-05-16 17:52:15 -0700241$(foreach test, $(wildcard art/test/[0-9]*), $(eval $(call declare-test-art-target-run-test,$(notdir $(test)))))
Brian Carlstrom37c44442012-03-06 22:21:18 -0800242
243.PHONY: test-art-target-run-test
244test-art-target-run-test: $(TEST_ART_TARGET_RUN_TEST_TARGETS)
245 @echo test-art-target-run-test PASSED
Brian Carlstrome24fa612011-09-29 00:53:55 -0700246
Brian Carlstrombc2f3e32011-09-22 17:16:54 -0700247########################################################################
Brian Carlstrom04941d92012-02-19 01:47:51 -0800248# oat-target and oat-target-sync targets
Brian Carlstrombc2f3e32011-09-22 17:16:54 -0700249
Brian Carlstrom04941d92012-02-19 01:47:51 -0800250OAT_TARGET_TARGETS :=
251
252# $(1): input jar or apk target location
253define declare-oat-target-target
Brian Carlstrom46b8a622012-06-19 23:13:22 -0700254ifneq (,$(filter $(1),$(addprefix system/app/,$(addsuffix .apk,$(PRODUCT_DEX_PREOPT_PACKAGES_IN_DATA)))))
Brian Carlstrom999cd432013-06-22 23:08:53 -0700255OUT_OAT_FILE := $(call dalvik-cache-out,$(1)/classes.dex)
Brian Carlstrom46b8a622012-06-19 23:13:22 -0700256else
Brian Carlstrom999cd432013-06-22 23:08:53 -0700257OUT_OAT_FILE := $(PRODUCT_OUT)/$(basename $(1)).odex
Brian Carlstrom46b8a622012-06-19 23:13:22 -0700258endif
Shih-wei Liao2e01f242012-05-28 03:11:59 -0700259
260ifeq ($(ONE_SHOT_MAKEFILE),)
Brian Carlstrom90e27412013-03-13 21:51:47 -0700261# ONE_SHOT_MAKEFILE is empty for a top level build and we don't want
262# to define the oat-target-* rules there because they will conflict
263# with the build/core/dex_preopt.mk defined rules.
Brian Carlstrom04941d92012-02-19 01:47:51 -0800264.PHONY: oat-target-$(1)
Brian Carlstrom90e27412013-03-13 21:51:47 -0700265oat-target-$(1):
Shih-wei Liao2e01f242012-05-28 03:11:59 -0700266
267else
268.PHONY: oat-target-$(1)
Shih-wei Liao7eea0e82012-05-28 23:56:21 -0700269oat-target-$(1): $$(OUT_OAT_FILE)
Shih-wei Liao2e01f242012-05-28 03:11:59 -0700270
Shih-wei Liao7eea0e82012-05-28 23:56:21 -0700271$$(OUT_OAT_FILE): $(PRODUCT_OUT)/$(1) $(TARGET_BOOT_IMG_OUT) $(DEX2OAT_DEPENDENCY)
Brian Carlstrom90e27412013-03-13 21:51:47 -0700272 @mkdir -p $$(dir $$@)
Brian Carlstrom3f47c122013-03-07 00:02:40 -0800273 $(DEX2OAT) $(PARALLEL_ART_COMPILE_JOBS) --runtime-arg -Xms64m --runtime-arg -Xmx64m --boot-image=$(TARGET_BOOT_IMG_OUT) --dex-file=$(PRODUCT_OUT)/$(1) --dex-location=/$(1) --oat-file=$$@ --host-prefix=$(PRODUCT_OUT) --instruction-set=$(TARGET_ARCH) --android-root=$(PRODUCT_OUT)/system
Shih-wei Liao2e01f242012-05-28 03:11:59 -0700274
275endif
Brian Carlstrom04941d92012-02-19 01:47:51 -0800276
277OAT_TARGET_TARGETS += oat-target-$(1)
Brian Carlstroma9f19782011-10-13 00:14:47 -0700278endef
279
Brian Carlstrombd411022012-02-07 12:09:09 -0800280$(foreach file,\
281 $(filter-out\
Brian Carlstrom46b8a622012-06-19 23:13:22 -0700282 $(addprefix $(TARGET_OUT_JAVA_LIBRARIES)/,$(addsuffix .jar,$(TARGET_BOOT_JARS))),\
Brian Carlstrombd411022012-02-07 12:09:09 -0800283 $(wildcard $(TARGET_OUT_APPS)/*.apk) $(wildcard $(TARGET_OUT_JAVA_LIBRARIES)/*.jar)),\
Brian Carlstrom04941d92012-02-19 01:47:51 -0800284 $(eval $(call declare-oat-target-target,$(subst $(PRODUCT_OUT)/,,$(file)))))
285
286.PHONY: oat-target
287oat-target: $(ART_TARGET_DEPENDENCIES) $(TARGET_BOOT_OAT_OUT) $(OAT_TARGET_TARGETS)
Ian Rogersbeb60e22012-01-31 10:40:40 -0800288
Brian Carlstroma6cc8932012-01-04 14:44:07 -0800289.PHONY: oat-target-sync
Brian Carlstrom04941d92012-02-19 01:47:51 -0800290oat-target-sync: oat-target
Brian Carlstrom0796af02011-10-12 14:31:45 -0700291 adb remount
292 adb sync
293
Brian Carlstrom76aa0c02011-10-11 15:29:43 -0700294########################################################################
Brian Carlstromfa50baa2013-08-02 01:00:27 -0700295# "m build-art" for quick minimal build
296.PHONY: build-art
297build-art: build-art-host build-art-target
298
299.PHONY: build-art-host
300build-art-host: $(ART_HOST_EXECUTABLES) $(ART_HOST_TEST_EXECUTABLES) $(HOST_CORE_IMG_OUT) $(HOST_OUT)/lib/libjavacore.so
301
302.PHONY: build-art-target
303build-art-target: $(ART_TARGET_EXECUTABLES) $(ART_TARGET_TEST_EXECUTABLES) $(TARGET_CORE_IMG_OUT) $(TARGET_OUT)/lib/libjavacore.so
304
305########################################################################
Brian Carlstrombc2f3e32011-09-22 17:16:54 -0700306# oatdump targets
Brian Carlstrom27ec9612011-09-19 20:20:38 -0700307
Brian Carlstrom395520e2011-09-25 19:35:00 -0700308.PHONY: dump-oat
Ian Rogers62d6c772013-02-27 08:32:07 -0800309dump-oat: dump-oat-core dump-oat-boot
Brian Carlstrom395520e2011-09-25 19:35:00 -0700310
Brian Carlstrome10b6972011-09-26 13:49:03 -0700311.PHONY: dump-oat-core
Brian Carlstrom13c492b2012-03-22 17:09:17 -0700312dump-oat-core: dump-oat-core-host dump-oat-core-target
313
314.PHONY: dump-oat-core-host
Brian Carlstrom265091e2013-01-30 14:08:26 -0800315ifeq ($(ART_BUILD_HOST),true)
Brian Carlstrom13c492b2012-03-22 17:09:17 -0700316dump-oat-core-host: $(HOST_CORE_IMG_OUT) $(OATDUMP)
317 $(OATDUMP) --image=$(HOST_CORE_IMG_OUT) --output=/tmp/core.host.oatdump.txt --host-prefix=""
318 @echo Output in /tmp/core.host.oatdump.txt
Brian Carlstrom265091e2013-01-30 14:08:26 -0800319endif
Brian Carlstrom13c492b2012-03-22 17:09:17 -0700320
321.PHONY: dump-oat-core-target
Brian Carlstrom265091e2013-01-30 14:08:26 -0800322ifeq ($(ART_BUILD_TARGET),true)
Brian Carlstrom13c492b2012-03-22 17:09:17 -0700323dump-oat-core-target: $(TARGET_CORE_IMG_OUT) $(OATDUMP)
324 $(OATDUMP) --image=$(TARGET_CORE_IMG_OUT) --output=/tmp/core.target.oatdump.txt
325 @echo Output in /tmp/core.target.oatdump.txt
Brian Carlstrom265091e2013-01-30 14:08:26 -0800326endif
Brian Carlstrom27ec9612011-09-19 20:20:38 -0700327
Brian Carlstrome10b6972011-09-26 13:49:03 -0700328.PHONY: dump-oat-boot
Brian Carlstrom265091e2013-01-30 14:08:26 -0800329ifeq ($(ART_BUILD_TARGET_NDEBUG),true)
Brian Carlstrom13c492b2012-03-22 17:09:17 -0700330dump-oat-boot: $(TARGET_BOOT_IMG_OUT) $(OATDUMP)
Brian Carlstromfe487d02012-02-29 18:49:16 -0800331 $(OATDUMP) --image=$(TARGET_BOOT_IMG_OUT) --output=/tmp/boot.oatdump.txt
Brian Carlstrom27ec9612011-09-19 20:20:38 -0700332 @echo Output in /tmp/boot.oatdump.txt
Brian Carlstrom265091e2013-01-30 14:08:26 -0800333endif
Brian Carlstrom78128a62011-09-15 17:21:19 -0700334
Brian Carlstrom2e92fd62012-10-18 00:04:10 -0700335.PHONY: dump-oat-Calculator
Brian Carlstrom265091e2013-01-30 14:08:26 -0800336ifeq ($(ART_BUILD_TARGET_NDEBUG),true)
Brian Carlstrom30e2ea42013-06-19 23:25:37 -0700337dump-oat-Calculator: $(TARGET_OUT_APPS)/Calculator.odex $(TARGET_BOOT_IMG_OUT) $(OATDUMP)
Brian Carlstrom2e92fd62012-10-18 00:04:10 -0700338 $(OATDUMP) --oat-file=$< --output=/tmp/Calculator.oatdump.txt
339 @echo Output in /tmp/Calculator.oatdump.txt
Brian Carlstrom265091e2013-01-30 14:08:26 -0800340endif
Brian Carlstrom2e92fd62012-10-18 00:04:10 -0700341
Brian Carlstrombc2f3e32011-09-22 17:16:54 -0700342########################################################################
Brian Carlstromfc0e3212013-07-17 14:40:12 -0700343# cpplint targets to style check art source files
Brian Carlstrombc2f3e32011-09-22 17:16:54 -0700344
Brian Carlstrom05eecea2013-07-18 21:59:52 -0700345include $(art_build_path)/Android.cpplint.mk
Brian Carlstrom27ec9612011-09-19 20:20:38 -0700346
Brian Carlstrombc2f3e32011-09-22 17:16:54 -0700347########################################################################
Brian Carlstroma7a60a82013-06-24 17:41:19 -0700348# targets to switch back and forth from libdvm to libart
349
350.PHONY: use-art
351use-art:
352 adb root && sleep 3
Brian Carlstromcef450c2013-06-28 14:38:26 -0700353 adb shell setprop persist.sys.dalvik.vm.lib libart.so
Brian Carlstroma7a60a82013-06-24 17:41:19 -0700354 adb reboot
355
356.PHONY: use-artd
357use-artd:
358 adb root && sleep 3
Brian Carlstromcef450c2013-06-28 14:38:26 -0700359 adb shell setprop persist.sys.dalvik.vm.lib libartd.so
Brian Carlstroma7a60a82013-06-24 17:41:19 -0700360 adb reboot
361
362.PHONY: use-dalvik
363use-dalvik:
364 adb root && sleep 3
Brian Carlstromcef450c2013-06-28 14:38:26 -0700365 adb shell setprop persist.sys.dalvik.vm.lib libdvm.so
Brian Carlstroma7a60a82013-06-24 17:41:19 -0700366 adb reboot
367
368########################################################################
Brian Carlstrombc2f3e32011-09-22 17:16:54 -0700369
Brian Carlstrom62e3ee32012-06-18 14:58:55 -0700370endif # !art_dont_bother