Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 1 | # |
| 2 | # Copyright (C) 2012 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. |
Benoit Goby | 5ac9eee | 2012-08-31 19:52:15 -0700 | [diff] [blame] | 15 | # |
| 16 | |
| 17 | ifneq ($(BUILD_TINY_ANDROID), true) |
Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 18 | |
| 19 | LOCAL_PATH := $(call my-dir) |
| 20 | |
Elliott Hughes | 7be369d | 2012-11-08 15:37:43 -0800 | [diff] [blame] | 21 | # ----------------------------------------------------------------------------- |
Elliott Hughes | 7be369d | 2012-11-08 15:37:43 -0800 | [diff] [blame] | 22 | # Unit tests. |
| 23 | # ----------------------------------------------------------------------------- |
| 24 | |
Elliott Hughes | ad88a08 | 2012-10-24 18:37:21 -0700 | [diff] [blame] | 25 | test_c_flags = \ |
Nick Kralevich | dcab1b2 | 2013-01-10 17:12:29 -0800 | [diff] [blame] | 26 | -fstack-protector-all \ |
Elliott Hughes | ad88a08 | 2012-10-24 18:37:21 -0700 | [diff] [blame] | 27 | -g \ |
| 28 | -Wall -Wextra \ |
| 29 | -Werror \ |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 30 | -fno-builtin \ |
Elliott Hughes | ad88a08 | 2012-10-24 18:37:21 -0700 | [diff] [blame] | 31 | |
Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 32 | test_src_files = \ |
Christopher Ferris | b687ad3 | 2013-11-06 17:32:11 -0800 | [diff] [blame] | 33 | buffer_tests.cpp \ |
Elliott Hughes | 063cfb2 | 2012-10-25 20:55:23 -0700 | [diff] [blame] | 34 | dirent_test.cpp \ |
Kito Cheng | 8baa929 | 2013-04-03 11:29:40 +0800 | [diff] [blame] | 35 | eventfd_test.cpp \ |
Elliott Hughes | 0620925 | 2013-11-06 16:20:54 -0800 | [diff] [blame] | 36 | fcntl_test.cpp \ |
Elliott Hughes | 90e10d4 | 2012-11-02 17:05:20 -0700 | [diff] [blame] | 37 | fenv_test.cpp \ |
Nick Kralevich | 2c5153b | 2013-01-11 14:43:05 -0800 | [diff] [blame] | 38 | getauxval_test.cpp \ |
Elliott Hughes | 04a83a4 | 2012-08-16 15:59:12 -0700 | [diff] [blame] | 39 | getcwd_test.cpp \ |
Elliott Hughes | 74f0833 | 2013-07-02 15:23:38 -0700 | [diff] [blame] | 40 | inttypes_test.cpp \ |
Elliott Hughes | 8f2a5a0 | 2013-03-15 15:30:25 -0700 | [diff] [blame] | 41 | libc_logging_test.cpp \ |
Elliott Hughes | 58b5754 | 2012-10-29 14:27:10 -0700 | [diff] [blame] | 42 | libgen_test.cpp \ |
Christopher Ferris | 885f3b9 | 2013-05-21 17:48:01 -0700 | [diff] [blame] | 43 | malloc_test.cpp \ |
Elliott Hughes | a0ee078 | 2013-01-30 19:06:37 -0800 | [diff] [blame] | 44 | math_test.cpp \ |
Elliott Hughes | d3b9d11 | 2013-02-13 08:22:07 -0800 | [diff] [blame] | 45 | netdb_test.cpp \ |
Elliott Hughes | bfeab1b | 2012-09-05 17:47:37 -0700 | [diff] [blame] | 46 | pthread_test.cpp \ |
Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 47 | regex_test.cpp \ |
Elliott Hughes | 53bfdae | 2013-10-18 19:39:09 -0700 | [diff] [blame] | 48 | sched_test.cpp \ |
Elliott Hughes | da73f65 | 2012-11-30 16:40:55 -0800 | [diff] [blame] | 49 | signal_test.cpp \ |
Elliott Hughes | ad88a08 | 2012-10-24 18:37:21 -0700 | [diff] [blame] | 50 | stack_protector_test.cpp \ |
Sergey Melnikov | c45087b | 2013-01-25 16:40:13 +0400 | [diff] [blame] | 51 | stack_unwinding_test.cpp \ |
Elliott Hughes | 06040fd | 2013-07-09 13:25:03 -0700 | [diff] [blame] | 52 | statvfs_test.cpp \ |
Elliott Hughes | 91875dc | 2012-09-24 17:55:15 -0700 | [diff] [blame] | 53 | stdio_test.cpp \ |
Elliott Hughes | 774c7f5 | 2012-10-01 13:11:03 -0700 | [diff] [blame] | 54 | stdlib_test.cpp \ |
Irina Tirdea | b5f053b | 2012-09-08 09:17:54 +0300 | [diff] [blame] | 55 | string_test.cpp \ |
Elliott Hughes | 73964c5 | 2013-02-13 14:35:14 -0800 | [diff] [blame] | 56 | strings_test.cpp \ |
Kenny Root | 2a54e5e | 2012-09-13 10:52:52 -0700 | [diff] [blame] | 57 | stubs_test.cpp \ |
Elliott Hughes | 1195207 | 2013-10-24 15:15:14 -0700 | [diff] [blame] | 58 | sys_epoll_test.cpp \ |
Elliott Hughes | 5b9310e | 2013-10-02 16:59:05 -0700 | [diff] [blame] | 59 | sys_select_test.cpp \ |
Elliott Hughes | b4f7616 | 2013-09-19 16:27:24 -0700 | [diff] [blame] | 60 | sys_sendfile_test.cpp \ |
Elliott Hughes | d0be7c8 | 2013-08-08 17:13:33 -0700 | [diff] [blame] | 61 | sys_stat_test.cpp \ |
Elliott Hughes | e61dc71 | 2013-11-13 13:14:31 -0800 | [diff] [blame] | 62 | sys_syscall_test.cpp \ |
Elliott Hughes | f8fcfbc | 2013-10-22 13:28:46 -0700 | [diff] [blame] | 63 | sys_time_test.cpp \ |
Colin Cross | b27e200 | 2013-01-28 17:19:43 -0800 | [diff] [blame] | 64 | system_properties_test.cpp \ |
Elliott Hughes | e0175ca | 2013-03-14 14:38:08 -0700 | [diff] [blame] | 65 | time_test.cpp \ |
Elliott Hughes | a55f630 | 2013-01-02 14:23:43 -0800 | [diff] [blame] | 66 | unistd_test.cpp \ |
Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 67 | |
jeffhao | acf5aa7 | 2012-09-12 17:25:30 -0700 | [diff] [blame] | 68 | test_dynamic_ldflags = -Wl,--export-dynamic -Wl,-u,DlSymTestFunction |
| 69 | test_dynamic_src_files = \ |
Elliott Hughes | e66190d | 2012-12-18 15:57:55 -0800 | [diff] [blame] | 70 | dlfcn_test.cpp \ |
jeffhao | acf5aa7 | 2012-09-12 17:25:30 -0700 | [diff] [blame] | 71 | |
Nick Kralevich | 5bcf398 | 2013-06-28 10:34:09 -0700 | [diff] [blame] | 72 | test_fortify_static_libraries = \ |
| 73 | fortify1-tests-gcc fortify2-tests-gcc fortify1-tests-clang fortify2-tests-clang |
| 74 | |
Sergey Melnikov | c45087b | 2013-01-25 16:40:13 +0400 | [diff] [blame] | 75 | include $(CLEAR_VARS) |
| 76 | LOCAL_MODULE := bionic-unit-tests-unwind-test-impl |
| 77 | LOCAL_CFLAGS += $(test_c_flags) -fexceptions -fnon-call-exceptions |
| 78 | LOCAL_SRC_FILES := stack_unwinding_test_impl.c |
| 79 | include $(BUILD_STATIC_LIBRARY) |
| 80 | |
| 81 | include $(CLEAR_VARS) |
| 82 | LOCAL_MODULE := bionic-unit-tests-unwind-test-impl-host |
| 83 | LOCAL_CFLAGS += $(test_c_flags) -fexceptions -fnon-call-exceptions |
| 84 | LOCAL_SRC_FILES := stack_unwinding_test_impl.c |
| 85 | include $(BUILD_HOST_STATIC_LIBRARY) |
| 86 | |
Elliott Hughes | 7be369d | 2012-11-08 15:37:43 -0800 | [diff] [blame] | 87 | # Build tests for the device (with bionic's .so). Run with: |
Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 88 | # adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests |
| 89 | include $(CLEAR_VARS) |
Joe Onorato | 7b841f3 | 2012-08-15 20:27:04 -0700 | [diff] [blame] | 90 | LOCAL_MODULE := bionic-unit-tests |
Elliott Hughes | 2e8f434 | 2012-09-05 14:27:17 -0700 | [diff] [blame] | 91 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Elliott Hughes | ad88a08 | 2012-10-24 18:37:21 -0700 | [diff] [blame] | 92 | LOCAL_CFLAGS += $(test_c_flags) |
jeffhao | acf5aa7 | 2012-09-12 17:25:30 -0700 | [diff] [blame] | 93 | LOCAL_LDFLAGS += $(test_dynamic_ldflags) |
| 94 | LOCAL_SHARED_LIBRARIES += libdl |
| 95 | LOCAL_SRC_FILES := $(test_src_files) $(test_dynamic_src_files) |
Nick Kralevich | 5bcf398 | 2013-06-28 10:34:09 -0700 | [diff] [blame] | 96 | LOCAL_WHOLE_STATIC_LIBRARIES := $(test_fortify_static_libraries) |
Sergey Melnikov | c45087b | 2013-01-25 16:40:13 +0400 | [diff] [blame] | 97 | LOCAL_STATIC_LIBRARIES += bionic-unit-tests-unwind-test-impl |
Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 98 | include $(BUILD_NATIVE_TEST) |
| 99 | |
Elliott Hughes | 7be369d | 2012-11-08 15:37:43 -0800 | [diff] [blame] | 100 | # Build tests for the device (with bionic's .a). Run with: |
Elliott Hughes | bfeab1b | 2012-09-05 17:47:37 -0700 | [diff] [blame] | 101 | # adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static |
| 102 | include $(CLEAR_VARS) |
Elliott Hughes | bfeab1b | 2012-09-05 17:47:37 -0700 | [diff] [blame] | 103 | LOCAL_MODULE := bionic-unit-tests-static |
| 104 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
jeffhao | acf5aa7 | 2012-09-12 17:25:30 -0700 | [diff] [blame] | 105 | LOCAL_FORCE_STATIC_EXECUTABLE := true |
Christopher Ferris | 153d927 | 2013-08-27 14:32:15 -0700 | [diff] [blame] | 106 | LOCAL_WHOLE_STATIC_LIBRARIES += libBionicTests |
Christopher Ferris | 8240bed | 2013-08-29 11:37:33 -0700 | [diff] [blame] | 107 | LOCAL_STATIC_LIBRARIES += libstlport_static libstdc++ libm libc |
Elliott Hughes | bfeab1b | 2012-09-05 17:47:37 -0700 | [diff] [blame] | 108 | include $(BUILD_NATIVE_TEST) |
| 109 | |
Elliott Hughes | 7be369d | 2012-11-08 15:37:43 -0800 | [diff] [blame] | 110 | # ----------------------------------------------------------------------------- |
Christopher Ferris | 153d927 | 2013-08-27 14:32:15 -0700 | [diff] [blame] | 111 | # We build the static unit tests as a library so they can be used both for |
| 112 | # bionic-unit-tests-static and also as part of CTS. |
| 113 | # ----------------------------------------------------------------------------- |
| 114 | |
| 115 | include $(CLEAR_VARS) |
| 116 | LOCAL_MODULE := libBionicTests |
| 117 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 118 | LOCAL_CFLAGS += $(test_c_flags) |
| 119 | LOCAL_SRC_FILES := $(test_src_files) |
Christopher Ferris | 8240bed | 2013-08-29 11:37:33 -0700 | [diff] [blame] | 120 | LOCAL_CFLAGS += \ |
| 121 | -DGTEST_OS_LINUX_ANDROID \ |
| 122 | -DGTEST_HAS_STD_STRING \ |
| 123 | |
| 124 | LOCAL_C_INCLUDES += \ |
| 125 | bionic bionic/libstdc++/include \ |
| 126 | external/gtest/include \ |
| 127 | external/stlport/stlport \ |
| 128 | |
| 129 | LOCAL_WHOLE_STATIC_LIBRARIES := \ |
| 130 | $(test_fortify_static_libraries) \ |
| 131 | bionic-unit-tests-unwind-test-impl \ |
| 132 | |
Christopher Ferris | 153d927 | 2013-08-27 14:32:15 -0700 | [diff] [blame] | 133 | include $(BUILD_STATIC_LIBRARY) |
| 134 | |
| 135 | # ----------------------------------------------------------------------------- |
Elliott Hughes | 7be369d | 2012-11-08 15:37:43 -0800 | [diff] [blame] | 136 | # Test library for the unit tests. |
| 137 | # ----------------------------------------------------------------------------- |
Elliott Hughes | 124fae9 | 2012-10-31 14:20:03 -0700 | [diff] [blame] | 138 | |
| 139 | # Build no-elf-hash-table-library.so to test dlopen(3) on a library that |
Elliott Hughes | a43e906 | 2013-01-07 14:18:22 -0800 | [diff] [blame] | 140 | # only has a GNU-style hash table. MIPS doesn't support GNU hash style. |
| 141 | ifneq ($(TARGET_ARCH),mips) |
Elliott Hughes | 124fae9 | 2012-10-31 14:20:03 -0700 | [diff] [blame] | 142 | include $(CLEAR_VARS) |
| 143 | LOCAL_MODULE := no-elf-hash-table-library |
| 144 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 145 | LOCAL_SRC_FILES := empty.cpp |
| 146 | LOCAL_LDFLAGS := -Wl,--hash-style=gnu |
| 147 | include $(BUILD_SHARED_LIBRARY) |
Elliott Hughes | a43e906 | 2013-01-07 14:18:22 -0800 | [diff] [blame] | 148 | endif |
Elliott Hughes | 124fae9 | 2012-10-31 14:20:03 -0700 | [diff] [blame] | 149 | |
Elliott Hughes | 7be369d | 2012-11-08 15:37:43 -0800 | [diff] [blame] | 150 | # ----------------------------------------------------------------------------- |
| 151 | # Unit tests built against glibc. |
| 152 | # ----------------------------------------------------------------------------- |
Elliott Hughes | 124fae9 | 2012-10-31 14:20:03 -0700 | [diff] [blame] | 153 | |
Elliott Hughes | 7be369d | 2012-11-08 15:37:43 -0800 | [diff] [blame] | 154 | # Build tests for the host (with glibc). |
Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 155 | # Note that this will build against glibc, so it's not useful for testing |
| 156 | # bionic's implementation, but it does let you use glibc as a reference |
| 157 | # implementation for testing the tests themselves. |
Elliott Hughes | 38bfa21 | 2012-09-13 11:01:46 -0700 | [diff] [blame] | 158 | ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86) |
Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 159 | include $(CLEAR_VARS) |
Joe Onorato | 7b841f3 | 2012-08-15 20:27:04 -0700 | [diff] [blame] | 160 | LOCAL_MODULE := bionic-unit-tests-glibc |
Elliott Hughes | 2e8f434 | 2012-09-05 14:27:17 -0700 | [diff] [blame] | 161 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Elliott Hughes | ad88a08 | 2012-10-24 18:37:21 -0700 | [diff] [blame] | 162 | LOCAL_CFLAGS += $(test_c_flags) |
Jeff Hao | 9b06cc3 | 2013-08-15 14:51:16 -0700 | [diff] [blame] | 163 | LOCAL_LDFLAGS += -lpthread -ldl -lrt |
jeffhao | acf5aa7 | 2012-09-12 17:25:30 -0700 | [diff] [blame] | 164 | LOCAL_LDFLAGS += $(test_dynamic_ldflags) |
| 165 | LOCAL_SRC_FILES := $(test_src_files) $(test_dynamic_src_files) |
Sergey Melnikov | c45087b | 2013-01-25 16:40:13 +0400 | [diff] [blame] | 166 | LOCAL_STATIC_LIBRARIES += bionic-unit-tests-unwind-test-impl-host |
Elliott Hughes | cc213f8 | 2012-08-14 15:32:42 -0700 | [diff] [blame] | 167 | include $(BUILD_HOST_NATIVE_TEST) |
Christopher Ferris | b38e4d5 | 2013-10-25 10:06:57 -0700 | [diff] [blame] | 168 | |
| 169 | # gtest needs ANDROID_DATA/local/tmp for death test output. |
| 170 | # Make sure to create ANDROID_DATA/local/tmp if doesn't exist. |
| 171 | # Use the current target out directory as ANDROID_DATA. |
| 172 | bionic-unit-tests-glibc-run: bionic-unit-tests-glibc |
| 173 | mkdir -p $(TARGET_OUT_DATA)/local/tmp |
| 174 | ANDROID_DATA=$(TARGET_OUT_DATA) \ |
| 175 | ANDROID_ROOT=$(TARGET_OUT) \ |
| 176 | $(HOST_OUT_EXECUTABLES)/bionic-unit-tests-glibc |
Elliott Hughes | 38bfa21 | 2012-09-13 11:01:46 -0700 | [diff] [blame] | 177 | endif |
Benoit Goby | 5ac9eee | 2012-08-31 19:52:15 -0700 | [diff] [blame] | 178 | |
Nick Kralevich | 16d1af1 | 2013-06-17 14:49:19 -0700 | [diff] [blame] | 179 | # ----------------------------------------------------------------------------- |
Pavel Chupin | f22fb68 | 2013-09-06 18:43:27 +0400 | [diff] [blame] | 180 | # Run the unit tests built against x86 bionic on an x86 host. |
| 181 | # ----------------------------------------------------------------------------- |
| 182 | |
| 183 | ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86) |
Pavel Chupin | 17558de | 2013-10-17 14:41:34 +0400 | [diff] [blame] | 184 | ifeq ($(TARGET_ARCH),$(filter $(TARGET_ARCH),x86 x86_64)) |
Pavel Chupin | f22fb68 | 2013-09-06 18:43:27 +0400 | [diff] [blame] | 185 | ifeq ($(TARGET_ARCH),x86) |
Pavel Chupin | 17558de | 2013-10-17 14:41:34 +0400 | [diff] [blame] | 186 | LINKER = linker |
| 187 | else |
| 188 | LINKER = linker64 |
| 189 | endif |
Christopher Ferris | b38e4d5 | 2013-10-25 10:06:57 -0700 | [diff] [blame] | 190 | # gtest needs ANDROID_DATA/local/tmp for death test output. |
| 191 | # Make sure to create ANDROID_DATA/local/tmp if doesn't exist. |
Pavel Chupin | f22fb68 | 2013-09-06 18:43:27 +0400 | [diff] [blame] | 192 | # bionic itself should always work relative to ANDROID_DATA or ANDROID_ROOT. |
Pavel Chupin | 17558de | 2013-10-17 14:41:34 +0400 | [diff] [blame] | 193 | bionic-unit-tests-run-on-host: bionic-unit-tests $(TARGET_OUT_EXECUTABLES)/$(LINKER) $(TARGET_OUT_EXECUTABLES)/sh |
Christopher Ferris | b38e4d5 | 2013-10-25 10:06:57 -0700 | [diff] [blame] | 194 | if [ ! -d /system -o ! -d /system/bin ]; then \ |
| 195 | echo "Attempting to create /system/bin"; \ |
| 196 | sudo mkdir -p -m 0777 /system/bin; \ |
| 197 | fi |
Pavel Chupin | f22fb68 | 2013-09-06 18:43:27 +0400 | [diff] [blame] | 198 | mkdir -p $(TARGET_OUT_DATA)/local/tmp |
Pavel Chupin | 17558de | 2013-10-17 14:41:34 +0400 | [diff] [blame] | 199 | cp $(TARGET_OUT_EXECUTABLES)/$(LINKER) /system/bin |
Elliott Hughes | e60c4f0 | 2013-09-19 11:28:20 -0700 | [diff] [blame] | 200 | cp $(TARGET_OUT_EXECUTABLES)/sh /system/bin |
Pavel Chupin | f22fb68 | 2013-09-06 18:43:27 +0400 | [diff] [blame] | 201 | ANDROID_DATA=$(TARGET_OUT_DATA) \ |
| 202 | ANDROID_ROOT=$(TARGET_OUT) \ |
Pavel Chupin | f22fb68 | 2013-09-06 18:43:27 +0400 | [diff] [blame] | 203 | LD_LIBRARY_PATH=$(TARGET_OUT_SHARED_LIBRARIES) \ |
| 204 | $(TARGET_OUT_DATA_NATIVE_TESTS)/bionic-unit-tests/bionic-unit-tests |
| 205 | endif |
| 206 | endif |
| 207 | |
| 208 | # ----------------------------------------------------------------------------- |
Nick Kralevich | 5bcf398 | 2013-06-28 10:34:09 -0700 | [diff] [blame] | 209 | # FORTIFY_SOURCE tests |
Nick Kralevich | 16d1af1 | 2013-06-17 14:49:19 -0700 | [diff] [blame] | 210 | # ----------------------------------------------------------------------------- |
Nick Kralevich | 5bcf398 | 2013-06-28 10:34:09 -0700 | [diff] [blame] | 211 | |
| 212 | fortify_c_includes = \ |
| 213 | bionic \ |
| 214 | bionic/libstdc++/include \ |
| 215 | external/stlport/stlport \ |
| 216 | external/gtest/include |
| 217 | fortify_test_files = fortify_test.cpp |
Nick Kralevich | 16d1af1 | 2013-06-17 14:49:19 -0700 | [diff] [blame] | 218 | |
| 219 | # -Wno-error=unused-parameter needed as |
| 220 | # external/stlport/stlport/stl/_threads.c (included from |
| 221 | # external/gtest/include/gtest/gtest.h) does not compile cleanly under |
| 222 | # clang. TODO: fix this. |
Nick Kralevich | 5bcf398 | 2013-06-28 10:34:09 -0700 | [diff] [blame] | 223 | fortify_c_flags = $(test_c_flags) -Wno-error=unused-parameter |
Nick Kralevich | 16d1af1 | 2013-06-17 14:49:19 -0700 | [diff] [blame] | 224 | |
Nick Kralevich | 5bcf398 | 2013-06-28 10:34:09 -0700 | [diff] [blame] | 225 | include $(CLEAR_VARS) |
| 226 | LOCAL_SRC_FILES := $(fortify_test_files) |
| 227 | LOCAL_MODULE := fortify1-tests-gcc |
| 228 | LOCAL_CFLAGS += $(fortify_c_flags) -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DTEST_NAME=Fortify1_Gcc |
Nick Kralevich | 16d1af1 | 2013-06-17 14:49:19 -0700 | [diff] [blame] | 229 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
Nick Kralevich | 5bcf398 | 2013-06-28 10:34:09 -0700 | [diff] [blame] | 230 | LOCAL_C_INCLUDES += $(fortify_c_includes) |
| 231 | include $(BUILD_STATIC_LIBRARY) |
Nick Kralevich | 16d1af1 | 2013-06-17 14:49:19 -0700 | [diff] [blame] | 232 | |
Nick Kralevich | 5bcf398 | 2013-06-28 10:34:09 -0700 | [diff] [blame] | 233 | include $(CLEAR_VARS) |
| 234 | LOCAL_SRC_FILES := $(fortify_test_files) |
| 235 | LOCAL_MODULE := fortify2-tests-gcc |
| 236 | LOCAL_CFLAGS += $(fortify_c_flags) -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -DTEST_NAME=Fortify2_Gcc |
| 237 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 238 | LOCAL_C_INCLUDES += $(fortify_c_includes) |
| 239 | include $(BUILD_STATIC_LIBRARY) |
| 240 | |
| 241 | include $(CLEAR_VARS) |
| 242 | LOCAL_SRC_FILES := $(fortify_test_files) |
| 243 | LOCAL_MODULE := fortify1-tests-clang |
| 244 | LOCAL_CLANG := true |
| 245 | LOCAL_CFLAGS += $(fortify_c_flags) -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DTEST_NAME=Fortify1_Clang |
| 246 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 247 | LOCAL_C_INCLUDES += $(fortify_c_includes) |
| 248 | include $(BUILD_STATIC_LIBRARY) |
| 249 | |
| 250 | include $(CLEAR_VARS) |
| 251 | LOCAL_SRC_FILES := $(fortify_test_files) |
| 252 | LOCAL_MODULE := fortify2-tests-clang |
| 253 | LOCAL_CLANG := true |
| 254 | LOCAL_CFLAGS += $(fortify_c_flags) -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -DTEST_NAME=Fortify2_Clang |
| 255 | LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk |
| 256 | LOCAL_C_INCLUDES += $(fortify_c_includes) |
Nick Kralevich | 16d1af1 | 2013-06-17 14:49:19 -0700 | [diff] [blame] | 257 | include $(BUILD_STATIC_LIBRARY) |
| 258 | |
Benoit Goby | 5ac9eee | 2012-08-31 19:52:15 -0700 | [diff] [blame] | 259 | endif # !BUILD_TINY_ANDROID |