summaryrefslogtreecommitdiffstats
path: root/benchmarks
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2014-05-01 13:44:57 -0700
committerChristopher Ferris <cferris@google.com>2014-05-01 13:44:57 -0700
commit3347a7966413223fd7ba4aa80d5e5003f8e3ca15 (patch)
tree2b42f433e251aca5bbee36bb0d2007efff050bc2 /benchmarks
parentde54b90ed573fdea390f8a06618374adbb32f18a (diff)
downloadbionic-3347a7966413223fd7ba4aa80d5e5003f8e3ca15.zip
bionic-3347a7966413223fd7ba4aa80d5e5003f8e3ca15.tar.gz
bionic-3347a7966413223fd7ba4aa80d5e5003f8e3ca15.tar.bz2
Add ability to run on host for x86/x86_64.
Change-Id: I063cb71ce0f7247cefacaa653c7b87b7b3e72025
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/Android.mk23
1 files changed, 23 insertions, 0 deletions
diff --git a/benchmarks/Android.mk b/benchmarks/Android.mk
index 25e2ed9..cf3d692 100644
--- a/benchmarks/Android.mk
+++ b/benchmarks/Android.mk
@@ -54,4 +54,27 @@ LOCAL_SHARED_LIBRARIES += libstlport
LOCAL_SRC_FILES := $(benchmark_src_files)
include $(BUILD_EXECUTABLE)
+ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86)
+ifeq ($(TARGET_ARCH),x86)
+LINKER = linker
+NATIVE_SUFFIX=32
+else
+LINKER = linker64
+NATIVE_SUFFIX=64
+endif
+
+bionic-benchmarks-run-on-host: bionic-benchmarks $(TARGET_OUT_EXECUTABLES)/$(LINKER) $(TARGET_OUT_EXECUTABLES)/sh
+ if [ ! -d /system -o ! -d /system/bin ]; then \
+ echo "Attempting to create /system/bin"; \
+ sudo mkdir -p -m 0777 /system/bin; \
+ fi
+ mkdir -p $(TARGET_OUT_DATA)/local/tmp
+ cp $(TARGET_OUT_EXECUTABLES)/$(LINKER) /system/bin
+ cp $(TARGET_OUT_EXECUTABLES)/sh /system/bin
+ ANDROID_DATA=$(TARGET_OUT_DATA) \
+ ANDROID_ROOT=$(TARGET_OUT) \
+ LD_LIBRARY_PATH=$(TARGET_OUT_SHARED_LIBRARIES) \
+ $(TARGET_OUT_EXECUTABLES)/bionic-benchmarks$(NATIVE_SUFFIX) $(BIONIC_BENCHMARKS_FLAGS)
+endif # linux-x86
+
endif # !BUILD_TINY_ANDROID