Mathieu Chartier | 563e984 | 2015-09-12 16:55:26 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2015 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 | |
| 17 | LOCAL_PATH := $(call my-dir) |
| 18 | |
| 19 | include art/build/Android.common_build.mk |
| 20 | |
| 21 | LIBARTBENCHMARK_COMMON_SRC_FILES := \ |
Mathieu Chartier | 14f8b13 | 2015-09-22 18:14:29 -0700 | [diff] [blame] | 22 | jobject-benchmark/jobject_benchmark.cc \ |
Mathieu Chartier | 563e984 | 2015-09-12 16:55:26 -0700 | [diff] [blame] | 23 | jni-perf/perf_jni.cc \ |
| 24 | scoped-primitive-array/scoped_primitive_array.cc |
| 25 | |
| 26 | # $(1): target or host |
| 27 | define build-libartbenchmark |
| 28 | ifneq ($(1),target) |
| 29 | ifneq ($(1),host) |
| 30 | $$(error expected target or host for argument 1, received $(1)) |
| 31 | endif |
| 32 | endif |
| 33 | |
| 34 | art_target_or_host := $(1) |
| 35 | |
| 36 | include $(CLEAR_VARS) |
| 37 | LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION) |
| 38 | LOCAL_MODULE := libartbenchmark |
| 39 | ifeq ($$(art_target_or_host),target) |
| 40 | LOCAL_MODULE_TAGS := tests |
| 41 | endif |
| 42 | LOCAL_SRC_FILES := $(LIBARTBENCHMARK_COMMON_SRC_FILES) |
| 43 | LOCAL_SHARED_LIBRARIES += libart libbacktrace libnativehelper |
| 44 | LOCAL_C_INCLUDES += $(ART_C_INCLUDES) art/runtime |
| 45 | LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk |
| 46 | LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.mk |
| 47 | ifeq ($$(art_target_or_host),target) |
Colin Cross | ecf75a6 | 2016-07-28 16:01:42 -0700 | [diff] [blame] | 48 | LOCAL_CLANG := $(ART_TARGET_CLANG) |
Mathieu Chartier | 563e984 | 2015-09-12 16:55:26 -0700 | [diff] [blame] | 49 | $(call set-target-local-cflags-vars,debug) |
| 50 | LOCAL_SHARED_LIBRARIES += libdl |
| 51 | LOCAL_MULTILIB := both |
| 52 | # LOCAL_MODULE_PATH_32 := $(ART_TARGET_OUT)/$(ART_TARGET_ARCH_32) |
| 53 | # LOCAL_MODULE_PATH_64 := $(ART_TARGET_OUT)/$(ART_TARGET_ARCH_64) |
| 54 | LOCAL_MODULE_TARGET_ARCH := $(ART_SUPPORTED_ARCH) |
| 55 | include $(BUILD_SHARED_LIBRARY) |
| 56 | else # host |
| 57 | LOCAL_CLANG := $(ART_HOST_CLANG) |
| 58 | LOCAL_CFLAGS := $(ART_HOST_CFLAGS) $(ART_HOST_DEBUG_CFLAGS) |
Roland Levillain | b5390f7 | 2016-07-04 16:59:53 +0100 | [diff] [blame] | 59 | LOCAL_ASFLAGS := $(ART_HOST_ASFLAGS) $(ART_HOST_DEBUG_ASFLAGS) |
Colin Cross | ecf75a6 | 2016-07-28 16:01:42 -0700 | [diff] [blame] | 60 | LOCAL_LDLIBS := -ldl -lpthread |
Mathieu Chartier | 563e984 | 2015-09-12 16:55:26 -0700 | [diff] [blame] | 61 | LOCAL_IS_HOST_MODULE := true |
| 62 | LOCAL_MULTILIB := both |
| 63 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 64 | endif |
| 65 | |
| 66 | # Clear locally used variables. |
| 67 | art_target_or_host := |
| 68 | endef |
| 69 | |
| 70 | ifeq ($(ART_BUILD_TARGET),true) |
| 71 | $(eval $(call build-libartbenchmark,target)) |
| 72 | endif |
| 73 | ifeq ($(ART_BUILD_HOST),true) |
| 74 | $(eval $(call build-libartbenchmark,host)) |
| 75 | endif |
| 76 | |
| 77 | # Clear locally used variables. |
| 78 | LOCAL_PATH := |
| 79 | LIBARTBENCHMARK_COMMON_SRC_FILES := |