blob: a4a603ad04506aa2cced4a44527f611809fee2f9 [file] [log] [blame]
Mathieu Chartier563e9842015-09-12 16:55:26 -07001#
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
17LOCAL_PATH := $(call my-dir)
18
19include art/build/Android.common_build.mk
20
21LIBARTBENCHMARK_COMMON_SRC_FILES := \
Mathieu Chartier14f8b132015-09-22 18:14:29 -070022 jobject-benchmark/jobject_benchmark.cc \
Mathieu Chartier563e9842015-09-12 16:55:26 -070023 jni-perf/perf_jni.cc \
24 scoped-primitive-array/scoped_primitive_array.cc
25
26# $(1): target or host
27define 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)
48 $(call set-target-local-clang-vars)
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)
59 LOCAL_ASFLAGS := $(ART_HOST_ASFLAGS)
60 LOCAL_LDLIBS := $(ART_HOST_LDLIBS) -ldl -lpthread
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 :=
68endef
69
70ifeq ($(ART_BUILD_TARGET),true)
71 $(eval $(call build-libartbenchmark,target))
72endif
73ifeq ($(ART_BUILD_HOST),true)
74 $(eval $(call build-libartbenchmark,host))
75endif
76
77# Clear locally used variables.
78LOCAL_PATH :=
79LIBARTBENCHMARK_COMMON_SRC_FILES :=