blob: e9661932124b3e09322a840d50cfed8c3b079056 [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)
18include $(CLEAR_VARS)
19
Carl Shapiro0e6d1972011-07-06 19:17:39 -070020build_path := $(LOCAL_PATH)/build
Brian Carlstromcdc8de42011-07-19 14:23:17 -070021include $(build_path)/Android.common.mk
22
Carl Shapiro0e6d1972011-07-06 19:17:39 -070023include $(build_path)/Android.libart.mk
Carl Shapiro0e6d1972011-07-06 19:17:39 -070024include $(build_path)/Android.aexec.mk
Carl Shapiro7b216702011-06-17 15:09:26 -070025
Brian Carlstrom07d579f2011-07-27 13:31:51 -070026include $(build_path)/Android.libarttest.mk
27include $(build_path)/Android.test.mk
Brian Carlstrom934486c2011-07-12 23:42:50 -070028
29# "m build-art" for quick minimal build
30.PHONY: build-art
31build-art: \
32 $(TARGET_OUT_EXECUTABLES)/aexec \
Brian Carlstrom8ecd08c2011-07-27 17:50:51 -070033 $(ART_TARGET_TEST_EXECUTABLES) \
Brian Carlstrom934486c2011-07-12 23:42:50 -070034 $(HOST_OUT_EXECUTABLES)/aexec \
Brian Carlstrom8ecd08c2011-07-27 17:50:51 -070035 $(ART_HOST_TEST_EXECUTABLES) \
Brian Carlstrom934486c2011-07-12 23:42:50 -070036#
37
Brian Carlstrom4a96b602011-07-26 16:40:23 -070038# "mm test-art" to build and run all tests on host and device
39.PHONY: test-art
40test-art: test-art-host test-art-target
41
Elliott Hughes2cae5a22011-08-14 14:27:25 -070042define run-host-tests-with
43 $(foreach file,$(ART_HOST_TEST_EXECUTABLES),$(1) $(file) &&) true
44endef
45
Brian Carlstrom934486c2011-07-12 23:42:50 -070046# "mm test-art-host" to build and run all host tests
47.PHONY: test-art-host
Brian Carlstromb0460ea2011-07-29 10:08:05 -070048test-art-host: $(ART_HOST_TEST_EXECUTABLES) $(ANDROID_HOST_OUT)/framework/core-hostdex.jar
Elliott Hughes2cae5a22011-08-14 14:27:25 -070049 $(call run-host-tests-with,)
Brian Carlstrom59848da2011-07-23 20:35:19 -070050
Elliott Hughes5511f212011-08-12 18:07:45 -070051# "mm valgrind-art-host" to build and run all host tests under valgrind.
52.PHONY: valgrind-art-host
53valgrind-art-host: $(ART_HOST_TEST_EXECUTABLES) $(ANDROID_HOST_OUT)/framework/core-hostdex.jar
Elliott Hughes2cae5a22011-08-14 14:27:25 -070054 $(call run-host-tests-with,"valgrind")
55
56# "mm tsan-art-host" to build and run all host tests under tsan.
57.PHONY: tsan-art-host
58tsan-art-host: $(ART_HOST_TEST_EXECUTABLES) $(ANDROID_HOST_OUT)/framework/core-hostdex.jar
59 $(call run-host-tests-with,"tsan")
Elliott Hughes5511f212011-08-12 18:07:45 -070060
Brian Carlstrom4a96b602011-07-26 16:40:23 -070061# "mm test-art-device" to build and run all target tests
62.PHONY: test-art-target
Brian Carlstromb0460ea2011-07-29 10:08:05 -070063test-art-target: $(ART_TARGET_TEST_EXECUTABLES) $(ANDROID_PRODUCT_OUT)/system/framework/core.jar
Brian Carlstrom4a96b602011-07-26 16:40:23 -070064 adb remount
65 adb sync
66 adb shell touch /sdcard/test-art-target
67 adb shell rm /sdcard/test-art-target
Brian Carlstrom8ecd08c2011-07-27 17:50:51 -070068 adb shell sh -c "$(foreach file,$(ART_TARGET_TEST_EXECUTABLES), /system/bin/$(notdir $(file)) &&) touch /sdcard/test-art-target"
Brian Carlstrom4a96b602011-07-26 16:40:23 -070069 adb pull /sdcard/test-art-target /tmp/
70 rm /tmp/test-art-target
71
72
Brian Carlstrom59848da2011-07-23 20:35:19 -070073# "mm cpplint-art" to style check art source files
74.PHONY: cpplint-art
75cpplint-art:
76 $(LOCAL_PATH)/tools/cpplint.py $(LOCAL_PATH)/src/*.h $(LOCAL_PATH)/src/*.cc