blob: 18d321a15441f45eb16d1c4df925d726d152213c [file] [log] [blame]
Brian Carlstrom07d579f2011-07-27 13:31:51 -07001#
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
Brian Carlstrom51c24672013-07-11 16:00:56 -070017LIBARTTEST_COMMON_SRC_FILES := \
Brian Carlstromce888532013-10-10 00:32:58 -070018 test/JniTest/jni_test.cc \
Brian Carlstrom51c24672013-07-11 16:00:56 -070019 test/ReferenceMap/stack_walk_refmap_jni.cc \
Hiroshi Yamauchi4d2efce2014-02-10 16:19:09 -080020 test/StackWalk/stack_walk_jni.cc \
21 test/UnsafeTest/unsafe_test.cc
Brian Carlstrom51c24672013-07-11 16:00:56 -070022
Brian Carlstrom07d579f2011-07-27 13:31:51 -070023# $(1): target or host
24define build-libarttest
Brian Carlstrom0796af02011-10-12 14:31:45 -070025 ifneq ($(1),target)
26 ifneq ($(1),host)
27 $$(error expected target or host for argument 1, received $(1))
28 endif
29 endif
30
31 art_target_or_host := $(1)
32
Brian Carlstrom07d579f2011-07-27 13:31:51 -070033 include $(CLEAR_VARS)
Brian Carlstrom07d579f2011-07-27 13:31:51 -070034 LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION)
35 LOCAL_MODULE := libarttest
Brian Carlstrom871599a2012-09-06 13:27:49 -070036 ifeq ($$(art_target_or_host),target)
37 LOCAL_MODULE_TAGS := tests
38 endif
Brian Carlstrom07d579f2011-07-27 13:31:51 -070039 LOCAL_SRC_FILES := $(LIBARTTEST_COMMON_SRC_FILES)
Elliott Hughes025218c2013-07-30 17:13:06 -070040 LOCAL_SHARED_LIBRARIES += libartd
Brian Carlstrom7940e442013-07-12 13:46:57 -070041 LOCAL_C_INCLUDES += $(ART_C_INCLUDES) art/runtime
Brian Carlstrom51c24672013-07-11 16:00:56 -070042 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/build/Android.common.mk
43 LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/build/Android.libarttest.mk
Brian Carlstrom0796af02011-10-12 14:31:45 -070044 ifeq ($$(art_target_or_host),target)
Ian Rogerscd5d0422013-05-17 15:54:01 -070045 LOCAL_CLANG := $(ART_TARGET_CLANG)
Brian Carlstrom86927212011-09-15 11:31:11 -070046 LOCAL_CFLAGS := $(ART_TARGET_CFLAGS) $(ART_TARGET_DEBUG_CFLAGS)
Colin Crossdc781a12014-02-04 16:22:03 -080047 LOCAL_CFLAGS_x86 := $(ART_TARGET_CFLAGS_x86)
Hiroshi Yamauchib3733082013-08-12 17:28:49 -070048 LOCAL_SHARED_LIBRARIES += libdl libcutils
Shih-wei Liao9407c602011-09-16 10:36:43 -070049 LOCAL_STATIC_LIBRARIES := libgtest
Andreas Gampeafbaa1a2014-03-25 18:09:32 -070050 LOCAL_MULTILIB := both
51 LOCAL_MODULE_PATH_32 := $(ART_BASE_TEST_OUT)
52 LOCAL_MODULE_PATH_64 := $(ART_BASE_TEST_OUT)64
Colin Crossdc781a12014-02-04 16:22:03 -080053 LOCAL_MODULE_TARGET_ARCH := $(ART_SUPPORTED_ARCH)
Ian Rogersbd5ea6a2014-04-16 16:34:44 -070054 include art/build/Android.libcxx.mk
Brian Carlstrom0796af02011-10-12 14:31:45 -070055 include $(BUILD_SHARED_LIBRARY)
56 else # host
Ian Rogerscd5d0422013-05-17 15:54:01 -070057 LOCAL_CLANG := $(ART_HOST_CLANG)
Brian Carlstrom86927212011-09-15 11:31:11 -070058 LOCAL_CFLAGS := $(ART_HOST_CFLAGS) $(ART_HOST_DEBUG_CFLAGS)
Hiroshi Yamauchib3733082013-08-12 17:28:49 -070059 LOCAL_STATIC_LIBRARIES := libcutils
Elliott Hughesad6c9c32012-01-19 17:39:12 -080060 LOCAL_LDLIBS := -ldl -lpthread
61 ifeq ($(HOST_OS),linux)
62 LOCAL_LDLIBS += -lrt
63 endif
Ian Rogersbd5ea6a2014-04-16 16:34:44 -070064 LOCAL_IS_HOST_MODULE := true
65 include art/build/Android.libcxx.mk
Brian Carlstrom07d579f2011-07-27 13:31:51 -070066 include $(BUILD_HOST_SHARED_LIBRARY)
67 endif
68endef
69
Brian Carlstrom4b620ff2011-09-11 01:11:01 -070070ifeq ($(ART_BUILD_TARGET),true)
71 $(eval $(call build-libarttest,target))
72endif
Brian Carlstrom19e776c2013-07-23 12:16:44 -070073ifeq ($(WITH_HOST_DALVIK),true)
74 ifeq ($(ART_BUILD_HOST),true)
75 $(eval $(call build-libarttest,host))
76 endif
Brian Carlstrom07d579f2011-07-27 13:31:51 -070077endif