• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Copyright (C) 2011 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
21LIBARTTEST_COMMON_SRC_FILES := \
22  004-JniTest/jni_test.cc \
23  004-SignalTest/signaltest.cc \
24  004-ReferenceMap/stack_walk_refmap_jni.cc \
25  004-StackWalk/stack_walk_jni.cc \
26  004-UnsafeTest/unsafe_test.cc \
27  044-proxy/native_proxy.cc \
28  051-thread/thread_test.cc \
29  116-nodex2oat/nodex2oat.cc \
30  117-nopatchoat/nopatchoat.cc \
31  118-noimage-dex2oat/noimage-dex2oat.cc \
32  137-cfi/cfi.cc \
33  139-register-natives/regnative.cc \
34  454-get-vreg/get_vreg_jni.cc \
35  455-set-vreg/set_vreg_jni.cc \
36  457-regs/regs_jni.cc \
37  461-get-reference-vreg/get_reference_vreg_jni.cc \
38  466-get-live-vreg/get_live_vreg_jni.cc
39
40ART_TARGET_LIBARTTEST_$(ART_PHONY_TEST_TARGET_SUFFIX) += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so
41ifdef TARGET_2ND_ARCH
42  ART_TARGET_LIBARTTEST_$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so
43endif
44
45# $(1): target or host
46define build-libarttest
47  ifneq ($(1),target)
48    ifneq ($(1),host)
49      $$(error expected target or host for argument 1, received $(1))
50    endif
51  endif
52
53  art_target_or_host := $(1)
54
55  include $(CLEAR_VARS)
56  LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION)
57  LOCAL_MODULE := libarttest
58  ifeq ($$(art_target_or_host),target)
59    LOCAL_MODULE_TAGS := tests
60  endif
61  LOCAL_SRC_FILES := $(LIBARTTEST_COMMON_SRC_FILES)
62  LOCAL_SHARED_LIBRARIES += libartd libbacktrace
63  LOCAL_C_INCLUDES += $(ART_C_INCLUDES) art/runtime
64  LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk
65  LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.libarttest.mk
66  ifeq ($$(art_target_or_host),target)
67    $(call set-target-local-clang-vars)
68    $(call set-target-local-cflags-vars,debug)
69    LOCAL_SHARED_LIBRARIES += libdl
70    LOCAL_MULTILIB := both
71    LOCAL_MODULE_PATH_32 := $(ART_TARGET_TEST_OUT)/$(ART_TARGET_ARCH_32)
72    LOCAL_MODULE_PATH_64 := $(ART_TARGET_TEST_OUT)/$(ART_TARGET_ARCH_64)
73    LOCAL_MODULE_TARGET_ARCH := $(ART_SUPPORTED_ARCH)
74    include $(BUILD_SHARED_LIBRARY)
75  else # host
76    LOCAL_CLANG := $(ART_HOST_CLANG)
77    LOCAL_CFLAGS := $(ART_HOST_CFLAGS) $(ART_HOST_DEBUG_CFLAGS)
78    LOCAL_LDLIBS := $(ART_HOST_LDLIBS) -ldl -lpthread
79    LOCAL_IS_HOST_MODULE := true
80    LOCAL_MULTILIB := both
81    include $(BUILD_HOST_SHARED_LIBRARY)
82  endif
83
84  # Clear locally used variables.
85  art_target_or_host :=
86endef
87
88ifeq ($(ART_BUILD_TARGET),true)
89  $(eval $(call build-libarttest,target))
90endif
91ifeq ($(ART_BUILD_HOST),true)
92  $(eval $(call build-libarttest,host))
93endif
94
95# Clear locally used variables.
96LOCAL_PATH :=
97LIBARTTEST_COMMON_SRC_FILES :=
98