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 | |
| 17 | # $(1): target or host |
| 18 | define build-libarttest |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 19 | ifneq ($(1),target) |
| 20 | ifneq ($(1),host) |
| 21 | $$(error expected target or host for argument 1, received $(1)) |
| 22 | endif |
| 23 | endif |
| 24 | |
| 25 | art_target_or_host := $(1) |
| 26 | |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 27 | include $(CLEAR_VARS) |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 28 | ifeq ($$(art_target_or_host),target) |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 29 | include external/stlport/libstlport.mk |
| 30 | endif |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 31 | |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 32 | LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION) |
| 33 | LOCAL_MODULE := libarttest |
| 34 | LOCAL_MODULE_TAGS := tests |
| 35 | LOCAL_SRC_FILES := $(LIBARTTEST_COMMON_SRC_FILES) |
Shih-wei Liao | 9407c60 | 2011-09-16 10:36:43 -0700 | [diff] [blame] | 36 | LOCAL_SHARED_LIBRARIES := libartd |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 37 | LOCAL_C_INCLUDES += $(ART_C_INCLUDES) |
| 38 | ifeq ($$(art_target_or_host),target) |
Brian Carlstrom | 8692721 | 2011-09-15 11:31:11 -0700 | [diff] [blame] | 39 | LOCAL_CFLAGS := $(ART_TARGET_CFLAGS) $(ART_TARGET_DEBUG_CFLAGS) |
Elliott Hughes | 06e3ad4 | 2012-02-07 14:51:57 -0800 | [diff] [blame] | 40 | LOCAL_SHARED_LIBRARIES += libdl libstlport libdynamic_annotations |
Shih-wei Liao | 9407c60 | 2011-09-16 10:36:43 -0700 | [diff] [blame] | 41 | LOCAL_STATIC_LIBRARIES := libgtest |
Brian Carlstrom | b9cc1ca | 2012-01-27 00:57:42 -0800 | [diff] [blame] | 42 | LOCAL_MODULE_PATH := $(ART_TEST_OUT) |
Brian Carlstrom | 0796af0 | 2011-10-12 14:31:45 -0700 | [diff] [blame] | 43 | include $(BUILD_SHARED_LIBRARY) |
| 44 | else # host |
Brian Carlstrom | 8692721 | 2011-09-15 11:31:11 -0700 | [diff] [blame] | 45 | LOCAL_CFLAGS := $(ART_HOST_CFLAGS) $(ART_HOST_DEBUG_CFLAGS) |
Elliott Hughes | 06e3ad4 | 2012-02-07 14:51:57 -0800 | [diff] [blame] | 46 | LOCAL_SHARED_LIBRARIES += libdynamic_annotations-host |
Elliott Hughes | ad6c9c3 | 2012-01-19 17:39:12 -0800 | [diff] [blame] | 47 | LOCAL_LDLIBS := -ldl -lpthread |
| 48 | ifeq ($(HOST_OS),linux) |
| 49 | LOCAL_LDLIBS += -lrt |
| 50 | endif |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 51 | include $(BUILD_HOST_SHARED_LIBRARY) |
| 52 | endif |
| 53 | endef |
| 54 | |
Brian Carlstrom | 4b620ff | 2011-09-11 01:11:01 -0700 | [diff] [blame] | 55 | ifeq ($(ART_BUILD_TARGET),true) |
| 56 | $(eval $(call build-libarttest,target)) |
| 57 | endif |
| 58 | ifeq ($(ART_BUILD_HOST),true) |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 59 | $(eval $(call build-libarttest,host)) |
| 60 | endif |