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 | 1c83cbc | 2014-07-22 18:52:29 -0700 | [diff] [blame] | 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 \ |
Nicolas Geoffray | 4fcdc94 | 2014-07-22 10:48:00 +0100 | [diff] [blame] | 26 | 004-UnsafeTest/unsafe_test.cc \ |
Alex Light | 9dcc457 | 2014-08-14 14:16:26 -0700 | [diff] [blame] | 27 | 116-nodex2oat/nodex2oat.cc \ |
Alex Light | 64ad14d | 2014-08-19 14:23:13 -0700 | [diff] [blame] | 28 | 117-nopatchoat/nopatchoat.cc \ |
| 29 | 118-noimage-dex2oat/noimage-dex2oat.cc |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 30 | |
| 31 | ART_TARGET_LIBARTTEST_$(ART_PHONY_TEST_TARGET_SUFFIX) += $(ART_TARGET_TEST_OUT)/$(TARGET_ARCH)/libarttest.so |
Brian Carlstrom | 0e12bdc | 2014-05-14 17:44:28 -0700 | [diff] [blame] | 32 | ifdef TARGET_2ND_ARCH |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 33 | ART_TARGET_LIBARTTEST_$(2ND_ART_PHONY_TEST_TARGET_SUFFIX) += $(ART_TARGET_TEST_OUT)/$(TARGET_2ND_ARCH)/libarttest.so |
Brian Carlstrom | 0e12bdc | 2014-05-14 17:44:28 -0700 | [diff] [blame] | 34 | endif |
| 35 | |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 36 | # $(1): target or host |
| 37 | define build-libarttest |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 38 | ifneq ($(1),target) |
| 39 | ifneq ($(1),host) |
| 40 | $$(error expected target or host for argument 1, received $(1)) |
| 41 | endif |
| 42 | endif |
| 43 | |
| 44 | art_target_or_host := $(1) |
| 45 | |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 46 | include $(CLEAR_VARS) |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 47 | LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION) |
| 48 | LOCAL_MODULE := libarttest |
Brian Carlstrom | 871599a | 2012-09-06 13:27:49 -0700 | [diff] [blame] | 49 | ifeq ($$(art_target_or_host),target) |
| 50 | LOCAL_MODULE_TAGS := tests |
| 51 | endif |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 52 | LOCAL_SRC_FILES := $(LIBARTTEST_COMMON_SRC_FILES) |
Elliott Hughes | 025218c | 2013-07-30 17:13:06 -0700 | [diff] [blame] | 53 | LOCAL_SHARED_LIBRARIES += libartd |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 54 | LOCAL_C_INCLUDES += $(ART_C_INCLUDES) art/runtime |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 55 | LOCAL_ADDITIONAL_DEPENDENCIES := art/build/Android.common_build.mk |
| 56 | LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/Android.libarttest.mk |
Dan Albert | 2a0e954 | 2014-05-21 14:55:02 -0700 | [diff] [blame] | 57 | include external/libcxx/libcxx.mk |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 58 | ifeq ($$(art_target_or_host),target) |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 59 | $(call set-target-local-clang-vars) |
| 60 | $(call set-target-local-cflags-vars,debug) |
Hiroshi Yamauchi | b373308 | 2013-08-12 17:28:49 -0700 | [diff] [blame] | 61 | LOCAL_SHARED_LIBRARIES += libdl libcutils |
Shih-wei Liao | 9407c60 | 2011-09-16 10:36:43 -0700 | [diff] [blame] | 62 | LOCAL_STATIC_LIBRARIES := libgtest |
Andreas Gampe | afbaa1a | 2014-03-25 18:09:32 -0700 | [diff] [blame] | 63 | LOCAL_MULTILIB := both |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 64 | 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 Cross | dc781a1 | 2014-02-04 16:22:03 -0800 | [diff] [blame] | 66 | LOCAL_MODULE_TARGET_ARCH := $(ART_SUPPORTED_ARCH) |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 67 | include $(BUILD_SHARED_LIBRARY) |
| 68 | else # host |
Ian Rogers | cd5d042 | 2013-05-17 15:54:01 -0700 | [diff] [blame] | 69 | LOCAL_CLANG := $(ART_HOST_CLANG) |
Brian Carlstrom | 8692721 | 2011-09-15 11:31:11 -0700 | [diff] [blame] | 70 | LOCAL_CFLAGS := $(ART_HOST_CFLAGS) $(ART_HOST_DEBUG_CFLAGS) |
Hiroshi Yamauchi | b373308 | 2013-08-12 17:28:49 -0700 | [diff] [blame] | 71 | LOCAL_STATIC_LIBRARIES := libcutils |
Dan Albert | 2a0e954 | 2014-05-21 14:55:02 -0700 | [diff] [blame] | 72 | LOCAL_LDLIBS += -ldl -lpthread |
Elliott Hughes | ad6c9c3 | 2012-01-19 17:39:12 -0800 | [diff] [blame] | 73 | ifeq ($(HOST_OS),linux) |
| 74 | LOCAL_LDLIBS += -lrt |
| 75 | endif |
Ian Rogers | bd5ea6a | 2014-04-16 16:34:44 -0700 | [diff] [blame] | 76 | LOCAL_IS_HOST_MODULE := true |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 77 | LOCAL_MULTILIB := both |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 78 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 79 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 80 | |
| 81 | # Clear locally used variables. |
| 82 | art_target_or_host := |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 83 | endef |
| 84 | |
Brian Carlstrom | 4b620ff | 2011-09-11 01:11:01 -0700 | [diff] [blame] | 85 | ifeq ($(ART_BUILD_TARGET),true) |
| 86 | $(eval $(call build-libarttest,target)) |
| 87 | endif |
Ian Rogers | c5f1773 | 2014-06-05 20:48:42 -0700 | [diff] [blame] | 88 | ifeq ($(ART_BUILD_HOST),true) |
| 89 | $(eval $(call build-libarttest,host)) |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 90 | endif |
Ian Rogers | afd9acc | 2014-06-17 08:21:54 -0700 | [diff] [blame] | 91 | |
| 92 | # Clear locally used variables. |
| 93 | LOCAL_PATH := |
| 94 | LIBARTTEST_COMMON_SRC_FILES := |