From 3347a7966413223fd7ba4aa80d5e5003f8e3ca15 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Thu, 1 May 2014 13:44:57 -0700 Subject: Add ability to run on host for x86/x86_64. Change-Id: I063cb71ce0f7247cefacaa653c7b87b7b3e72025 --- benchmarks/Android.mk | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'benchmarks') 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 -- cgit v1.1