Carl Shapiro | 008e412 | 2011-06-23 17:27:46 -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 | 8ecd08c | 2011-07-27 17:50:51 -0700 | [diff] [blame^] | 17 | ART_HOST_TEST_EXECUTABLES := |
| 18 | ART_TARGET_TEST_EXECUTABLES := |
| 19 | |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 20 | # $(1): target or host |
| 21 | # $(2): file name with .cc or .cc.arm extension |
| 22 | define build-art-test |
| 23 | include $(CLEAR_VARS) |
| 24 | ifeq ($(1),target) |
| 25 | include external/stlport/libstlport.mk |
| 26 | endif |
| 27 | LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION) |
| 28 | LOCAL_MODULE := $(notdir $(basename $(2:%.arm=%))) |
| 29 | LOCAL_MODULE_TAGS := tests |
| 30 | LOCAL_SRC_FILES := $(2) |
| 31 | LOCAL_CFLAGS := $(ART_CFLAGS) |
| 32 | LOCAL_C_INCLUDES += external/gtest/include |
Brian Carlstrom | 8ecd08c | 2011-07-27 17:50:51 -0700 | [diff] [blame^] | 33 | LOCAL_SHARED_LIBRARIES := libarttest libartd |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 34 | ifeq ($(1),target) |
| 35 | LOCAL_SHARED_LIBRARIES += libstlport |
| 36 | LOCAL_STATIC_LIBRARIES := libgtest libgtest_main |
| 37 | else |
| 38 | LOCAL_WHOLE_STATIC_LIBRARIES := libgtest_host libgtest_main_host |
| 39 | endif |
| 40 | ifeq ($(1),target) |
| 41 | include $(BUILD_EXECUTABLE) |
| 42 | else |
| 43 | include $(BUILD_HOST_EXECUTABLE) |
| 44 | endif |
Brian Carlstrom | 8ecd08c | 2011-07-27 17:50:51 -0700 | [diff] [blame^] | 45 | ifeq ($(1),target) |
| 46 | ART_TARGET_TEST_EXECUTABLES += $(TARGET_OUT_EXECUTABLES)/$$(LOCAL_MODULE) |
| 47 | else |
| 48 | ART_HOST_TEST_EXECUTABLES += $(HOST_OUT_EXECUTABLES)/$$(LOCAL_MODULE) |
| 49 | endif |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 50 | endef |
Carl Shapiro | 008e412 | 2011-06-23 17:27:46 -0700 | [diff] [blame] | 51 | |
Brian Carlstrom | 07d579f | 2011-07-27 13:31:51 -0700 | [diff] [blame] | 52 | $(foreach file,$(TEST_TARGET_SRC_FILES), $(eval $(call build-art-test,target,$(file)))) |
| 53 | ifeq ($(WITH_HOST_DALVIK),true) |
| 54 | $(foreach file,$(TEST_HOST_SRC_FILES), $(eval $(call build-art-test,host,$(file)))) |
| 55 | endif |