build-art-target: $(ART_TARGET_EXECUTABLES) $(ART_TARGET_GTEST_EXECUTABLES) $(TARGET_CORE_IMG_OUT) $(TARGET_OUT_SHARED_LIBRARIES)/libjavacore.so
########################################################################
-# "m art-host" for just building the files needed to run the art script
+# "m art-host" for just building the files needed to run the art script on the host.
.PHONY: art-host
ifeq ($(HOST_PREFER_32_BIT),true)
art-host: $(HOST_OUT_EXECUTABLES)/art $(HOST_OUT)/bin/dalvikvm32 $(HOST_OUT)/lib/libart.so $(HOST_OUT)/bin/dex2oat $(HOST_OUT)/bin/patchoat $(HOST_CORE_IMG_OUT) $(HOST_OUT)/lib/libjavacore.so $(HOST_OUT)/bin/dalvikvm
art-host: $(HOST_OUT_EXECUTABLES)/art $(HOST_OUT)/bin/dalvikvm64 $(HOST_OUT)/bin/dalvikvm32 $(HOST_OUT)/lib/libart.so $(HOST_OUT)/bin/dex2oat $(HOST_OUT)/bin/patchoat $(HOST_CORE_IMG_OUT) $(HOST_OUT)/lib/libjavacore.so $(HOST_OUT)/lib64/libjavacore.so $(HOST_OUT)/bin/dalvikvm
endif
+# "m art-target" for just building the files needed to run the art script on the target.
+# Note that the script can run a dalvikvm executable that is not necessarily /system/bin/dalvikvm.
+.PHONY: art-target
+art-target: adb build-art-target art libnativehelper libjavacore
+
.PHONY: art-host-debug
art-host-debug: art-host $(HOST_OUT)/lib/libartd.so $(HOST_OUT)/bin/dex2oatd $(HOST_OUT)/bin/patchoatd
@echo "Copy: $(PRIVATE_MODULE) ($@)"
$(copy-file-to-new-target)
$(hide) chmod 755 $@
+
+# Copy the art shell script to the target's bin directory
+include $(CLEAR_VARS)
+LOCAL_MODULE_CLASS := EXECUTABLES
+LOCAL_MODULE := art
+include $(BUILD_SYSTEM)/base_rules.mk
+$(LOCAL_BUILT_MODULE): $(LOCAL_PATH)/art $(ACP)
+ @echo "Copy: $(PRIVATE_MODULE) ($@)"
+ $(copy-file-to-new-target)
+ $(hide) chmod 755 $@
# See the License for the specific language governing permissions and
# limitations under the License.
-lib=-XXlib:libart.so
-invoke_with=
-
-while true; do
- if [ "$1" = "--invoke-with" ]; then
- shift
- invoke_with="$1"
- shift
- elif [ "$1" = "-d" ]; then
- lib="-XXlib:libartd.so"
- shift
- elif expr "$1" : "--" >/dev/null 2>&1; then
- echo "unknown option: $1" 1>&2
- exit 1
+function follow_links() {
+ if [ z"$BASH_SOURCE" != z ]; then
+ file="$BASH_SOURCE"
else
- break
+ file="$0"
fi
-done
-
-function follow_links() {
- file="$1"
while [ -h "$file" ]; do
# On Mac OS, readlink -f doesn't work.
file="$(readlink "$file")"
echo "$file"
}
-PROG_NAME="$(follow_links "$BASH_SOURCE")"
-PROG_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
-ANDROID_BUILD_TOP="$(cd "${PROG_DIR}/../../../../" ; pwd -P)/"
-ANDROID_HOST_OUT=$PROG_DIR/..
-ANDROID_DATA=$PWD/android-data$$
-DALVIKVM_EXECUTABLE=$ANDROID_HOST_OUT/bin/dalvikvm
-
function find_libdir() {
if [ "$(readlink "$DALVIKVM_EXECUTABLE")" = "dalvikvm64" ]; then
echo "lib64"
fi
}
-LD_LIBRARY_PATH=$ANDROID_HOST_OUT/"$(find_libdir)"
+PROG_NAME="$(follow_links)"
+PROG_DIR="$(cd "${PROG_NAME%/*}" ; pwd -P)"
+ANDROID_ROOT=$PROG_DIR/..
+ANDROID_DATA=$PWD/android-data$$
+DALVIKVM_EXECUTABLE=$ANDROID_ROOT/bin/dalvikvm
+LIBDIR=$(find_libdir)
+LD_LIBRARY_PATH=$ANDROID_ROOT/$LIBDIR
+
+lib=-XXlib:$ANDROID_ROOT/$LIBDIR/libart.so
+invoke_with=
+
+while true; do
+ if [ "$1" = "--invoke-with" ]; then
+ shift
+ invoke_with="$1"
+ shift
+ elif [ "$1" = "-d" ]; then
+ lib="-XXlib:$LIBDIR/libartd.so"
+ shift
+ elif expr "$1" : "--" >/dev/null 2>&1; then
+ echo "unknown option: $1" 1>&2
+ exit 1
+ else
+ break
+ fi
+done
-mkdir -p $ANDROID_DATA/dalvik-cache/{x86,x86_64}
+mkdir -p $ANDROID_DATA/dalvik-cache/{arm,arm64,x86,x86_64}
ANDROID_DATA=$ANDROID_DATA \
- ANDROID_ROOT=$ANDROID_HOST_OUT \
+ ANDROID_ROOT=$ANDROID_ROOT \
LD_LIBRARY_PATH=$LD_LIBRARY_PATH \
$invoke_with $DALVIKVM_EXECUTABLE $lib \
- -Ximage:$ANDROID_HOST_OUT/framework/core.art \
+ -Ximage:$ANDROID_ROOT/framework/core.art \
"$@"
EXIT_STATUS=$?
rm -rf $ANDROID_DATA