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 | 4b620ff | 2011-09-11 01:11:01 -0700 | [diff] [blame] | 19 | # These can be overridden via the environment or by editing to |
| 20 | # enable/disable certain build configuration. |
Brian Carlstrom | cb91f1a | 2013-02-01 12:55:09 -0800 | [diff] [blame] | 21 | # |
| 22 | # For example, to disable everything but the host debug build you use: |
| 23 | # |
| 24 | # (export ART_BUILD_TARGET_NDEBUG=false && export ART_BUILD_TARGET_DEBUG=false && export ART_BUILD_HOST_NDEBUG=false && ...) |
| 25 | # |
| 26 | # Beware that tests may use the non-debug build for performance, notable 055-enum-performance |
| 27 | # |
Brian Carlstrom | 4b620ff | 2011-09-11 01:11:01 -0700 | [diff] [blame] | 28 | ART_BUILD_TARGET_NDEBUG ?= true |
| 29 | ART_BUILD_TARGET_DEBUG ?= true |
Brian Carlstrom | 8ce8647 | 2011-12-15 13:50:38 -0800 | [diff] [blame] | 30 | ART_BUILD_HOST_NDEBUG ?= true |
| 31 | ART_BUILD_HOST_DEBUG ?= true |
Brian Carlstrom | 4b620ff | 2011-09-11 01:11:01 -0700 | [diff] [blame] | 32 | |
Brian Carlstrom | cb91f1a | 2013-02-01 12:55:09 -0800 | [diff] [blame] | 33 | ifeq ($(ART_BUILD_TARGET_NDEBUG),false) |
| 34 | $(info Disabling ART_BUILD_TARGET_NDEBUG) |
| 35 | endif |
| 36 | ifeq ($(ART_BUILD_TARGET_DEBUG),false) |
| 37 | $(info Disabling ART_BUILD_TARGET_DEBUG) |
| 38 | endif |
| 39 | ifeq ($(ART_BUILD_HOST_NDEBUG),false) |
| 40 | $(info Disabling ART_BUILD_HOST_NDEBUG) |
| 41 | endif |
| 42 | ifeq ($(ART_BUILD_HOST_DEBUG),false) |
| 43 | $(info Disabling ART_BUILD_HOST_DEBUG) |
| 44 | endif |
| 45 | |
Elliott Hughes | f1eedca | 2012-04-20 16:00:32 -0700 | [diff] [blame] | 46 | ART_HOST_SHLIB_EXTENSION := $(HOST_SHLIB_SUFFIX) |
| 47 | ART_HOST_SHLIB_EXTENSION ?= .so |
| 48 | |
Carl Shapiro | 0e6d197 | 2011-07-06 19:17:39 -0700 | [diff] [blame] | 49 | build_path := $(LOCAL_PATH)/build |
Brian Carlstrom | cdc8de4 | 2011-07-19 14:23:17 -0700 | [diff] [blame] | 50 | include $(build_path)/Android.common.mk |
| 51 | |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 52 | ######################################################################## |
Brian Carlstrom | 62e3ee3 | 2012-06-18 14:58:55 -0700 | [diff] [blame] | 53 | # clean-oat targets |
| 54 | # |
| 55 | |
| 56 | # following the example of build's dont_bother for clean targets |
| 57 | ifneq (,$(filter clean-oat,$(MAKECMDGOALS))) |
| 58 | art_dont_bother := true |
| 59 | endif |
| 60 | ifneq (,$(filter clean-oat-host,$(MAKECMDGOALS))) |
| 61 | art_dont_bother := true |
| 62 | endif |
| 63 | ifneq (,$(filter clean-oat-target,$(MAKECMDGOALS))) |
| 64 | art_dont_bother := true |
| 65 | endif |
| 66 | |
| 67 | .PHONY: clean-oat |
| 68 | clean-oat: clean-oat-host clean-oat-target |
| 69 | |
| 70 | .PHONY: clean-oat-host |
| 71 | clean-oat-host: |
| 72 | rm -f $(ART_NATIVETEST_OUT)/*.oat |
| 73 | rm -f $(ART_NATIVETEST_OUT)/*.art |
| 74 | rm -f $(ART_TEST_OUT)/*.oat |
| 75 | rm -f $(ART_TEST_OUT)/*.art |
| 76 | rm -f $(ART_CACHE_OUT)/*.oat |
| 77 | rm -f $(ART_CACHE_OUT)/*.art |
| 78 | rm -f $(HOST_OUT_JAVA_LIBRARIES)/*.oat |
| 79 | rm -f $(HOST_OUT_JAVA_LIBRARIES)/*.art |
| 80 | rm -f $(TARGET_OUT_JAVA_LIBRARIES)/*.oat |
| 81 | rm -f $(TARGET_OUT_JAVA_LIBRARIES)/*.art |
Brian Carlstrom | 1d6848c | 2013-03-06 15:03:52 -0800 | [diff] [blame] | 82 | rm -f $(TARGET_OUT_UNSTRIPPED)/system/framework/*.oat |
Brian Carlstrom | 62e3ee3 | 2012-06-18 14:58:55 -0700 | [diff] [blame] | 83 | rm -f $(TARGET_OUT_APPS)/*.oat |
| 84 | rm -f $(TARGET_OUT_INTERMEDIATES)/JAVA_LIBRARIES/*_intermediates/javalib.jar.oat |
Brian Carlstrom | 3f47c12 | 2013-03-07 00:02:40 -0800 | [diff] [blame^] | 85 | rm -f $(TARGET_OUT_INTERMEDIATES)/APPS/*_intermediates/*.apk.oat |
Brian Carlstrom | 62e3ee3 | 2012-06-18 14:58:55 -0700 | [diff] [blame] | 86 | rm -rf /tmp/test-*/art-cache/*.oat |
| 87 | |
| 88 | .PHONY: clean-oat-target |
| 89 | clean-oat-target: |
| 90 | adb remount |
| 91 | adb shell rm $(ART_NATIVETEST_DIR)/*.oat |
| 92 | adb shell rm $(ART_NATIVETEST_DIR)/*.art |
| 93 | adb shell rm $(ART_TEST_DIR)/*.oat |
| 94 | adb shell rm $(ART_TEST_DIR)/*.art |
| 95 | adb shell rm $(ART_CACHE_DIR)/*.oat |
| 96 | adb shell rm $(ART_CACHE_DIR)/*.art |
| 97 | adb shell rm $(DEXPREOPT_BOOT_JAR_DIR)/*.oat |
| 98 | adb shell rm $(DEXPREOPT_BOOT_JAR_DIR)/*.art |
| 99 | adb shell rm system/app/*.oat |
| 100 | adb shell rm data/run-test/test-*/art-cache/*.oat |
| 101 | |
| 102 | ifneq ($(art_dont_bother),true) |
| 103 | |
| 104 | ######################################################################## |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 105 | # product targets |
Carl Shapiro | 0e6d197 | 2011-07-06 19:17:39 -0700 | [diff] [blame] | 106 | include $(build_path)/Android.libart.mk |
Elliott Hughes | b3bd5f0 | 2012-03-08 21:05:27 -0800 | [diff] [blame] | 107 | include $(build_path)/Android.libart-compiler.mk |
Brian Carlstrom | 69b15fb | 2011-09-03 12:25:21 -0700 | [diff] [blame] | 108 | include $(build_path)/Android.executable.mk |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 109 | include $(build_path)/Android.oat.mk |
Carl Shapiro | 7b21670 | 2011-06-17 15:09:26 -0700 | [diff] [blame] | 110 | |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 111 | # 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] | 112 | 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] | 113 | ART_HOST_DEPENDENCIES += $(HOST_OUT_SHARED_LIBRARIES)/libjavacore$(ART_HOST_SHLIB_EXTENSION) |
Brian Carlstrom | 1580379 | 2012-03-13 00:53:08 -0700 | [diff] [blame] | 114 | ART_TARGET_DEPENDENCIES := $(ART_TARGET_EXECUTABLES) $(TARGET_OUT_JAVA_LIBRARIES)/core.jar $(TARGET_OUT_SHARED_LIBRARIES)/libjavacore.so |
| 115 | |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 116 | ######################################################################## |
| 117 | # test targets |
Brian Carlstrom | 1580379 | 2012-03-13 00:53:08 -0700 | [diff] [blame] | 118 | |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 119 | include $(build_path)/Android.oattest.mk |
Brian Carlstrom | b0aa9d3 | 2012-04-07 23:12:22 -0700 | [diff] [blame] | 120 | include $(build_path)/Android.gtest.mk |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 121 | |
| 122 | # The ART_*_TEST_DEPENDENCIES definitions: |
| 123 | # - depend on Android.oattest.mk above for ART_TEST_*_DEX_FILES |
Brian Carlstrom | b0aa9d3 | 2012-04-07 23:12:22 -0700 | [diff] [blame] | 124 | # - depend on Android.gtest.mk above for ART_*_TEST_EXECUTABLES |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 125 | ART_HOST_TEST_DEPENDENCIES := $(ART_HOST_DEPENDENCIES) $(ART_HOST_TEST_EXECUTABLES) $(ART_TEST_HOST_DEX_FILES) $(HOST_CORE_IMG_OUT) |
| 126 | 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] | 127 | |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 128 | include $(build_path)/Android.libarttest.mk |
Brian Carlstrom | 934486c | 2011-07-12 23:42:50 -0700 | [diff] [blame] | 129 | |
| 130 | # "m build-art" for quick minimal build |
| 131 | .PHONY: build-art |
| 132 | build-art: \ |
Brian Carlstrom | 69b15fb | 2011-09-03 12:25:21 -0700 | [diff] [blame] | 133 | $(ART_TARGET_EXECUTABLES) \ |
Brian Carlstrom | 8ecd08c | 2011-07-27 17:50:51 -0700 | [diff] [blame] | 134 | $(ART_TARGET_TEST_EXECUTABLES) \ |
Brian Carlstrom | 69b15fb | 2011-09-03 12:25:21 -0700 | [diff] [blame] | 135 | $(ART_HOST_EXECUTABLES) \ |
Carl Shapiro | 47940d6 | 2011-08-13 22:21:30 -0700 | [diff] [blame] | 136 | $(ART_HOST_TEST_EXECUTABLES) |
Brian Carlstrom | 934486c | 2011-07-12 23:42:50 -0700 | [diff] [blame] | 137 | |
Brian Carlstrom | 4a96b60 | 2011-07-26 16:40:23 -0700 | [diff] [blame] | 138 | # "mm test-art" to build and run all tests on host and device |
| 139 | .PHONY: test-art |
| 140 | test-art: test-art-host test-art-target |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 141 | @echo test-art PASSED |
Brian Carlstrom | 4a96b60 | 2011-07-26 16:40:23 -0700 | [diff] [blame] | 142 | |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 143 | .PHONY: test-art-gtest |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 144 | test-art-gtest: test-art-host-gtest test-art-target-gtest |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 145 | @echo test-art-gtest PASSED |
| 146 | |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 147 | .PHONY: test-art-oat |
Ian Rogers | 85d9ba6 | 2013-01-16 22:32:12 -0800 | [diff] [blame] | 148 | test-art-oat: test-art-host-oat test-art-target-oat test-art-host-interpreter-oat |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 149 | @echo test-art-oat PASSED |
Elliott Hughes | 2cae5a2 | 2011-08-14 14:27:25 -0700 | [diff] [blame] | 150 | |
Brian Carlstrom | 08981ab | 2012-05-25 18:40:15 -0700 | [diff] [blame] | 151 | .PHONY: test-art-run-test |
Ian Rogers | 85d9ba6 | 2013-01-16 22:32:12 -0800 | [diff] [blame] | 152 | test-art-run-test: test-art-host-run-test test-art-target-run-test test-art-host-interpreter-run-test |
Brian Carlstrom | 08981ab | 2012-05-25 18:40:15 -0700 | [diff] [blame] | 153 | @echo test-art-run-test PASSED |
| 154 | |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 155 | ######################################################################## |
| 156 | # host test targets |
| 157 | |
Brian Carlstrom | 934486c | 2011-07-12 23:42:50 -0700 | [diff] [blame] | 158 | # "mm test-art-host" to build and run all host tests |
| 159 | .PHONY: test-art-host |
Ian Rogers | 85d9ba6 | 2013-01-16 22:32:12 -0800 | [diff] [blame] | 160 | test-art-host: test-art-host-gtest test-art-host-oat test-art-host-run-test test-art-host-interpreter |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 161 | @echo test-art-host PASSED |
Brian Carlstrom | 59848da | 2011-07-23 20:35:19 -0700 | [diff] [blame] | 162 | |
Ian Rogers | 85d9ba6 | 2013-01-16 22:32:12 -0800 | [diff] [blame] | 163 | .PHONY: test-art-host-interpreter |
| 164 | test-art-host-interpreter: test-art-host-interpreter-oat test-art-host-interpreter-run-test |
| 165 | @echo test-art-host-interpreter PASSED |
| 166 | |
Brian Carlstrom | b0aa9d3 | 2012-04-07 23:12:22 -0700 | [diff] [blame] | 167 | .PHONY: test-art-host-dependencies |
Elliott Hughes | f1eedca | 2012-04-20 16:00:32 -0700 | [diff] [blame] | 168 | test-art-host-dependencies: $(ART_HOST_TEST_DEPENDENCIES) $(HOST_OUT_SHARED_LIBRARIES)/libarttest$(ART_HOST_SHLIB_EXTENSION) |
Brian Carlstrom | b0aa9d3 | 2012-04-07 23:12:22 -0700 | [diff] [blame] | 169 | |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 170 | .PHONY: test-art-host-gtest |
| 171 | test-art-host-gtest: $(ART_HOST_TEST_TARGETS) |
| 172 | @echo test-art-host-gtest PASSED |
Elliott Hughes | 2cae5a2 | 2011-08-14 14:27:25 -0700 | [diff] [blame] | 173 | |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 174 | define run-host-gtests-with |
| 175 | $(foreach file,$(sort $(ART_HOST_TEST_EXECUTABLES)),$(1) $(file) &&) true |
| 176 | endef |
| 177 | |
| 178 | # "mm valgrind-test-art-host-gtest" to build and run the host gtests under valgrind. |
| 179 | .PHONY: valgrind-test-art-host-gtest |
Brian Carlstrom | b0aa9d3 | 2012-04-07 23:12:22 -0700 | [diff] [blame] | 180 | valgrind-test-art-host-gtest: test-art-host-dependencies |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 181 | $(call run-host-gtests-with,valgrind --leak-check=full) |
| 182 | @echo valgrind-test-art-host-gtest PASSED |
| 183 | |
| 184 | # "mm tsan-test-art-host-gtest" to build and run the host gtests under tsan. |
| 185 | .PHONY: tsan-test-art-host-gtest |
Brian Carlstrom | b0aa9d3 | 2012-04-07 23:12:22 -0700 | [diff] [blame] | 186 | tsan-test-art-host-gtest: test-art-host-dependencies |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 187 | $(call run-host-gtests-with,"tsan") |
| 188 | @echo tsan-test-art-host-gtest PASSED |
| 189 | |
| 190 | .PHONY: test-art-host-oat |
| 191 | test-art-host-oat: $(ART_TEST_HOST_OAT_TARGETS) |
| 192 | @echo test-art-host-oat PASSED |
Elliott Hughes | 5511f21 | 2011-08-12 18:07:45 -0700 | [diff] [blame] | 193 | |
Ian Rogers | 85d9ba6 | 2013-01-16 22:32:12 -0800 | [diff] [blame] | 194 | .PHONY: test-art-host-interpreter-oat |
| 195 | test-art-host-interpreter-oat: $(ART_TEST_HOST_INTERPRETER_OAT_TARGETS) |
| 196 | @echo test-art-host-interpreter-oat PASSED |
| 197 | |
Brian Carlstrom | 4855cd5 | 2012-04-03 21:38:13 -0700 | [diff] [blame] | 198 | define declare-test-art-host-run-test |
| 199 | .PHONY: test-art-host-run-test-$(1) |
Brian Carlstrom | b0aa9d3 | 2012-04-07 23:12:22 -0700 | [diff] [blame] | 200 | test-art-host-run-test-$(1): test-art-host-dependencies |
Brian Carlstrom | 4855cd5 | 2012-04-03 21:38:13 -0700 | [diff] [blame] | 201 | art/test/run-test --host $(1) |
| 202 | @echo test-art-host-run-test-$(1) PASSED |
| 203 | |
| 204 | TEST_ART_HOST_RUN_TEST_TARGETS += test-art-host-run-test-$(1) |
Ian Rogers | 27cedf8 | 2012-11-21 11:42:43 -0800 | [diff] [blame] | 205 | |
| 206 | .PHONY: test-art-host-interpreter-run-test-$(1) |
| 207 | test-art-host-interpreter-run-test-$(1): test-art-host-dependencies |
| 208 | art/test/run-test --host --interpreter $(1) |
| 209 | @echo test-art-host-interpreter-run-test-$(1) PASSED |
| 210 | |
| 211 | TEST_ART_HOST_INTERPRETER_RUN_TEST_TARGETS += test-art-host-interpreter-run-test-$(1) |
Brian Carlstrom | 4855cd5 | 2012-04-03 21:38:13 -0700 | [diff] [blame] | 212 | endef |
| 213 | |
Elliott Hughes | 84a5bb4 | 2012-05-16 17:52:15 -0700 | [diff] [blame] | 214 | $(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] | 215 | |
| 216 | .PHONY: test-art-host-run-test |
| 217 | test-art-host-run-test: $(TEST_ART_HOST_RUN_TEST_TARGETS) |
| 218 | @echo test-art-host-run-test PASSED |
| 219 | |
Ian Rogers | 27cedf8 | 2012-11-21 11:42:43 -0800 | [diff] [blame] | 220 | .PHONY: test-art-host-interpreter-run-test |
| 221 | test-art-host-interpreter-run-test: $(TEST_ART_HOST_INTERPRETER_RUN_TEST_TARGETS) |
| 222 | @echo test-art-host-interpreter-run-test PASSED |
| 223 | |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 224 | ######################################################################## |
| 225 | # target test targets |
| 226 | |
| 227 | # "mm test-art-target" to build and run all target tests |
Brian Carlstrom | 4a96b60 | 2011-07-26 16:40:23 -0700 | [diff] [blame] | 228 | .PHONY: test-art-target |
Brian Carlstrom | e24fa61 | 2011-09-29 00:53:55 -0700 | [diff] [blame] | 229 | 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] | 230 | @echo test-art-target PASSED |
Brian Carlstrom | 8692721 | 2011-09-15 11:31:11 -0700 | [diff] [blame] | 231 | |
Brian Carlstrom | b0aa9d3 | 2012-04-07 23:12:22 -0700 | [diff] [blame] | 232 | .PHONY: test-art-target-dependencies |
| 233 | test-art-target-dependencies: $(ART_TARGET_TEST_DEPENDENCIES) $(ART_TEST_OUT)/libarttest.so |
| 234 | |
Brian Carlstrom | 8692721 | 2011-09-15 11:31:11 -0700 | [diff] [blame] | 235 | .PHONY: test-art-target-sync |
Brian Carlstrom | b0aa9d3 | 2012-04-07 23:12:22 -0700 | [diff] [blame] | 236 | test-art-target-sync: test-art-target-dependencies |
Brian Carlstrom | 4a96b60 | 2011-07-26 16:40:23 -0700 | [diff] [blame] | 237 | adb remount |
| 238 | adb sync |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 239 | adb shell mkdir -p $(ART_TEST_DIR) |
Brian Carlstrom | 8692721 | 2011-09-15 11:31:11 -0700 | [diff] [blame] | 240 | |
| 241 | .PHONY: test-art-target-gtest |
Brian Carlstrom | 47a0d5a | 2011-10-12 21:20:05 -0700 | [diff] [blame] | 242 | test-art-target-gtest: $(ART_TARGET_TEST_TARGETS) |
Brian Carlstrom | 8692721 | 2011-09-15 11:31:11 -0700 | [diff] [blame] | 243 | |
| 244 | .PHONY: test-art-target-oat |
Brian Carlstrom | b279337 | 2012-03-17 18:27:16 -0700 | [diff] [blame] | 245 | test-art-target-oat: $(ART_TEST_TARGET_OAT_TARGETS) |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 246 | @echo test-art-target-oat PASSED |
Brian Carlstrom | 4a96b60 | 2011-07-26 16:40:23 -0700 | [diff] [blame] | 247 | |
Brian Carlstrom | 37c4444 | 2012-03-06 22:21:18 -0800 | [diff] [blame] | 248 | define declare-test-art-target-run-test |
| 249 | .PHONY: test-art-target-run-test-$(1) |
| 250 | test-art-target-run-test-$(1): test-art-target-sync |
| 251 | art/test/run-test $(1) |
| 252 | @echo test-art-target-run-test-$(1) PASSED |
Brian Carlstrom | e24fa61 | 2011-09-29 00:53:55 -0700 | [diff] [blame] | 253 | |
Brian Carlstrom | 37c4444 | 2012-03-06 22:21:18 -0800 | [diff] [blame] | 254 | TEST_ART_TARGET_RUN_TEST_TARGETS += test-art-target-run-test-$(1) |
| 255 | endef |
| 256 | |
Elliott Hughes | 84a5bb4 | 2012-05-16 17:52:15 -0700 | [diff] [blame] | 257 | $(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] | 258 | |
| 259 | .PHONY: test-art-target-run-test |
| 260 | test-art-target-run-test: $(TEST_ART_TARGET_RUN_TEST_TARGETS) |
| 261 | @echo test-art-target-run-test PASSED |
Brian Carlstrom | e24fa61 | 2011-09-29 00:53:55 -0700 | [diff] [blame] | 262 | |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 263 | ######################################################################## |
Brian Carlstrom | 04941d9 | 2012-02-19 01:47:51 -0800 | [diff] [blame] | 264 | # oat-target and oat-target-sync targets |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 265 | |
Brian Carlstrom | 04941d9 | 2012-02-19 01:47:51 -0800 | [diff] [blame] | 266 | OAT_TARGET_TARGETS := |
| 267 | |
| 268 | # $(1): input jar or apk target location |
| 269 | define declare-oat-target-target |
Brian Carlstrom | 46b8a62 | 2012-06-19 23:13:22 -0700 | [diff] [blame] | 270 | ifneq (,$(filter $(1),$(addprefix system/app/,$(addsuffix .apk,$(PRODUCT_DEX_PREOPT_PACKAGES_IN_DATA))))) |
Shih-wei Liao | 2e01f24 | 2012-05-28 03:11:59 -0700 | [diff] [blame] | 271 | OUT_OAT_FILE := $(call art-cache-out,$(1).oat) |
Brian Carlstrom | 46b8a62 | 2012-06-19 23:13:22 -0700 | [diff] [blame] | 272 | else |
| 273 | OUT_OAT_FILE := $(PRODUCT_OUT)/$(1).oat |
| 274 | endif |
Shih-wei Liao | 2e01f24 | 2012-05-28 03:11:59 -0700 | [diff] [blame] | 275 | |
| 276 | ifeq ($(ONE_SHOT_MAKEFILE),) |
Brian Carlstrom | 04941d9 | 2012-02-19 01:47:51 -0800 | [diff] [blame] | 277 | .PHONY: oat-target-$(1) |
| 278 | oat-target-$(1): $(PRODUCT_OUT)/$(1) $(TARGET_BOOT_IMG_OUT) $(DEX2OAT_DEPENDENCY) |
Brian Carlstrom | 3f47c12 | 2013-03-07 00:02:40 -0800 | [diff] [blame^] | 279 | $(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=$$(OUT_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] | 280 | |
| 281 | else |
| 282 | .PHONY: oat-target-$(1) |
Shih-wei Liao | 7eea0e8 | 2012-05-28 23:56:21 -0700 | [diff] [blame] | 283 | oat-target-$(1): $$(OUT_OAT_FILE) |
Shih-wei Liao | 2e01f24 | 2012-05-28 03:11:59 -0700 | [diff] [blame] | 284 | |
Shih-wei Liao | 7eea0e8 | 2012-05-28 23:56:21 -0700 | [diff] [blame] | 285 | $$(OUT_OAT_FILE): $(PRODUCT_OUT)/$(1) $(TARGET_BOOT_IMG_OUT) $(DEX2OAT_DEPENDENCY) |
Brian Carlstrom | 3f47c12 | 2013-03-07 00:02:40 -0800 | [diff] [blame^] | 286 | $(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] | 287 | |
| 288 | endif |
Brian Carlstrom | 04941d9 | 2012-02-19 01:47:51 -0800 | [diff] [blame] | 289 | |
| 290 | OAT_TARGET_TARGETS += oat-target-$(1) |
Brian Carlstrom | a9f1978 | 2011-10-13 00:14:47 -0700 | [diff] [blame] | 291 | endef |
| 292 | |
Brian Carlstrom | bd41102 | 2012-02-07 12:09:09 -0800 | [diff] [blame] | 293 | $(foreach file,\ |
| 294 | $(filter-out\ |
Brian Carlstrom | 46b8a62 | 2012-06-19 23:13:22 -0700 | [diff] [blame] | 295 | $(addprefix $(TARGET_OUT_JAVA_LIBRARIES)/,$(addsuffix .jar,$(TARGET_BOOT_JARS))),\ |
Brian Carlstrom | bd41102 | 2012-02-07 12:09:09 -0800 | [diff] [blame] | 296 | $(wildcard $(TARGET_OUT_APPS)/*.apk) $(wildcard $(TARGET_OUT_JAVA_LIBRARIES)/*.jar)),\ |
Brian Carlstrom | 04941d9 | 2012-02-19 01:47:51 -0800 | [diff] [blame] | 297 | $(eval $(call declare-oat-target-target,$(subst $(PRODUCT_OUT)/,,$(file))))) |
| 298 | |
| 299 | .PHONY: oat-target |
| 300 | oat-target: $(ART_TARGET_DEPENDENCIES) $(TARGET_BOOT_OAT_OUT) $(OAT_TARGET_TARGETS) |
Ian Rogers | beb60e2 | 2012-01-31 10:40:40 -0800 | [diff] [blame] | 301 | |
Brian Carlstrom | a6cc893 | 2012-01-04 14:44:07 -0800 | [diff] [blame] | 302 | .PHONY: oat-target-sync |
Brian Carlstrom | 04941d9 | 2012-02-19 01:47:51 -0800 | [diff] [blame] | 303 | oat-target-sync: oat-target |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 304 | adb remount |
| 305 | adb sync |
| 306 | |
Brian Carlstrom | 76aa0c0 | 2011-10-11 15:29:43 -0700 | [diff] [blame] | 307 | ######################################################################## |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 308 | # oatdump targets |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 309 | |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 310 | .PHONY: dump-oat |
Brian Carlstrom | 2e92fd6 | 2012-10-18 00:04:10 -0700 | [diff] [blame] | 311 | dump-oat: dump-oat-core dump-oat-boot dump-oat-Calculator |
Brian Carlstrom | 395520e | 2011-09-25 19:35:00 -0700 | [diff] [blame] | 312 | |
Brian Carlstrom | e10b697 | 2011-09-26 13:49:03 -0700 | [diff] [blame] | 313 | .PHONY: dump-oat-core |
Brian Carlstrom | 13c492b | 2012-03-22 17:09:17 -0700 | [diff] [blame] | 314 | dump-oat-core: dump-oat-core-host dump-oat-core-target |
| 315 | |
| 316 | .PHONY: dump-oat-core-host |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 317 | ifeq ($(ART_BUILD_HOST),true) |
Brian Carlstrom | 13c492b | 2012-03-22 17:09:17 -0700 | [diff] [blame] | 318 | dump-oat-core-host: $(HOST_CORE_IMG_OUT) $(OATDUMP) |
| 319 | $(OATDUMP) --image=$(HOST_CORE_IMG_OUT) --output=/tmp/core.host.oatdump.txt --host-prefix="" |
| 320 | @echo Output in /tmp/core.host.oatdump.txt |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 321 | endif |
Brian Carlstrom | 13c492b | 2012-03-22 17:09:17 -0700 | [diff] [blame] | 322 | |
| 323 | .PHONY: dump-oat-core-target |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 324 | ifeq ($(ART_BUILD_TARGET),true) |
Brian Carlstrom | 13c492b | 2012-03-22 17:09:17 -0700 | [diff] [blame] | 325 | dump-oat-core-target: $(TARGET_CORE_IMG_OUT) $(OATDUMP) |
| 326 | $(OATDUMP) --image=$(TARGET_CORE_IMG_OUT) --output=/tmp/core.target.oatdump.txt |
| 327 | @echo Output in /tmp/core.target.oatdump.txt |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 328 | endif |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 329 | |
Brian Carlstrom | e10b697 | 2011-09-26 13:49:03 -0700 | [diff] [blame] | 330 | .PHONY: dump-oat-boot |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 331 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
Brian Carlstrom | 13c492b | 2012-03-22 17:09:17 -0700 | [diff] [blame] | 332 | dump-oat-boot: $(TARGET_BOOT_IMG_OUT) $(OATDUMP) |
Brian Carlstrom | fe487d0 | 2012-02-29 18:49:16 -0800 | [diff] [blame] | 333 | $(OATDUMP) --image=$(TARGET_BOOT_IMG_OUT) --output=/tmp/boot.oatdump.txt |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 334 | @echo Output in /tmp/boot.oatdump.txt |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 335 | endif |
Brian Carlstrom | 78128a6 | 2011-09-15 17:21:19 -0700 | [diff] [blame] | 336 | |
Brian Carlstrom | 2e92fd6 | 2012-10-18 00:04:10 -0700 | [diff] [blame] | 337 | .PHONY: dump-oat-Calculator |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 338 | ifeq ($(ART_BUILD_TARGET_NDEBUG),true) |
Brian Carlstrom | 2e92fd6 | 2012-10-18 00:04:10 -0700 | [diff] [blame] | 339 | dump-oat-Calculator: $(TARGET_OUT_APPS)/Calculator.apk.oat $(TARGET_BOOT_IMG_OUT) $(OATDUMP) |
| 340 | $(OATDUMP) --oat-file=$< --output=/tmp/Calculator.oatdump.txt |
| 341 | @echo Output in /tmp/Calculator.oatdump.txt |
Brian Carlstrom | 265091e | 2013-01-30 14:08:26 -0800 | [diff] [blame] | 342 | endif |
Brian Carlstrom | 2e92fd6 | 2012-10-18 00:04:10 -0700 | [diff] [blame] | 343 | |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 344 | ######################################################################## |
| 345 | # cpplint target |
| 346 | |
Brian Carlstrom | 59848da | 2011-07-23 20:35:19 -0700 | [diff] [blame] | 347 | # "mm cpplint-art" to style check art source files |
| 348 | .PHONY: cpplint-art |
| 349 | cpplint-art: |
Elliott Hughes | a51a3dd | 2011-10-17 15:19:26 -0700 | [diff] [blame] | 350 | ./art/tools/cpplint.py \ |
Elliott Hughes | b25c3f6 | 2012-03-26 16:35:06 -0700 | [diff] [blame] | 351 | --filter=-whitespace/comments,-whitespace/line_length,-build/include,-build/header_guard,-readability/function,-readability/streams,-readability/todo,-runtime/references \ |
Elliott Hughes | 362f9bc | 2011-10-17 18:56:41 -0700 | [diff] [blame] | 352 | $(ANDROID_BUILD_TOP)/art/src/*.h $(ANDROID_BUILD_TOP)/art/src/*.cc |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 353 | |
Brian Carlstrom | bc2f3e3 | 2011-09-22 17:16:54 -0700 | [diff] [blame] | 354 | ######################################################################## |
| 355 | |
Brian Carlstrom | 27ec961 | 2011-09-19 20:20:38 -0700 | [diff] [blame] | 356 | include $(call all-makefiles-under,$(LOCAL_PATH)) |
Brian Carlstrom | 62e3ee3 | 2012-06-18 14:58:55 -0700 | [diff] [blame] | 357 | |
| 358 | endif # !art_dont_bother |