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 | |
Brian Carlstrom | 51c2467 | 2013-07-11 16:00:56 -0700 | [diff] [blame] | 17 | LIBARTTEST_COMMON_SRC_FILES := \ |
Brian Carlstrom | ce88853 | 2013-10-10 00:32:58 -0700 | [diff] [blame] | 18 | test/JniTest/jni_test.cc \ |
Brian Carlstrom | 51c2467 | 2013-07-11 16:00:56 -0700 | [diff] [blame] | 19 | test/ReferenceMap/stack_walk_refmap_jni.cc \ |
Hiroshi Yamauchi | 4d2efce | 2014-02-10 16:19:09 -0800 | [diff] [blame] | 20 | test/StackWalk/stack_walk_jni.cc \ |
| 21 | test/UnsafeTest/unsafe_test.cc |
Brian Carlstrom | 51c2467 | 2013-07-11 16:00:56 -0700 | [diff] [blame] | 22 | |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 23 | # $(1): target or host |
| 24 | define build-libarttest |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 25 | 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 Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 33 | include $(CLEAR_VARS) |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 34 | ifeq ($$(art_target_or_host),target) |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 35 | include external/stlport/libstlport.mk |
| 36 | endif |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 37 | |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 38 | LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION) |
| 39 | LOCAL_MODULE := libarttest |
Brian Carlstrom | 871599a | 2012-09-06 13:27:49 -0700 | [diff] [blame] | 40 | ifeq ($$(art_target_or_host),target) |
| 41 | LOCAL_MODULE_TAGS := tests |
| 42 | endif |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 43 | LOCAL_SRC_FILES := $(LIBARTTEST_COMMON_SRC_FILES) |
Elliott Hughes | 025218c | 2013-07-30 17:13:06 -0700 | [diff] [blame] | 44 | LOCAL_SHARED_LIBRARIES += libartd |
Brian Carlstrom | 7940e44 | 2013-07-12 13:46:57 -0700 | [diff] [blame] | 45 | LOCAL_C_INCLUDES += $(ART_C_INCLUDES) art/runtime |
Brian Carlstrom | 51c2467 | 2013-07-11 16:00:56 -0700 | [diff] [blame] | 46 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/build/Android.common.mk |
| 47 | LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/build/Android.libarttest.mk |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 48 | ifeq ($$(art_target_or_host),target) |
Ian Rogers | cd5d042 | 2013-05-17 15:54:01 -0700 | [diff] [blame] | 49 | LOCAL_CLANG := $(ART_TARGET_CLANG) |
Brian Carlstrom | 8692721 | 2011-09-15 11:31:11 -0700 | [diff] [blame] | 50 | LOCAL_CFLAGS := $(ART_TARGET_CFLAGS) $(ART_TARGET_DEBUG_CFLAGS) |
Colin Cross | dc781a1 | 2014-02-04 16:22:03 -0800 | [diff] [blame] | 51 | LOCAL_CFLAGS_x86 := $(ART_TARGET_CFLAGS_x86) |
Hiroshi Yamauchi | b373308 | 2013-08-12 17:28:49 -0700 | [diff] [blame] | 52 | LOCAL_SHARED_LIBRARIES += libdl libcutils |
Shih-wei Liao | 9407c60 | 2011-09-16 10:36:43 -0700 | [diff] [blame] | 53 | LOCAL_STATIC_LIBRARIES := libgtest |
Brian Carlstrom | b9cc1ca | 2012-01-27 00:57:42 -0800 | [diff] [blame] | 54 | LOCAL_MODULE_PATH := $(ART_TEST_OUT) |
Colin Cross | dc781a1 | 2014-02-04 16:22:03 -0800 | [diff] [blame] | 55 | LOCAL_MODULE_TARGET_ARCH := $(ART_SUPPORTED_ARCH) |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 56 | include $(BUILD_SHARED_LIBRARY) |
| 57 | else # host |
Ian Rogers | cd5d042 | 2013-05-17 15:54:01 -0700 | [diff] [blame] | 58 | LOCAL_CLANG := $(ART_HOST_CLANG) |
Brian Carlstrom | 8692721 | 2011-09-15 11:31:11 -0700 | [diff] [blame] | 59 | LOCAL_CFLAGS := $(ART_HOST_CFLAGS) $(ART_HOST_DEBUG_CFLAGS) |
Hiroshi Yamauchi | b373308 | 2013-08-12 17:28:49 -0700 | [diff] [blame] | 60 | LOCAL_STATIC_LIBRARIES := libcutils |
Elliott Hughes | ad6c9c3 | 2012-01-19 17:39:12 -0800 | [diff] [blame] | 61 | LOCAL_LDLIBS := -ldl -lpthread |
| 62 | ifeq ($(HOST_OS),linux) |
| 63 | LOCAL_LDLIBS += -lrt |
| 64 | endif |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 65 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 66 | endif |
| 67 | endef |
| 68 | |
Brian Carlstrom | 4b620ff | 2011-09-11 01:11:01 -0700 | [diff] [blame] | 69 | ifeq ($(ART_BUILD_TARGET),true) |
| 70 | $(eval $(call build-libarttest,target)) |
| 71 | endif |
Brian Carlstrom | 19e776c | 2013-07-23 12:16:44 -0700 | [diff] [blame] | 72 | ifeq ($(WITH_HOST_DALVIK),true) |
| 73 | ifeq ($(ART_BUILD_HOST),true) |
| 74 | $(eval $(call build-libarttest,host)) |
| 75 | endif |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 76 | endif |