Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 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 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 17 | LOCAL_PATH := $(call my-dir) |
Brian Carlstrom | 51c2467 | 2013-07-11 16:00:56 -0700 | [diff] [blame] | 18 | |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 19 | include art/build/Android.common_build.mk |
| 20 | |
| 21 | LIBARTTEST_COMMON_SRC_FILES := \ |
Andreas Gampe | 89df7bf | 2015-09-30 13:13:21 -0700 | [diff] [blame] | 22 | common/runtime_state.cc \ |
| 23 | common/stack_inspect.cc \ |
Andreas Gampe | 1c83cbc | 2014-07-22 18:52:29 -0700 | [diff] [blame] | 24 | 004-JniTest/jni_test.cc \ |
| 25 | 004-SignalTest/signaltest.cc \ |
| 26 | 004-ReferenceMap/stack_walk_refmap_jni.cc \ |
| 27 | 004-StackWalk/stack_walk_jni.cc \ |
Nicolas Geoffray | 4fcdc94 | 2014-07-22 10:48:00 +0100 | [diff] [blame] | 28 | 004-UnsafeTest/unsafe_test.cc \ |
Andreas Gampe | e806732 | 2015-09-08 17:42:59 -0700 | [diff] [blame] | 29 | 044-proxy/native_proxy.cc \ |
Narayan Kamath | a0b3451 | 2014-10-07 12:51:26 +0100 | [diff] [blame] | 30 | 051-thread/thread_test.cc \ |
Alex Light | 64ad14d | 2014-08-19 14:23:13 -0700 | [diff] [blame] | 31 | 117-nopatchoat/nopatchoat.cc \ |
Mathieu Chartier | db00eaf | 2015-08-31 17:10:05 -0700 | [diff] [blame] | 32 | 1337-gc-coverage/gc_coverage.cc \ |
Mathieu Chartier | fc7acf9 | 2016-01-13 16:20:26 -0800 | [diff] [blame] | 33 | 136-daemon-jni-shutdown/daemon_jni_shutdown.cc \ |
Andreas Gampe | 7381010 | 2015-04-22 18:57:06 -0700 | [diff] [blame] | 34 | 137-cfi/cfi.cc \ |
Andreas Gampe | 3f1dc56 | 2015-05-18 15:52:22 -0700 | [diff] [blame] | 35 | 139-register-natives/regnative.cc \ |
Mathieu Chartier | 598302a | 2015-09-23 14:52:39 -0700 | [diff] [blame] | 36 | 141-class-unload/jni_unload.cc \ |
Jeff Hao | 12c08f0 | 2016-05-13 14:46:28 -0700 | [diff] [blame] | 37 | 148-multithread-gc-annotations/gc_coverage.cc \ |
Sebastien Hertz | 7cde48c | 2015-01-20 16:06:43 +0100 | [diff] [blame] | 38 | 454-get-vreg/get_vreg_jni.cc \ |
Nicolas Geoffray | 915b9d0 | 2015-03-11 15:11:19 +0000 | [diff] [blame] | 39 | 457-regs/regs_jni.cc \ |
Nicolas Geoffray | d8126be | 2015-03-27 10:22:41 +0000 | [diff] [blame] | 40 | 461-get-reference-vreg/get_reference_vreg_jni.cc \ |
Nicolas Geoffray | 32c9ea5 | 2015-06-12 14:52:33 +0100 | [diff] [blame] | 41 | 466-get-live-vreg/get_live_vreg_jni.cc \ |
Nicolas Geoffray | eb0c7d8 | 2015-11-03 16:05:38 +0000 | [diff] [blame] | 42 | 497-inlining-and-class-loader/clear_dex_cache.cc \ |
Nicolas Geoffray | a42363f | 2015-12-17 14:57:09 +0000 | [diff] [blame] | 43 | 543-env-long-ref/env_long_ref.cc \ |
Nicolas Geoffray | b331feb | 2016-02-05 16:51:53 +0000 | [diff] [blame] | 44 | 566-polymorphic-inlining/polymorphic_inline.cc \ |
Calin Juravle | e5de54c | 2016-04-20 14:22:09 +0100 | [diff] [blame] | 45 | 570-checker-osr/osr.cc \ |
Mingyao Yang | 0b80b74 | 2016-04-28 16:23:01 -0700 | [diff] [blame] | 46 | 595-profile-saving/profile-saving.cc \ |
Nicolas Geoffray | ae093d6 | 2016-07-19 17:06:23 +0100 | [diff] [blame] | 47 | 597-deopt-new-string/deopt.cc |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 48 | |
| 49 | ART_TARGET_LIBARTTEST_$(ART_PHONY_TEST_TARGET_SUFFIX) += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so |
Mathieu Chartier | 031768a | 2015-08-27 10:25:02 -0700 | [diff] [blame] | 50 | ART_TARGET_LIBARTTEST_$(ART_PHONY_TEST_TARGET_SUFFIX) += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttestd.so |
Brian Carlstrom | 0e12bdc | 2014-05-14 17:44:28 -0700 | [diff] [blame] | 51 | ifdef TARGET_2ND_ARCH |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 52 | ART_TARGET_LIBARTTEST_$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so |
Mathieu Chartier | 031768a | 2015-08-27 10:25:02 -0700 | [diff] [blame] | 53 | ART_TARGET_LIBARTTEST_$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttestd.so |
Brian Carlstrom | 0e12bdc | 2014-05-14 17:44:28 -0700 | [diff] [blame] | 54 | endif |
| 55 | |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 56 | # $(1): target or host |
| 57 | define build-libarttest |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 58 | ifneq ($(1),target) |
| 59 | ifneq ($(1),host) |
| 60 | $$(error expected target or host for argument 1, received $(1)) |
| 61 | endif |
| 62 | endif |
Mathieu Chartier | de286fd | 2015-09-03 18:10:29 -0700 | [diff] [blame] | 63 | ifneq ($(2),debug) |
Mathieu Chartier | 031768a | 2015-08-27 10:25:02 -0700 | [diff] [blame] | 64 | ifneq ($(2),) |
| 65 | $$(error d or empty for argument 2, received $(2)) |
| 66 | endif |
Mathieu Chartier | de286fd | 2015-09-03 18:10:29 -0700 | [diff] [blame] | 67 | suffix := d |
| 68 | else |
| 69 | suffix := |
Mathieu Chartier | 031768a | 2015-08-27 10:25:02 -0700 | [diff] [blame] | 70 | endif |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 71 | |
| 72 | art_target_or_host := $(1) |
| 73 | |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 74 | include $(CLEAR_VARS) |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 75 | LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION) |
Mathieu Chartier | 031768a | 2015-08-27 10:25:02 -0700 | [diff] [blame] | 76 | LOCAL_MODULE := libarttest$$(suffix) |
Brian Carlstrom | 871599a | 2012-09-06 13:27:49 -0700 | [diff] [blame] | 77 | ifeq ($$(art_target_or_host),target) |
| 78 | LOCAL_MODULE_TAGS := tests |
| 79 | endif |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 80 | LOCAL_SRC_FILES := $(LIBARTTEST_COMMON_SRC_FILES) |
Mathieu Chartier | 4b1e0f4 | 2015-09-04 16:38:55 -0700 | [diff] [blame] | 81 | LOCAL_SHARED_LIBRARIES += libart$$(suffix) libbacktrace libnativehelper |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 82 | LOCAL_C_INCLUDES += $(ART_C_INCLUDES) art/runtime |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 83 | LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk |
| 84 | LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.libarttest.mk |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 85 | ifeq ($$(art_target_or_host),target) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 86 | $(call set-target-local-clang-vars) |
| 87 | $(call set-target-local-cflags-vars,debug) |
Ian Rogers | cf7f191 | 2014-10-22 22:06:39 -0700 | [diff] [blame] | 88 | LOCAL_SHARED_LIBRARIES += libdl |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 89 | LOCAL_MULTILIB := both |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 90 | LOCAL_MODULE_PATH_32 := $(ART_TARGET_TEST_OUT)/$(ART_TARGET_ARCH_32) |
| 91 | LOCAL_MODULE_PATH_64 := $(ART_TARGET_TEST_OUT)/$(ART_TARGET_ARCH_64) |
Colin Cross | dc781a1 | 2014-02-04 16:22:03 -0800 | [diff] [blame] | 92 | LOCAL_MODULE_TARGET_ARCH := $(ART_SUPPORTED_ARCH) |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 93 | include $(BUILD_SHARED_LIBRARY) |
| 94 | else # host |
Ian Rogers | cd5d042 | 2013-05-17 15:54:01 -0700 | [diff] [blame] | 95 | LOCAL_CLANG := $(ART_HOST_CLANG) |
Mathieu Chartier | ba17f45 | 2016-05-05 15:31:12 -0700 | [diff] [blame] | 96 | LOCAL_CFLAGS := $(ART_HOST_CFLAGS) |
| 97 | ifeq ($$(suffix),d) |
| 98 | LOCAL_CFLAGS += $(ART_HOST_DEBUG_CFLAGS) |
| 99 | else |
| 100 | LOCAL_CFLAGS += $(ART_HOST_NON_DEBUG_CFLAGS) |
| 101 | endif |
Roland Levillain | 12bd721 | 2015-06-04 17:50:27 +0100 | [diff] [blame] | 102 | LOCAL_ASFLAGS := $(ART_HOST_ASFLAGS) |
Ian Rogers | 6f3dbba | 2014-10-14 17:41:57 -0700 | [diff] [blame] | 103 | LOCAL_LDLIBS := $(ART_HOST_LDLIBS) -ldl -lpthread |
Ian Rogers | bd5ea6a | 2014-04-16 16:34:44 -0700 | [diff] [blame] | 104 | LOCAL_IS_HOST_MODULE := true |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 105 | LOCAL_MULTILIB := both |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 106 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 107 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 108 | |
| 109 | # Clear locally used variables. |
| 110 | art_target_or_host := |
Mathieu Chartier | 031768a | 2015-08-27 10:25:02 -0700 | [diff] [blame] | 111 | suffix := |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 112 | endef |
| 113 | |
Brian Carlstrom | 4b620ff | 2011-09-11 01:11:01 -0700 | [diff] [blame] | 114 | ifeq ($(ART_BUILD_TARGET),true) |
Mathieu Chartier | 031768a | 2015-08-27 10:25:02 -0700 | [diff] [blame] | 115 | $(eval $(call build-libarttest,target,)) |
Mathieu Chartier | de286fd | 2015-09-03 18:10:29 -0700 | [diff] [blame] | 116 | $(eval $(call build-libarttest,target,debug)) |
Brian Carlstrom | 4b620ff | 2011-09-11 01:11:01 -0700 | [diff] [blame] | 117 | endif |
Ian Rogers | c5f1773 | 2014-06-05 20:48:42 -0700 | [diff] [blame] | 118 | ifeq ($(ART_BUILD_HOST),true) |
Mathieu Chartier | 031768a | 2015-08-27 10:25:02 -0700 | [diff] [blame] | 119 | $(eval $(call build-libarttest,host,)) |
Mathieu Chartier | de286fd | 2015-09-03 18:10:29 -0700 | [diff] [blame] | 120 | $(eval $(call build-libarttest,host,debug)) |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 121 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 122 | |
| 123 | # Clear locally used variables. |
| 124 | LOCAL_PATH := |
| 125 | LIBARTTEST_COMMON_SRC_FILES := |