]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/platform-bionic.git/blob - benchmarks/Android.mk
support _POSIX_REALTIME_SIGNALS
[android-sdk/platform-bionic.git] / benchmarks / Android.mk
1 #
2 # Copyright (C) 2013 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 #
17 ifneq ($(BUILD_TINY_ANDROID), true)
19 LOCAL_PATH := $(call my-dir)
21 # -----------------------------------------------------------------------------
22 # Benchmarks.
23 # -----------------------------------------------------------------------------
25 benchmark_c_flags = \
26     -O2 \
27     -Wall -Wextra -Wunused \
28     -Werror \
29     -fno-builtin \
30     -std=gnu++11 \
32 benchmark_src_files = \
33     benchmark_main.cpp \
34     math_benchmark.cpp \
35     property_benchmark.cpp \
36     pthread_benchmark.cpp \
37     semaphore_benchmark.cpp \
38     stdio_benchmark.cpp \
39     string_benchmark.cpp \
40     time_benchmark.cpp \
41     unistd_benchmark.cpp \
43 # Build benchmarks for the device (with bionic's .so). Run with:
44 #   adb shell bionic-benchmarks
45 include $(CLEAR_VARS)
46 LOCAL_MODULE := bionic-benchmarks
47 LOCAL_MODULE_STEM_32 := bionic-benchmarks32
48 LOCAL_MODULE_STEM_64 := bionic-benchmarks64
49 LOCAL_MULTILIB := both
50 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
51 LOCAL_CFLAGS += $(benchmark_c_flags)
52 LOCAL_SRC_FILES := $(benchmark_src_files)
53 LOCAL_CXX_STL := libc++
54 include $(BUILD_EXECUTABLE)
56 ifeq ($(HOST_OS)-$(HOST_ARCH),$(filter $(HOST_OS)-$(HOST_ARCH),linux-x86 linux-x86_64))
57 ifeq ($(TARGET_ARCH),x86)
58 LINKER = linker
59 NATIVE_SUFFIX=32
60 else
61 LINKER = linker64
62 NATIVE_SUFFIX=64
63 endif
65 bionic-benchmarks-run-on-host: bionic-benchmarks $(TARGET_OUT_EXECUTABLES)/$(LINKER) $(TARGET_OUT_EXECUTABLES)/sh
66         if [ ! -d /system -o ! -d /system/bin ]; then \
67           echo "Attempting to create /system/bin"; \
68           sudo mkdir -p -m 0777 /system/bin; \
69         fi
70         mkdir -p $(TARGET_OUT_DATA)/local/tmp
71         cp $(TARGET_OUT_EXECUTABLES)/$(LINKER) /system/bin
72         cp $(TARGET_OUT_EXECUTABLES)/sh /system/bin
73         ANDROID_DATA=$(TARGET_OUT_DATA) \
74         ANDROID_ROOT=$(TARGET_OUT) \
75         LD_LIBRARY_PATH=$(TARGET_OUT_SHARED_LIBRARIES) \
76                 $(TARGET_OUT_EXECUTABLES)/bionic-benchmarks$(NATIVE_SUFFIX) $(BIONIC_BENCHMARKS_FLAGS)
77 endif # linux-x86
79 endif # !BUILD_TINY_ANDROID