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 17LIBARTTEST_COMMON_SRC_FILES := \ 18 test/JniTest/jni_test.cc \ 19 test/ReferenceMap/stack_walk_refmap_jni.cc \ 20 test/StackWalk/stack_walk_jni.cc 21 22# $(1): target or host 23define build-libarttest 24 ifneq ($(1),target) 25 ifneq ($(1),host) 26 $$(error expected target or host for argument 1, received $(1)) 27 endif 28 endif 29 30 art_target_or_host := $(1) 31 32 include $(CLEAR_VARS) 33 ifeq ($$(art_target_or_host),target) 34 include external/stlport/libstlport.mk 35 endif 36 37 LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION) 38 LOCAL_MODULE := libarttest 39 ifeq ($$(art_target_or_host),target) 40 LOCAL_MODULE_TAGS := tests 41 endif 42 LOCAL_SRC_FILES := $(LIBARTTEST_COMMON_SRC_FILES) 43 LOCAL_SHARED_LIBRARIES += libartd 44 LOCAL_C_INCLUDES += $(ART_C_INCLUDES) art/runtime 45 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/build/Android.common.mk 46 LOCAL_ADDITIONAL_DEPENDENCIES += $(LOCAL_PATH)/build/Android.libarttest.mk 47 ifeq ($$(art_target_or_host),target) 48 LOCAL_CLANG := $(ART_TARGET_CLANG) 49 LOCAL_CFLAGS := $(ART_TARGET_CFLAGS) $(ART_TARGET_DEBUG_CFLAGS) 50 LOCAL_SHARED_LIBRARIES += libdl libcutils 51 LOCAL_STATIC_LIBRARIES := libgtest 52 LOCAL_MODULE_PATH := $(ART_TEST_OUT) 53 include $(BUILD_SHARED_LIBRARY) 54 else # host 55 LOCAL_CLANG := $(ART_HOST_CLANG) 56 LOCAL_CFLAGS := $(ART_HOST_CFLAGS) $(ART_HOST_DEBUG_CFLAGS) 57 LOCAL_STATIC_LIBRARIES := libcutils 58 LOCAL_LDLIBS := -ldl -lpthread 59 ifeq ($(HOST_OS),linux) 60 LOCAL_LDLIBS += -lrt 61 endif 62 include $(BUILD_HOST_SHARED_LIBRARY) 63 endif 64endef 65 66ifeq ($(ART_BUILD_TARGET),true) 67 $(eval $(call build-libarttest,target)) 68endif 69ifeq ($(WITH_HOST_DALVIK),true) 70 ifeq ($(ART_BUILD_HOST),true) 71 $(eval $(call build-libarttest,host)) 72 endif 73endif 74