blob: c9c04757ba9b70c3534bb55a38fdf0ee42dbada9 [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
Ian Rogersafd9acc2014-06-17 08:21:54 -070017LOCAL_PATH := $(call my-dir)
Brian Carlstrom51c24672013-07-11 16:00:56 -070018
Ian Rogersafd9acc2014-06-17 08:21:54 -070019include art/build/Android.common_build.mk
20
21LIBARTTEST_COMMON_SRC_FILES := \
Andreas Gampe1c83cbc2014-07-22 18:52:29 -070022 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 \
Nicolas Geoffray4fcdc942014-07-22 10:48:00 +010026 004-UnsafeTest/unsafe_test.cc \
Narayan Kamatha0b34512014-10-07 12:51:26 +010027 051-thread/thread_test.cc \
Alex Light9dcc4572014-08-14 14:16:26 -070028 116-nodex2oat/nodex2oat.cc \
Alex Light64ad14d2014-08-19 14:23:13 -070029 117-nopatchoat/nopatchoat.cc \
30 118-noimage-dex2oat/noimage-dex2oat.cc
Ian Rogersafd9acc2014-06-17 08:21:54 -070031
32ART_TARGET_LIBARTTEST_$(ART_PHONY_TEST_TARGET_SUFFIX) += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so
Brian Carlstrom0e12bdc2014-05-14 17:44:28 -070033ifdef TARGET_2ND_ARCH
Ian Rogersafd9acc2014-06-17 08:21:54 -070034 ART_TARGET_LIBARTTEST_$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so
Brian Carlstrom0e12bdc2014-05-14 17:44:28 -070035endif
36
Brian Carlstrom07d579f2011-07-27 13:31:51 -070037# $(1): target or host
38define build-libarttest
Brian Carlstrom0796af02011-10-12 14:31:45 -070039 ifneq ($(1),target)
40 ifneq ($(1),host)
41 $$(error expected target or host for argument 1, received $(1))
42 endif
43 endif
44
45 art_target_or_host := $(1)
46
Brian Carlstrom07d579f2011-07-27 13:31:51 -070047 include $(CLEAR_VARS)
Brian Carlstrom07d579f2011-07-27 13:31:51 -070048 LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION)
49 LOCAL_MODULE := libarttest
Brian Carlstrom871599a2012-09-06 13:27:49 -070050 ifeq ($$(art_target_or_host),target)
51 LOCAL_MODULE_TAGS := tests
52 endif
Brian Carlstrom07d579f2011-07-27 13:31:51 -070053 LOCAL_SRC_FILES := $(LIBARTTEST_COMMON_SRC_FILES)
Elliott Hughes025218c2013-07-30 17:13:06 -070054 LOCAL_SHARED_LIBRARIES += libartd
Brian Carlstrom7940e442013-07-12 13:46:57 -070055 LOCAL_C_INCLUDES += $(ART_C_INCLUDES) art/runtime
Ian Rogersafd9acc2014-06-17 08:21:54 -070056 LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk
57 LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.libarttest.mk
Dan Albert2a0e9542014-05-21 14:55:02 -070058 include external/libcxx/libcxx.mk
Brian Carlstrom0796af02011-10-12 14:31:45 -070059 ifeq ($$(art_target_or_host),target)
Ian Rogersafd9acc2014-06-17 08:21:54 -070060 $(call set-target-local-clang-vars)
61 $(call set-target-local-cflags-vars,debug)
Ian Rogerscf7f1912014-10-22 22:06:39 -070062 LOCAL_SHARED_LIBRARIES += libdl
Andreas Gampeafbaa1a2014-03-25 18:09:32 -070063 LOCAL_MULTILIB := both
Ian Rogersafd9acc2014-06-17 08:21:54 -070064 LOCAL_MODULE_PATH_32 := $(ART_TARGET_TEST_OUT)/$(ART_TARGET_ARCH_32)
65 LOCAL_MODULE_PATH_64 := $(ART_TARGET_TEST_OUT)/$(ART_TARGET_ARCH_64)
Colin Crossdc781a12014-02-04 16:22:03 -080066 LOCAL_MODULE_TARGET_ARCH := $(ART_SUPPORTED_ARCH)
Brian Carlstrom0796af02011-10-12 14:31:45 -070067 include $(BUILD_SHARED_LIBRARY)
68 else # host
Ian Rogerscd5d0422013-05-17 15:54:01 -070069 LOCAL_CLANG := $(ART_HOST_CLANG)
Brian Carlstrom86927212011-09-15 11:31:11 -070070 LOCAL_CFLAGS := $(ART_HOST_CFLAGS) $(ART_HOST_DEBUG_CFLAGS)
Ian Rogers6f3dbba2014-10-14 17:41:57 -070071 LOCAL_LDLIBS := $(ART_HOST_LDLIBS) -ldl -lpthread
Ian Rogersbd5ea6a2014-04-16 16:34:44 -070072 LOCAL_IS_HOST_MODULE := true
Ian Rogersafd9acc2014-06-17 08:21:54 -070073 LOCAL_MULTILIB := both
Brian Carlstrom07d579f2011-07-27 13:31:51 -070074 include $(BUILD_HOST_SHARED_LIBRARY)
75 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -070076
77 # Clear locally used variables.
78 art_target_or_host :=
Brian Carlstrom07d579f2011-07-27 13:31:51 -070079endef
80
Brian Carlstrom4b620ff2011-09-11 01:11:01 -070081ifeq ($(ART_BUILD_TARGET),true)
82 $(eval $(call build-libarttest,target))
83endif
Ian Rogersc5f17732014-06-05 20:48:42 -070084ifeq ($(ART_BUILD_HOST),true)
85 $(eval $(call build-libarttest,host))
Brian Carlstrom07d579f2011-07-27 13:31:51 -070086endif
Ian Rogersafd9acc2014-06-17 08:21:54 -070087
88# Clear locally used variables.
89LOCAL_PATH :=
90LIBARTTEST_COMMON_SRC_FILES :=