Carl Shapiro | 7b21670 | 2011-06-17 15:09:26 -0700 | [diff] [blame] | 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) |
Carl Shapiro | 7b21670 | 2011-06-17 15:09:26 -0700 | [diff] [blame] | 18 | |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 19 | art_path := $(LOCAL_PATH) |
| 20 | art_build_path := $(art_path)/build |
Brian Carlstrom | cdc8de4 | 2011-07-19 14:23:17 -0700 | [diff] [blame] | 21 | |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 22 | ######################################################################## |
Brian Carlstrom | 62e3ee3 | 2012-06-18 14:58:55 -0700 | [diff] [blame] | 23 | # clean-oat targets |
| 24 | # |
| 25 | |
| 26 | # following the example of build's dont_bother for clean targets |
| 27 | ifneq (,$(filter clean-oat,$(MAKECMDGOALS))) |
| 28 | art_dont_bother := true |
| 29 | endif |
| 30 | ifneq (,$(filter clean-oat-host,$(MAKECMDGOALS))) |
| 31 | art_dont_bother := true |
| 32 | endif |
| 33 | ifneq (,$(filter clean-oat-target,$(MAKECMDGOALS))) |
| 34 | art_dont_bother := true |
| 35 | endif |
| 36 | |
| 37 | .PHONY: clean-oat |
| 38 | clean-oat: clean-oat-host clean-oat-target |
| 39 | |
| 40 | .PHONY: clean-oat-host |
| 41 | clean-oat-host: |
Brian Carlstrom | 999cd43 | 2013-06-22 23:08:53 -0700 | [diff] [blame] | 42 | rm -f $(ART_NATIVETEST_OUT)/*.odex |
Brian Carlstrom | 62e3ee3 | 2012-06-18 14:58:55 -0700 | [diff] [blame] | 43 | rm -f $(ART_NATIVETEST_OUT)/*.oat |
| 44 | rm -f $(ART_NATIVETEST_OUT)/*.art |
Brian Carlstrom | 999cd43 | 2013-06-22 23:08:53 -0700 | [diff] [blame] | 45 | rm -f $(ART_TEST_OUT)/*.odex |
Brian Carlstrom | 62e3ee3 | 2012-06-18 14:58:55 -0700 | [diff] [blame] | 46 | rm -f $(ART_TEST_OUT)/*.oat |
| 47 | rm -f $(ART_TEST_OUT)/*.art |
Brian Carlstrom | 30e2ea4 | 2013-06-19 23:25:37 -0700 | [diff] [blame] | 48 | rm -f $(DALVIK_CACHE_OUT)/*@classes.dex |
Brian Carlstrom | 7675e16 | 2013-06-10 16:18:04 -0700 | [diff] [blame] | 49 | rm -f $(DALVIK_CACHE_OUT)/*.oat |
| 50 | rm -f $(DALVIK_CACHE_OUT)/*.art |
Brian Carlstrom | 999cd43 | 2013-06-22 23:08:53 -0700 | [diff] [blame] | 51 | rm -f $(HOST_OUT_JAVA_LIBRARIES)/*.odex |
Brian Carlstrom | 62e3ee3 | 2012-06-18 14:58:55 -0700 | [diff] [blame] | 52 | rm -f $(HOST_OUT_JAVA_LIBRARIES)/*.oat |
| 53 | rm -f $(HOST_OUT_JAVA_LIBRARIES)/*.art |
Brian Carlstrom | 999cd43 | 2013-06-22 23:08:53 -0700 | [diff] [blame] | 54 | rm -f $(TARGET_OUT_JAVA_LIBRARIES)/*.odex |
Brian Carlstrom | 62e3ee3 | 2012-06-18 14:58:55 -0700 | [diff] [blame] | 55 | rm -f $(TARGET_OUT_JAVA_LIBRARIES)/*.oat |
| 56 | rm -f $(TARGET_OUT_JAVA_LIBRARIES)/*.art |
Brian Carlstrom | 999cd43 | 2013-06-22 23:08:53 -0700 | [diff] [blame] | 57 | rm -f $(TARGET_OUT_UNSTRIPPED)/system/framework/*.odex |
Brian Carlstrom | 1d6848c | 2013-03-06 15:03:52 -0800 | [diff] [blame] | 58 | rm -f $(TARGET_OUT_UNSTRIPPED)/system/framework/*.oat |
Brian Carlstrom | 999cd43 | 2013-06-22 23:08:53 -0700 | [diff] [blame] | 59 | rm -f $(TARGET_OUT_APPS)/*.odex |
Brian Carlstrom | 30e2ea4 | 2013-06-19 23:25:37 -0700 | [diff] [blame] | 60 | 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 Carlstrom | 62e3ee3 | 2012-06-18 14:58:55 -0700 | [diff] [blame] | 63 | |
| 64 | .PHONY: clean-oat-target |
| 65 | clean-oat-target: |
| 66 | adb remount |
Brian Carlstrom | 30e2ea4 | 2013-06-19 23:25:37 -0700 | [diff] [blame] | 67 | adb shell rm $(ART_NATIVETEST_DIR)/*.odex |
Brian Carlstrom | 62e3ee3 | 2012-06-18 14:58:55 -0700 | [diff] [blame] | 68 | adb shell rm $(ART_NATIVETEST_DIR)/*.oat |
| 69 | adb shell rm $(ART_NATIVETEST_DIR)/*.art |
Brian Carlstrom | 30e2ea4 | 2013-06-19 23:25:37 -0700 | [diff] [blame] | 70 | adb shell rm $(ART_TEST_DIR)/*.odex |
Brian Carlstrom | 62e3ee3 | 2012-06-18 14:58:55 -0700 | [diff] [blame] | 71 | adb shell rm $(ART_TEST_DIR)/*.oat |
| 72 | adb shell rm $(ART_TEST_DIR)/*.art |
Brian Carlstrom | 30e2ea4 | 2013-06-19 23:25:37 -0700 | [diff] [blame] | 73 | adb shell rm $(DALVIK_CACHE_DIR)/*.dex |
Brian Carlstrom | 7675e16 | 2013-06-10 16:18:04 -0700 | [diff] [blame] | 74 | adb shell rm $(DALVIK_CACHE_DIR)/*.oat |
| 75 | adb shell rm $(DALVIK_CACHE_DIR)/*.art |
Brian Carlstrom | 62e3ee3 | 2012-06-18 14:58:55 -0700 | [diff] [blame] | 76 | adb shell rm $(DEXPREOPT_BOOT_JAR_DIR)/*.oat |
| 77 | adb shell rm $(DEXPREOPT_BOOT_JAR_DIR)/*.art |
Brian Carlstrom | 30e2ea4 | 2013-06-19 23:25:37 -0700 | [diff] [blame] | 78 | adb shell rm system/app/*.odex |
| 79 | adb shell rm data/run-test/test-*/dalvik-cache/*@classes.dex |
Brian Carlstrom | 62e3ee3 | 2012-06-18 14:58:55 -0700 | [diff] [blame] | 80 | |
| 81 | ifneq ($(art_dont_bother),true) |
| 82 | |
| 83 | ######################################################################## |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 84 | # product targets |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 85 | include $(art_path)/runtime/Android.mk |
| 86 | include $(art_path)/compiler/Android.mk |
| 87 | include $(art_path)/dex2oat/Android.mk |
Ian Rogers | 02ed4c0 | 2013-09-06 13:10:04 -0700 | [diff] [blame] | 88 | include $(art_path)/disassembler/Android.mk |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 89 | include $(art_path)/oatdump/Android.mk |
Brian Carlstrom | fa50baa | 2013-08-02 01:00:27 -0700 | [diff] [blame] | 90 | include $(art_path)/dalvikvm/Android.mk |
| 91 | include $(art_path)/jdwpspy/Android.mk |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 92 | include $(art_build_path)/Android.oat.mk |
Carl Shapiro | 7b21670 | 2011-06-17 15:09:26 -0700 | [diff] [blame] | 93 | |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 94 | # ART_HOST_DEPENDENCIES depends on Android.executable.mk above for ART_HOST_EXECUTABLES |
Brian Carlstrom | 1580379 | 2012-03-13 00:53:08 -0700 | [diff] [blame] | 95 | ART_HOST_DEPENDENCIES := $(ART_HOST_EXECUTABLES) $(HOST_OUT_JAVA_LIBRARIES)/core-hostdex.jar |
Elliott Hughes | f1eedca | 2012-04-20 16:00:32 -0700 | [diff] [blame] | 96 | ART_HOST_DEPENDENCIES += $(HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) |
Brian Carlstrom | 1580379 | 2012-03-13 00:53:08 -0700 | [diff] [blame] | 97 | ART_TARGET_DEPENDENCIES := $(ART_TARGET_EXECUTABLES) $(TARGET_OUT_JAVA_LIBRARIES)/core.jar $(TARGET_OUT_SHARED_LIBRARIES)/libjavacore.so |
| 98 | |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 99 | ######################################################################## |
| 100 | # test targets |
Brian Carlstrom | 1580379 | 2012-03-13 00:53:08 -0700 | [diff] [blame] | 101 | |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 102 | include $(art_path)/test/Android.mk |
| 103 | include $(art_build_path)/Android.gtest.mk |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 104 | |
| 105 | # The ART_*_TEST_DEPENDENCIES definitions: |
| 106 | # - depend on Android.oattest.mk above for ART_TEST_*_DEX_FILES |
Brian Carlstrom | b0aa9d3 | 2012-04-07 23:12:22 -0700 | [diff] [blame] | 107 | # - depend on Android.gtest.mk above for ART_*_TEST_EXECUTABLES |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 108 | ART_HOST_TEST_DEPENDENCIES := $(ART_HOST_DEPENDENCIES) $(ART_HOST_TEST_EXECUTABLES) $(ART_TEST_HOST_DEX_FILES) $(HOST_CORE_IMG_OUT) |
| 109 | ART_TARGET_TEST_DEPENDENCIES := $(ART_TARGET_DEPENDENCIES) $(ART_TARGET_TEST_EXECUTABLES) $(ART_TEST_TARGET_DEX_FILES) $(TARGET_CORE_IMG_OUT) |
Brian Carlstrom | 1619286 | 2011-09-12 17:50:06 -0700 | [diff] [blame] | 110 | |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 111 | include $(art_build_path)/Android.libarttest.mk |
Brian Carlstrom | 934486c | 2011-07-12 23:42:50 -0700 | [diff] [blame] | 112 | |
Brian Carlstrom | 4a96b60 | 2011-07-26 16:40:23 -0700 | [diff] [blame] | 113 | # "mm test-art" to build and run all tests on host and device |
| 114 | .PHONY: test-art |
| 115 | test-art: test-art-host test-art-target |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 116 | @echo test-art PASSED |
Brian Carlstrom | 4a96b60 | 2011-07-26 16:40:23 -0700 | [diff] [blame] | 117 | |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 118 | .PHONY: test-art-gtest |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 119 | test-art-gtest: test-art-host-gtest test-art-target-gtest |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 120 | @echo test-art-gtest PASSED |
| 121 | |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 122 | .PHONY: test-art-oat |
Brian Carlstrom | dbaa93a | 2013-07-31 15:13:10 -0700 | [diff] [blame] | 123 | test-art-oat: test-art-host-oat test-art-target-oat |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 124 | @echo test-art-oat PASSED |
Elliott Hughes | 2cae5a2 | 2011-08-14 14:27:25 -0700 | [diff] [blame] | 125 | |
Brian Carlstrom | 08981ab | 2012-05-25 18:40:15 -0700 | [diff] [blame] | 126 | .PHONY: test-art-run-test |
Brian Carlstrom | dbaa93a | 2013-07-31 15:13:10 -0700 | [diff] [blame] | 127 | test-art-run-test: test-art-host-run-test test-art-target-run-test |
Brian Carlstrom | 08981ab | 2012-05-25 18:40:15 -0700 | [diff] [blame] | 128 | @echo test-art-run-test PASSED |
| 129 | |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 130 | ######################################################################## |
| 131 | # host test targets |
| 132 | |
Brian Carlstrom | 934486c | 2011-07-12 23:42:50 -0700 | [diff] [blame] | 133 | # "mm test-art-host" to build and run all host tests |
| 134 | .PHONY: test-art-host |
Brian Carlstrom | dbaa93a | 2013-07-31 15:13:10 -0700 | [diff] [blame] | 135 | test-art-host: test-art-host-gtest test-art-host-oat test-art-host-run-test |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 136 | @echo test-art-host PASSED |
Brian Carlstrom | 59848da | 2011-07-23 20:35:19 -0700 | [diff] [blame] | 137 | |
Ian Rogers | 85d9ba6 | 2013-01-16 22:32:12 -0800 | [diff] [blame] | 138 | .PHONY: test-art-host-interpreter |
Brian Carlstrom | dbaa93a | 2013-07-31 15:13:10 -0700 | [diff] [blame] | 139 | test-art-host-interpreter: test-art-host-oat-interpreter test-art-host-run-test-interpreter |
Ian Rogers | 85d9ba6 | 2013-01-16 22:32:12 -0800 | [diff] [blame] | 140 | @echo test-art-host-interpreter PASSED |
| 141 | |
Brian Carlstrom | b0aa9d3 | 2012-04-07 23:12:22 -0700 | [diff] [blame] | 142 | .PHONY: test-art-host-dependencies |
Brian Carlstrom | 58805e4 | 2013-03-31 01:19:24 -0700 | [diff] [blame] | 143 | test-art-host-dependencies: $(ART_HOST_TEST_DEPENDENCIES) $(HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) $(HOST_CORE_DEX_LOCATIONS) |
Brian Carlstrom | b0aa9d3 | 2012-04-07 23:12:22 -0700 | [diff] [blame] | 144 | |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 145 | .PHONY: test-art-host-gtest |
| 146 | test-art-host-gtest: $(ART_HOST_TEST_TARGETS) |
| 147 | @echo test-art-host-gtest PASSED |
Elliott Hughes | 2cae5a2 | 2011-08-14 14:27:25 -0700 | [diff] [blame] | 148 | |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 149 | define run-host-gtests-with |
| 150 | $(foreach file,$(sort $(ART_HOST_TEST_EXECUTABLES)),$(1) $(file) &&) true |
| 151 | endef |
| 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 Carlstrom | b0aa9d3 | 2012-04-07 23:12:22 -0700 | [diff] [blame] | 155 | valgrind-test-art-host-gtest: test-art-host-dependencies |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 156 | $(call run-host-gtests-with,valgrind --leak-check=full) |
| 157 | @echo valgrind-test-art-host-gtest PASSED |
| 158 | |
Brian Carlstrom | dbaa93a | 2013-07-31 15:13:10 -0700 | [diff] [blame] | 159 | .PHONY: test-art-host-oat-default |
| 160 | test-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 |
| 164 | test-art-host-oat-interpreter: $(ART_TEST_HOST_OAT_INTERPRETER_TARGETS) |
| 165 | @echo test-art-host-oat-interpreter PASSED |
| 166 | |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 167 | .PHONY: test-art-host-oat |
Brian Carlstrom | dbaa93a | 2013-07-31 15:13:10 -0700 | [diff] [blame] | 168 | test-art-host-oat: test-art-host-oat-default test-art-host-oat-interpreter |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 169 | @echo test-art-host-oat PASSED |
Elliott Hughes | 5511f21 | 2011-08-12 18:07:45 -0700 | [diff] [blame] | 170 | |
Brian Carlstrom | 4855cd5 | 2012-04-03 21:38:13 -0700 | [diff] [blame] | 171 | define declare-test-art-host-run-test |
Brian Carlstrom | dbaa93a | 2013-07-31 15:13:10 -0700 | [diff] [blame] | 172 | .PHONY: test-art-host-run-test-default-$(1) |
| 173 | test-art-host-run-test-default-$(1): test-art-host-dependencies |
Brian Carlstrom | 4855cd5 | 2012-04-03 21:38:13 -0700 | [diff] [blame] | 174 | art/test/run-test --host $(1) |
Brian Carlstrom | dbaa93a | 2013-07-31 15:13:10 -0700 | [diff] [blame] | 175 | @echo test-art-host-run-test-default-$(1) PASSED |
Brian Carlstrom | 4855cd5 | 2012-04-03 21:38:13 -0700 | [diff] [blame] | 176 | |
Brian Carlstrom | dbaa93a | 2013-07-31 15:13:10 -0700 | [diff] [blame] | 177 | TEST_ART_HOST_RUN_TEST_DEFAULT_TARGETS += test-art-host-run-test-default-$(1) |
Ian Rogers | 27cedf8 | 2012-11-21 11:42:43 -0800 | [diff] [blame] | 178 | |
Brian Carlstrom | dbaa93a | 2013-07-31 15:13:10 -0700 | [diff] [blame] | 179 | .PHONY: test-art-host-run-test-interpreter-$(1) |
| 180 | test-art-host-run-test-interpreter-$(1): test-art-host-dependencies |
Ian Rogers | 27cedf8 | 2012-11-21 11:42:43 -0800 | [diff] [blame] | 181 | art/test/run-test --host --interpreter $(1) |
Brian Carlstrom | dbaa93a | 2013-07-31 15:13:10 -0700 | [diff] [blame] | 182 | @echo test-art-host-run-test-interpreter-$(1) PASSED |
Ian Rogers | 27cedf8 | 2012-11-21 11:42:43 -0800 | [diff] [blame] | 183 | |
Brian Carlstrom | dbaa93a | 2013-07-31 15:13:10 -0700 | [diff] [blame] | 184 | TEST_ART_HOST_RUN_TEST_INTERPRETER_TARGETS += test-art-host-run-test-interpreter-$(1) |
Brian Carlstrom | a404db0 | 2013-08-28 09:37:40 -0700 | [diff] [blame] | 185 | |
| 186 | .PHONY: test-art-host-run-test-$(1) |
| 187 | test-art-host-run-test-$(1): test-art-host-run-test-default-$(1) test-art-host-run-test-interpreter-$(1) |
| 188 | |
Brian Carlstrom | 4855cd5 | 2012-04-03 21:38:13 -0700 | [diff] [blame] | 189 | endef |
| 190 | |
Elliott Hughes | 84a5bb4 | 2012-05-16 17:52:15 -0700 | [diff] [blame] | 191 | $(foreach test, $(wildcard art/test/[0-9]*), $(eval $(call declare-test-art-host-run-test,$(notdir $(test))))) |
Brian Carlstrom | 4855cd5 | 2012-04-03 21:38:13 -0700 | [diff] [blame] | 192 | |
Brian Carlstrom | dbaa93a | 2013-07-31 15:13:10 -0700 | [diff] [blame] | 193 | .PHONY: test-art-host-run-test-default |
| 194 | test-art-host-run-test-default: $(TEST_ART_HOST_RUN_TEST_DEFAULT_TARGETS) |
| 195 | @echo test-art-host-run-test-default PASSED |
Brian Carlstrom | 4855cd5 | 2012-04-03 21:38:13 -0700 | [diff] [blame] | 196 | |
Brian Carlstrom | dbaa93a | 2013-07-31 15:13:10 -0700 | [diff] [blame] | 197 | .PHONY: test-art-host-run-test-interpreter |
| 198 | test-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 |
| 202 | test-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 Rogers | 27cedf8 | 2012-11-21 11:42:43 -0800 | [diff] [blame] | 204 | |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 205 | ######################################################################## |
| 206 | # target test targets |
| 207 | |
| 208 | # "mm test-art-target" to build and run all target tests |
Brian Carlstrom | 4a96b60 | 2011-07-26 16:40:23 -0700 | [diff] [blame] | 209 | .PHONY: test-art-target |
Brian Carlstrom | e24fa61 | 2011-09-29 00:53:55 -0700 | [diff] [blame] | 210 | test-art-target: test-art-target-gtest test-art-target-oat test-art-target-run-test |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 211 | @echo test-art-target PASSED |
Brian Carlstrom | 8692721 | 2011-09-15 11:31:11 -0700 | [diff] [blame] | 212 | |
Brian Carlstrom | b0aa9d3 | 2012-04-07 23:12:22 -0700 | [diff] [blame] | 213 | .PHONY: test-art-target-dependencies |
| 214 | test-art-target-dependencies: $(ART_TARGET_TEST_DEPENDENCIES) $(ART_TEST_OUT)/libarttest.so |
| 215 | |
Brian Carlstrom | 8692721 | 2011-09-15 11:31:11 -0700 | [diff] [blame] | 216 | .PHONY: test-art-target-sync |
Brian Carlstrom | b0aa9d3 | 2012-04-07 23:12:22 -0700 | [diff] [blame] | 217 | test-art-target-sync: test-art-target-dependencies |
Brian Carlstrom | 4a96b60 | 2011-07-26 16:40:23 -0700 | [diff] [blame] | 218 | adb remount |
| 219 | adb sync |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 220 | adb shell mkdir -p $(ART_TEST_DIR) |
Brian Carlstrom | 8692721 | 2011-09-15 11:31:11 -0700 | [diff] [blame] | 221 | |
| 222 | .PHONY: test-art-target-gtest |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 223 | test-art-target-gtest: $(ART_TARGET_TEST_TARGETS) |
Brian Carlstrom | 8692721 | 2011-09-15 11:31:11 -0700 | [diff] [blame] | 224 | |
| 225 | .PHONY: test-art-target-oat |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 226 | test-art-target-oat: $(ART_TEST_TARGET_OAT_TARGETS) |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 227 | @echo test-art-target-oat PASSED |
Brian Carlstrom | 4a96b60 | 2011-07-26 16:40:23 -0700 | [diff] [blame] | 228 | |
Brian Carlstrom | 37c4444 | 2012-03-06 22:21:18 -0800 | [diff] [blame] | 229 | define declare-test-art-target-run-test |
| 230 | .PHONY: test-art-target-run-test-$(1) |
| 231 | test-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 Carlstrom | e24fa61 | 2011-09-29 00:53:55 -0700 | [diff] [blame] | 234 | |
Brian Carlstrom | 37c4444 | 2012-03-06 22:21:18 -0800 | [diff] [blame] | 235 | TEST_ART_TARGET_RUN_TEST_TARGETS += test-art-target-run-test-$(1) |
Brian Carlstrom | a404db0 | 2013-08-28 09:37:40 -0700 | [diff] [blame] | 236 | |
| 237 | test-art-run-test-$(1): test-art-host-run-test-$(1) test-art-target-run-test-$(1) |
| 238 | |
Brian Carlstrom | 37c4444 | 2012-03-06 22:21:18 -0800 | [diff] [blame] | 239 | endef |
| 240 | |
Elliott Hughes | 84a5bb4 | 2012-05-16 17:52:15 -0700 | [diff] [blame] | 241 | $(foreach test, $(wildcard art/test/[0-9]*), $(eval $(call declare-test-art-target-run-test,$(notdir $(test))))) |
Brian Carlstrom | 37c4444 | 2012-03-06 22:21:18 -0800 | [diff] [blame] | 242 | |
| 243 | .PHONY: test-art-target-run-test |
| 244 | test-art-target-run-test: $(TEST_ART_TARGET_RUN_TEST_TARGETS) |
| 245 | @echo test-art-target-run-test PASSED |
Brian Carlstrom | e24fa61 | 2011-09-29 00:53:55 -0700 | [diff] [blame] | 246 | |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 247 | ######################################################################## |
Brian Carlstrom | 04941d9 | 2012-02-19 01:47:51 -0800 | [diff] [blame] | 248 | # oat-target and oat-target-sync targets |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 249 | |
Brian Carlstrom | 04941d9 | 2012-02-19 01:47:51 -0800 | [diff] [blame] | 250 | OAT_TARGET_TARGETS := |
| 251 | |
| 252 | # $(1): input jar or apk target location |
| 253 | define declare-oat-target-target |
Brian Carlstrom | 46b8a62 | 2012-06-19 23:13:22 -0700 | [diff] [blame] | 254 | ifneq (,$(filter $(1),$(addprefix system/app/,$(addsuffix .apk,$(PRODUCT_DEX_PREOPT_PACKAGES_IN_DATA))))) |
Brian Carlstrom | 999cd43 | 2013-06-22 23:08:53 -0700 | [diff] [blame] | 255 | OUT_OAT_FILE := $(call dalvik-cache-out,$(1)/classes.dex) |
Brian Carlstrom | 46b8a62 | 2012-06-19 23:13:22 -0700 | [diff] [blame] | 256 | else |
Brian Carlstrom | 999cd43 | 2013-06-22 23:08:53 -0700 | [diff] [blame] | 257 | OUT_OAT_FILE := $(PRODUCT_OUT)/$(basename $(1)).odex |
Brian Carlstrom | 46b8a62 | 2012-06-19 23:13:22 -0700 | [diff] [blame] | 258 | endif |
Shih-wei Liao | 2e01f24 | 2012-05-28 03:11:59 -0700 | [diff] [blame] | 259 | |
| 260 | ifeq ($(ONE_SHOT_MAKEFILE),) |
Brian Carlstrom | 90e2741 | 2013-03-13 21:51:47 -0700 | [diff] [blame] | 261 | # 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 Carlstrom | 04941d9 | 2012-02-19 01:47:51 -0800 | [diff] [blame] | 264 | .PHONY: oat-target-$(1) |
Brian Carlstrom | 90e2741 | 2013-03-13 21:51:47 -0700 | [diff] [blame] | 265 | oat-target-$(1): |
Shih-wei Liao | 2e01f24 | 2012-05-28 03:11:59 -0700 | [diff] [blame] | 266 | |
| 267 | else |
| 268 | .PHONY: oat-target-$(1) |
Shih-wei Liao | 7eea0e8 | 2012-05-28 23:56:21 -0700 | [diff] [blame] | 269 | oat-target-$(1): $$(OUT_OAT_FILE) |
Shih-wei Liao | 2e01f24 | 2012-05-28 03:11:59 -0700 | [diff] [blame] | 270 | |
Shih-wei Liao | 7eea0e8 | 2012-05-28 23:56:21 -0700 | [diff] [blame] | 271 | $$(OUT_OAT_FILE): $(PRODUCT_OUT)/$(1) $(TARGET_BOOT_IMG_OUT) $(DEX2OAT_DEPENDENCY) |
Brian Carlstrom | 90e2741 | 2013-03-13 21:51:47 -0700 | [diff] [blame] | 272 | @mkdir -p $$(dir $$@) |
Brian Carlstrom | 3f47c12 | 2013-03-07 00:02:40 -0800 | [diff] [blame] | 273 | $(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 Liao | 2e01f24 | 2012-05-28 03:11:59 -0700 | [diff] [blame] | 274 | |
| 275 | endif |
Brian Carlstrom | 04941d9 | 2012-02-19 01:47:51 -0800 | [diff] [blame] | 276 | |
| 277 | OAT_TARGET_TARGETS += oat-target-$(1) |
Brian Carlstrom | a9f1978 | 2011-10-13 00:14:47 -0700 | [diff] [blame] | 278 | endef |
| 279 | |
Brian Carlstrom | bd41102 | 2012-02-07 12:09:09 -0800 | [diff] [blame] | 280 | $(foreach file,\ |
| 281 | $(filter-out\ |
Brian Carlstrom | 46b8a62 | 2012-06-19 23:13:22 -0700 | [diff] [blame] | 282 | $(addprefix $(TARGET_OUT_JAVA_LIBRARIES)/,$(addsuffix .jar,$(TARGET_BOOT_JARS))),\ |
Brian Carlstrom | bd41102 | 2012-02-07 12:09:09 -0800 | [diff] [blame] | 283 | $(wildcard $(TARGET_OUT_APPS)/*.apk) $(wildcard $(TARGET_OUT_JAVA_LIBRARIES)/*.jar)),\ |
Brian Carlstrom | 04941d9 | 2012-02-19 01:47:51 -0800 | [diff] [blame] | 284 | $(eval $(call declare-oat-target-target,$(subst $(PRODUCT_OUT)/,,$(file))))) |
| 285 | |
| 286 | .PHONY: oat-target |
| 287 | oat-target: $(ART_TARGET_DEPENDENCIES) $(TARGET_BOOT_OAT_OUT) $(OAT_TARGET_TARGETS) |
Ian Rogers | beb60e2 | 2012-01-31 10:40:40 -0800 | [diff] [blame] | 288 | |
Brian Carlstrom | a6cc893 | 2012-01-04 14:44:07 -0800 | [diff] [blame] | 289 | .PHONY: oat-target-sync |
Brian Carlstrom | 04941d9 | 2012-02-19 01:47:51 -0800 | [diff] [blame] | 290 | oat-target-sync: oat-target |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 291 | adb remount |
| 292 | adb sync |
| 293 | |
Brian Carlstrom | 76aa0c0 | 2011-10-11 15:29:43 -0700 | [diff] [blame] | 294 | ######################################################################## |
Brian Carlstrom | fa50baa | 2013-08-02 01:00:27 -0700 | [diff] [blame] | 295 | # "m build-art" for quick minimal build |
| 296 | .PHONY: build-art |
| 297 | build-art: build-art-host build-art-target |
| 298 | |
| 299 | .PHONY: build-art-host |
| 300 | build-art-host: $(ART_HOST_EXECUTABLES) $(ART_HOST_TEST_EXECUTABLES) $(HOST_CORE_IMG_OUT) $(HOST_OUT)/lib/libjavacore.so |
| 301 | |
| 302 | .PHONY: build-art-target |
| 303 | build-art-target: $(ART_TARGET_EXECUTABLES) $(ART_TARGET_TEST_EXECUTABLES) $(TARGET_CORE_IMG_OUT) $(TARGET_OUT)/lib/libjavacore.so |
| 304 | |
| 305 | ######################################################################## |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 306 | # oatdump targets |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 307 | |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 308 | .PHONY: dump-oat |
Ian Rogers | 62d6c77 | 2013-02-27 08:32:07 -0800 | [diff] [blame] | 309 | dump-oat: dump-oat-core dump-oat-boot |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 310 | |
Brian Carlstrom | e10b697 | 2011-09-26 13:49:03 -0700 | [diff] [blame] | 311 | .PHONY: dump-oat-core |
Brian Carlstrom | 13c492b | 2012-03-22 17:09:17 -0700 | [diff] [blame] | 312 | dump-oat-core: dump-oat-core-host dump-oat-core-target |
| 313 | |
| 314 | .PHONY: dump-oat-core-host |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 315 | ifeq ($(ART_BUILD_HOST),true) |
Brian Carlstrom | 13c492b | 2012-03-22 17:09:17 -0700 | [diff] [blame] | 316 | dump-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 Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 319 | endif |
Brian Carlstrom | 13c492b | 2012-03-22 17:09:17 -0700 | [diff] [blame] | 320 | |
| 321 | .PHONY: dump-oat-core-target |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 322 | ifeq ($(ART_BUILD_TARGET),true) |
Brian Carlstrom | 13c492b | 2012-03-22 17:09:17 -0700 | [diff] [blame] | 323 | dump-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 Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 326 | endif |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 327 | |
Brian Carlstrom | e10b697 | 2011-09-26 13:49:03 -0700 | [diff] [blame] | 328 | .PHONY: dump-oat-boot |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 329 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
Brian Carlstrom | 13c492b | 2012-03-22 17:09:17 -0700 | [diff] [blame] | 330 | dump-oat-boot: $(TARGET_BOOT_IMG_OUT) $(OATDUMP) |
Brian Carlstrom | fe487d0 | 2012-02-29 18:49:16 -0800 | [diff] [blame] | 331 | $(OATDUMP) --image=$(TARGET_BOOT_IMG_OUT) --output=/tmp/boot.oatdump.txt |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 332 | @echo Output in /tmp/boot.oatdump.txt |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 333 | endif |
Brian Carlstrom | 78128a6 | 2011-09-15 17:21:19 -0700 | [diff] [blame] | 334 | |
Brian Carlstrom | 2e92fd6 | 2012-10-18 00:04:10 -0700 | [diff] [blame] | 335 | .PHONY: dump-oat-Calculator |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 336 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
Brian Carlstrom | 30e2ea4 | 2013-06-19 23:25:37 -0700 | [diff] [blame] | 337 | dump-oat-Calculator: $(TARGET_OUT_APPS)/Calculator.odex $(TARGET_BOOT_IMG_OUT) $(OATDUMP) |
Brian Carlstrom | 2e92fd6 | 2012-10-18 00:04:10 -0700 | [diff] [blame] | 338 | $(OATDUMP) --oat-file=$< --output=/tmp/Calculator.oatdump.txt |
| 339 | @echo Output in /tmp/Calculator.oatdump.txt |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 340 | endif |
Brian Carlstrom | 2e92fd6 | 2012-10-18 00:04:10 -0700 | [diff] [blame] | 341 | |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 342 | ######################################################################## |
Brian Carlstrom | fc0e321 | 2013-07-17 14:40:12 -0700 | [diff] [blame] | 343 | # cpplint targets to style check art source files |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 344 | |
Brian Carlstrom | 05eecea | 2013-07-18 21:59:52 -0700 | [diff] [blame] | 345 | include $(art_build_path)/Android.cpplint.mk |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 346 | |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 347 | ######################################################################## |
Brian Carlstrom | a7a60a8 | 2013-06-24 17:41:19 -0700 | [diff] [blame] | 348 | # targets to switch back and forth from libdvm to libart |
| 349 | |
| 350 | .PHONY: use-art |
| 351 | use-art: |
| 352 | adb root && sleep 3 |
Brian Carlstrom | cef450c | 2013-06-28 14:38:26 -0700 | [diff] [blame] | 353 | adb shell setprop persist.sys.dalvik.vm.lib libart.so |
Brian Carlstrom | a7a60a8 | 2013-06-24 17:41:19 -0700 | [diff] [blame] | 354 | adb reboot |
| 355 | |
| 356 | .PHONY: use-artd |
| 357 | use-artd: |
| 358 | adb root && sleep 3 |
Brian Carlstrom | cef450c | 2013-06-28 14:38:26 -0700 | [diff] [blame] | 359 | adb shell setprop persist.sys.dalvik.vm.lib libartd.so |
Brian Carlstrom | a7a60a8 | 2013-06-24 17:41:19 -0700 | [diff] [blame] | 360 | adb reboot |
| 361 | |
| 362 | .PHONY: use-dalvik |
| 363 | use-dalvik: |
| 364 | adb root && sleep 3 |
Brian Carlstrom | cef450c | 2013-06-28 14:38:26 -0700 | [diff] [blame] | 365 | adb shell setprop persist.sys.dalvik.vm.lib libdvm.so |
Brian Carlstrom | a7a60a8 | 2013-06-24 17:41:19 -0700 | [diff] [blame] | 366 | adb reboot |
| 367 | |
| 368 | ######################################################################## |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 369 | |
Brian Carlstrom | 62e3ee3 | 2012-06-18 14:58:55 -0700 | [diff] [blame] | 370 | endif # !art_dont_bother |