blob: 7f05a043d84a904bb3124b63499504aac8d6a23f [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 \
Andreas Gampee8067322015-09-08 17:42:59 -070027 044-proxy/native_proxy.cc \
Narayan Kamatha0b34512014-10-07 12:51:26 +010028 051-thread/thread_test.cc \
Andreas Gampea727e372015-08-25 09:22:37 -070029 088-monitor-verification/stack_inspect.cc \
Alex Light9dcc4572014-08-14 14:16:26 -070030 116-nodex2oat/nodex2oat.cc \
Alex Light64ad14d2014-08-19 14:23:13 -070031 117-nopatchoat/nopatchoat.cc \
Sebastien Hertz7cde48c2015-01-20 16:06:43 +010032 118-noimage-dex2oat/noimage-dex2oat.cc \
Mathieu Chartierdb00eaf2015-08-31 17:10:05 -070033 1337-gc-coverage/gc_coverage.cc \
Andreas Gampe73810102015-04-22 18:57:06 -070034 137-cfi/cfi.cc \
Andreas Gampe3f1dc562015-05-18 15:52:22 -070035 139-register-natives/regnative.cc \
Sebastien Hertz7cde48c2015-01-20 16:06:43 +010036 454-get-vreg/get_vreg_jni.cc \
Nicolas Geoffraye0fe7ae2015-03-09 10:02:49 +000037 455-set-vreg/set_vreg_jni.cc \
Nicolas Geoffray915b9d02015-03-11 15:11:19 +000038 457-regs/regs_jni.cc \
Nicolas Geoffrayd8126be2015-03-27 10:22:41 +000039 461-get-reference-vreg/get_reference_vreg_jni.cc \
Nicolas Geoffray32c9ea52015-06-12 14:52:33 +010040 466-get-live-vreg/get_live_vreg_jni.cc \
Mathieu Chartier563e9842015-09-12 16:55:26 -070041 497-inlining-and-class-loader/clear_dex_cache.cc
Ian Rogersafd9acc2014-06-17 08:21:54 -070042
43ART_TARGET_LIBARTTEST_$(ART_PHONY_TEST_TARGET_SUFFIX) += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so
Mathieu Chartier031768a2015-08-27 10:25:02 -070044ART_TARGET_LIBARTTEST_$(ART_PHONY_TEST_TARGET_SUFFIX) += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttestd.so
Brian Carlstrom0e12bdc2014-05-14 17:44:28 -070045ifdef TARGET_2ND_ARCH
Ian Rogersafd9acc2014-06-17 08:21:54 -070046 ART_TARGET_LIBARTTEST_$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so
Mathieu Chartier031768a2015-08-27 10:25:02 -070047 ART_TARGET_LIBARTTEST_$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttestd.so
Brian Carlstrom0e12bdc2014-05-14 17:44:28 -070048endif
49
Brian Carlstrom07d579f2011-07-27 13:31:51 -070050# $(1): target or host
51define build-libarttest
Brian Carlstrom0796af02011-10-12 14:31:45 -070052 ifneq ($(1),target)
53 ifneq ($(1),host)
54 $$(error expected target or host for argument 1, received $(1))
55 endif
56 endif
Mathieu Chartierde286fd2015-09-03 18:10:29 -070057 ifneq ($(2),debug)
Mathieu Chartier031768a2015-08-27 10:25:02 -070058 ifneq ($(2),)
59 $$(error d or empty for argument 2, received $(2))
60 endif
Mathieu Chartierde286fd2015-09-03 18:10:29 -070061 suffix := d
62 else
63 suffix :=
Mathieu Chartier031768a2015-08-27 10:25:02 -070064 endif
Brian Carlstrom0796af02011-10-12 14:31:45 -070065
66 art_target_or_host := $(1)
67
Brian Carlstrom07d579f2011-07-27 13:31:51 -070068 include $(CLEAR_VARS)
Brian Carlstrom07d579f2011-07-27 13:31:51 -070069 LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION)
Mathieu Chartier031768a2015-08-27 10:25:02 -070070 LOCAL_MODULE := libarttest$$(suffix)
Brian Carlstrom871599a2012-09-06 13:27:49 -070071 ifeq ($$(art_target_or_host),target)
72 LOCAL_MODULE_TAGS := tests
73 endif
Brian Carlstrom07d579f2011-07-27 13:31:51 -070074 LOCAL_SRC_FILES := $(LIBARTTEST_COMMON_SRC_FILES)
Mathieu Chartier4b1e0f42015-09-04 16:38:55 -070075 LOCAL_SHARED_LIBRARIES += libart$$(suffix) libbacktrace libnativehelper
Brian Carlstrom7940e442013-07-12 13:46:57 -070076 LOCAL_C_INCLUDES += $(ART_C_INCLUDES) art/runtime
Ian Rogersafd9acc2014-06-17 08:21:54 -070077 LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk
78 LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.libarttest.mk
Brian Carlstrom0796af02011-10-12 14:31:45 -070079 ifeq ($$(art_target_or_host),target)
Ian Rogersafd9acc2014-06-17 08:21:54 -070080 $(call set-target-local-clang-vars)
81 $(call set-target-local-cflags-vars,debug)
Ian Rogerscf7f1912014-10-22 22:06:39 -070082 LOCAL_SHARED_LIBRARIES += libdl
Andreas Gampeafbaa1a2014-03-25 18:09:32 -070083 LOCAL_MULTILIB := both
Ian Rogersafd9acc2014-06-17 08:21:54 -070084 LOCAL_MODULE_PATH_32 := $(ART_TARGET_TEST_OUT)/$(ART_TARGET_ARCH_32)
85 LOCAL_MODULE_PATH_64 := $(ART_TARGET_TEST_OUT)/$(ART_TARGET_ARCH_64)
Colin Crossdc781a12014-02-04 16:22:03 -080086 LOCAL_MODULE_TARGET_ARCH := $(ART_SUPPORTED_ARCH)
Brian Carlstrom0796af02011-10-12 14:31:45 -070087 include $(BUILD_SHARED_LIBRARY)
88 else # host
Ian Rogerscd5d0422013-05-17 15:54:01 -070089 LOCAL_CLANG := $(ART_HOST_CLANG)
Brian Carlstrom86927212011-09-15 11:31:11 -070090 LOCAL_CFLAGS := $(ART_HOST_CFLAGS) $(ART_HOST_DEBUG_CFLAGS)
Roland Levillain12bd7212015-06-04 17:50:27 +010091 LOCAL_ASFLAGS := $(ART_HOST_ASFLAGS)
Ian Rogers6f3dbba2014-10-14 17:41:57 -070092 LOCAL_LDLIBS := $(ART_HOST_LDLIBS) -ldl -lpthread
Ian Rogersbd5ea6a2014-04-16 16:34:44 -070093 LOCAL_IS_HOST_MODULE := true
Ian Rogersafd9acc2014-06-17 08:21:54 -070094 LOCAL_MULTILIB := both
Brian Carlstrom07d579f2011-07-27 13:31:51 -070095 include $(BUILD_HOST_SHARED_LIBRARY)
96 endif
Ian Rogersafd9acc2014-06-17 08:21:54 -070097
98 # Clear locally used variables.
99 art_target_or_host :=
Mathieu Chartier031768a2015-08-27 10:25:02 -0700100 suffix :=
Brian Carlstrom07d579f2011-07-27 13:31:51 -0700101endef
102
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700103ifeq ($(ART_BUILD_TARGET),true)
Mathieu Chartier031768a2015-08-27 10:25:02 -0700104 $(eval $(call build-libarttest,target,))
Mathieu Chartierde286fd2015-09-03 18:10:29 -0700105 $(eval $(call build-libarttest,target,debug))
Brian Carlstrom4b620ff2011-09-11 01:11:01 -0700106endif
Ian Rogersc5f17732014-06-05 20:48:42 -0700107ifeq ($(ART_BUILD_HOST),true)
Mathieu Chartier031768a2015-08-27 10:25:02 -0700108 $(eval $(call build-libarttest,host,))
Mathieu Chartierde286fd2015-09-03 18:10:29 -0700109 $(eval $(call build-libarttest,host,debug))
Brian Carlstrom07d579f2011-07-27 13:31:51 -0700110endif
Ian Rogersafd9acc2014-06-17 08:21:54 -0700111
112# Clear locally used variables.
113LOCAL_PATH :=
114LIBARTTEST_COMMON_SRC_FILES :=