blob: ba314bd5df74da92ead0513a7e427d0a52138941 [file] [log] [blame]
Carl Shapiro008e4122011-06-23 17:27:46 -07001#
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 Carlstrom07d579f2011-07-27 13:31:51 -070017# $(1): target or host
18# $(2): file name with .cc or .cc.arm extension
19define build-art-test
20 include $(CLEAR_VARS)
21 ifeq ($(1),target)
22 include external/stlport/libstlport.mk
23 endif
24 LOCAL_CPP_EXTENSION := $(ART_CPP_EXTENSION)
25 LOCAL_MODULE := $(notdir $(basename $(2:%.arm=%)))
26 LOCAL_MODULE_TAGS := tests
27 LOCAL_SRC_FILES := $(2)
28 LOCAL_CFLAGS := $(ART_CFLAGS)
29 LOCAL_C_INCLUDES += external/gtest/include
30 LOCAL_SHARED_LIBRARIES := libarttest libart
31 ifeq ($(1),target)
32 LOCAL_SHARED_LIBRARIES += libstlport
33 LOCAL_STATIC_LIBRARIES := libgtest libgtest_main
34 else
35 LOCAL_WHOLE_STATIC_LIBRARIES := libgtest_host libgtest_main_host
36 endif
37 ifeq ($(1),target)
38 include $(BUILD_EXECUTABLE)
39 else
40 include $(BUILD_HOST_EXECUTABLE)
41 endif
42endef
Carl Shapiro008e4122011-06-23 17:27:46 -070043
Brian Carlstrom07d579f2011-07-27 13:31:51 -070044$(foreach file,$(TEST_TARGET_SRC_FILES), $(eval $(call build-art-test,target,$(file))))
45ifeq ($(WITH_HOST_DALVIK),true)
46 $(foreach file,$(TEST_HOST_SRC_FILES), $(eval $(call build-art-test,host,$(file))))
47endif