1 # Copyright (C) 2009 The Android Open Source Project
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
7 # http://www.apache.org/licenses/LICENSE-2.0
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
15 # Build control file for Bionic's test programs
16 # define the BIONIC_TESTS environment variable to build the test programs
21 LOCAL_PATH:= $(call my-dir)
23 # used to define a simple test program and build it as a standalone
26 # you can use EXTRA_CFLAGS to indicate additional CFLAGS to use
27 # in the build. the variable will be cleaned on exit
30 $(foreach file,$(1), \
31 $(eval include $(CLEAR_VARS)) \
32 $(eval LOCAL_SRC_FILES := $(file)) \
33 $(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \
34 $(eval $(info LOCAL_MODULE=$(LOCAL_MODULE))) \
35 $(eval LOCAL_CFLAGS += $(EXTRA_CFLAGS)) \
36 $(eval LOCAL_MODULE_TAGS := tests) \
37 $(eval include $(BUILD_EXECUTABLE)) \
39 $(eval EXTRA_CFLAGS :=)
42 # same as 'device-test' but builds a host executable instead
43 # you can use EXTRA_LDLIBS to indicate additional linker flags
46 $(foreach file,$(1), \
47 $(eval include $(CLEAR_VARS)) \
48 $(eval LOCAL_SRC_FILES := $(file)) \
49 $(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \
50 $(eval $(info LOCAL_MODULE=$(LOCAL_MODULE) file=$(file))) \
51 $(eval LOCAL_CFLAGS += $(EXTRA_CFLAGS)) \
52 $(eval LOCAL_LDLIBS += $(EXTRA_LDLIBS)) \
53 $(eval LOCAL_MODULE_TAGS := tests) \
54 $(eval include $(BUILD_HOST_EXECUTABLE)) \
56 $(eval EXTRA_CFLAGS :=) \
57 $(eval EXTRA_LDLIBS :=)
74 EXTRA_CFLAGS := -I bionic/libstdc++/include
75 $(call host-test, $(sources))
77 EXTRA_CFLAGS := -I bionic/libstdc++/include
78 $(call device-test, $(sources))