Android.mk revision 5bcf39842e8c4b02ae557a2765a84e724f762469
1cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes#
2cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes# Copyright (C) 2012 The Android Open Source Project
3cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes#
4cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes# Licensed under the Apache License, Version 2.0 (the "License");
5cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes# you may not use this file except in compliance with the License.
6cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes# You may obtain a copy of the License at
7cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes#
8cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes#      http://www.apache.org/licenses/LICENSE-2.0
9cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes#
10cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes# Unless required by applicable law or agreed to in writing, software
11cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes# distributed under the License is distributed on an "AS IS" BASIS,
12cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes# See the License for the specific language governing permissions and
14cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes# limitations under the License.
155ac9eee1d3291a0d203a125849b4636a11c0d124Benoit Goby#
165ac9eee1d3291a0d203a125849b4636a11c0d124Benoit Goby
175ac9eee1d3291a0d203a125849b4636a11c0d124Benoit Gobyifneq ($(BUILD_TINY_ANDROID), true)
18cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes
19cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott HughesLOCAL_PATH := $(call my-dir)
20cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes
217be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes# -----------------------------------------------------------------------------
227be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes# Benchmarks.
237be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes# -----------------------------------------------------------------------------
247be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes
257be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughesbenchmark_c_flags = \
267be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes    -O2 \
277be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes    -Wall -Wextra \
287be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes    -Werror \
299edb3e004b487e08cbbb54f2af18b15241550513Elliott Hughes    -fno-builtin \
307be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes
317be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughesbenchmark_src_files = \
327be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes    benchmark_main.cpp \
339edb3e004b487e08cbbb54f2af18b15241550513Elliott Hughes    math_benchmark.cpp \
34b27e200ad6170ba3163f5ae6ba581bdaabb2e696Colin Cross    property_benchmark.cpp \
357be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes    string_benchmark.cpp \
364a05bef4c06dac05f1c9aa8cfc5b7e7dd6642385Elliott Hughes    time_benchmark.cpp \
377be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes
387be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes# Build benchmarks for the device (with bionic's .so). Run with:
397be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes#   adb shell bionic-benchmarks
407be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughesinclude $(CLEAR_VARS)
417be369d4c60e9df2316fdb6c73181a40020abef2Elliott HughesLOCAL_MODULE := bionic-benchmarks
427be369d4c60e9df2316fdb6c73181a40020abef2Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
437be369d4c60e9df2316fdb6c73181a40020abef2Elliott HughesLOCAL_CFLAGS += $(benchmark_c_flags)
447be369d4c60e9df2316fdb6c73181a40020abef2Elliott HughesLOCAL_C_INCLUDES += external/stlport/stlport bionic/ bionic/libstdc++/include
457be369d4c60e9df2316fdb6c73181a40020abef2Elliott HughesLOCAL_SHARED_LIBRARIES += libstlport
467be369d4c60e9df2316fdb6c73181a40020abef2Elliott HughesLOCAL_SRC_FILES := $(benchmark_src_files)
477be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughesinclude $(BUILD_EXECUTABLE)
487be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes
497be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes# -----------------------------------------------------------------------------
507be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes# Unit tests.
517be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes# -----------------------------------------------------------------------------
527be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes
53ad88a0863110798cef5169dcf917e18b967a7cf6Elliott Hughestest_c_flags = \
54dcab1b2c76a498c56bc00024613386de8b4b2aaeNick Kralevich    -fstack-protector-all \
55ad88a0863110798cef5169dcf917e18b967a7cf6Elliott Hughes    -g \
56ad88a0863110798cef5169dcf917e18b967a7cf6Elliott Hughes    -Wall -Wextra \
57ad88a0863110798cef5169dcf917e18b967a7cf6Elliott Hughes    -Werror \
58a0ee07829a9ba7e99ef68e8c12551301cc797f0fElliott Hughes    -fno-builtin \
59ad88a0863110798cef5169dcf917e18b967a7cf6Elliott Hughes
60cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughestest_src_files = \
61063cfb2084ea4b12d3c85b2d2c44e888f0857eb4Elliott Hughes    dirent_test.cpp \
628baa929d5d3bcf63381cf78ba76168c80c303f5eKito Cheng    eventfd_test.cpp \
6390e10d41c4271a5d517f60f4ff1d2891b8ccc034Elliott Hughes    fenv_test.cpp \
642c5153b043b44e9935a334ae9b2d5a4bc5258b40Nick Kralevich    getauxval_test.cpp \
6504a83a48ed89f433c78e31106ed50059764797a0Elliott Hughes    getcwd_test.cpp \
668f2a5a0b40fc82126c691d5c30131d908772aab7Elliott Hughes    libc_logging_test.cpp \
6758b575485c446f9d76ee00f67516ed42cf017769Elliott Hughes    libgen_test.cpp \
68885f3b9cad01b8158aadc55c159c17dbf34f622cChristopher Ferris    malloc_test.cpp \
69a0ee07829a9ba7e99ef68e8c12551301cc797f0fElliott Hughes    math_test.cpp \
70d3b9d11369ee15dc0ce512014284c3c5432f2813Elliott Hughes    netdb_test.cpp \
71bfeab1bbe7e8d0c08b7e3f46aedab64e3b2bf706Elliott Hughes    pthread_test.cpp \
72cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes    regex_test.cpp \
73da73f655fcbac6e1a8bfd35303cef6f41187d12bElliott Hughes    signal_test.cpp \
74ad88a0863110798cef5169dcf917e18b967a7cf6Elliott Hughes    stack_protector_test.cpp \
75c45087bffa528c0809f0df2e0a3708eba7018b33Sergey Melnikov    stack_unwinding_test.cpp \
7691875dcd6e17b7f3b251efe9b236b905ef414ddeElliott Hughes    stdio_test.cpp \
77774c7f54ff375d71106283d42779b0cc5f238f87Elliott Hughes    stdlib_test.cpp \
78b5f053b5a7deb084e7a052d527e0aa41339ae05cIrina Tirdea    string_test.cpp \
7973964c592c8d23901e9479893dfbd3d0f25bab04Elliott Hughes    strings_test.cpp \
802a54e5ecd0a96398e8d7d9b1629ecf8fb1633a2bKenny Root    stubs_test.cpp \
81b27e200ad6170ba3163f5ae6ba581bdaabb2e696Colin Cross    system_properties_test.cpp \
82e0175ca7e440a87e9d03f249fc8f210063df7908Elliott Hughes    time_test.cpp \
83a55f63083fb16b2595f517a3260083e5f8cddd02Elliott Hughes    unistd_test.cpp \
84cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes
85acf5aa76a56f101607aeb8e6d1fbea24d0d4f68cjeffhaotest_dynamic_ldflags = -Wl,--export-dynamic -Wl,-u,DlSymTestFunction
86acf5aa76a56f101607aeb8e6d1fbea24d0d4f68cjeffhaotest_dynamic_src_files = \
87e66190d2a97a713ae4b4786e60ca3d67ab8aa192Elliott Hughes    dlfcn_test.cpp \
88acf5aa76a56f101607aeb8e6d1fbea24d0d4f68cjeffhao
895bcf39842e8c4b02ae557a2765a84e724f762469Nick Kralevichtest_fortify_static_libraries = \
905bcf39842e8c4b02ae557a2765a84e724f762469Nick Kralevich    fortify1-tests-gcc fortify2-tests-gcc fortify1-tests-clang fortify2-tests-clang
915bcf39842e8c4b02ae557a2765a84e724f762469Nick Kralevich
92c45087bffa528c0809f0df2e0a3708eba7018b33Sergey Melnikovinclude $(CLEAR_VARS)
93c45087bffa528c0809f0df2e0a3708eba7018b33Sergey MelnikovLOCAL_MODULE := bionic-unit-tests-unwind-test-impl
94c45087bffa528c0809f0df2e0a3708eba7018b33Sergey MelnikovLOCAL_CFLAGS += $(test_c_flags) -fexceptions -fnon-call-exceptions
95c45087bffa528c0809f0df2e0a3708eba7018b33Sergey MelnikovLOCAL_SRC_FILES := stack_unwinding_test_impl.c
96c45087bffa528c0809f0df2e0a3708eba7018b33Sergey Melnikovinclude $(BUILD_STATIC_LIBRARY)
97c45087bffa528c0809f0df2e0a3708eba7018b33Sergey Melnikov
98c45087bffa528c0809f0df2e0a3708eba7018b33Sergey Melnikovinclude $(CLEAR_VARS)
99c45087bffa528c0809f0df2e0a3708eba7018b33Sergey MelnikovLOCAL_MODULE := bionic-unit-tests-unwind-test-impl-host
100c45087bffa528c0809f0df2e0a3708eba7018b33Sergey MelnikovLOCAL_CFLAGS += $(test_c_flags) -fexceptions -fnon-call-exceptions
101c45087bffa528c0809f0df2e0a3708eba7018b33Sergey MelnikovLOCAL_SRC_FILES := stack_unwinding_test_impl.c
102c45087bffa528c0809f0df2e0a3708eba7018b33Sergey Melnikovinclude $(BUILD_HOST_STATIC_LIBRARY)
103c45087bffa528c0809f0df2e0a3708eba7018b33Sergey Melnikov
1047be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes# Build tests for the device (with bionic's .so). Run with:
105cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes#   adb shell /data/nativetest/bionic-unit-tests/bionic-unit-tests
106cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughesinclude $(CLEAR_VARS)
1077b841f3b4ad121dd64f639c1858b42defffd60bdJoe OnoratoLOCAL_MODULE := bionic-unit-tests
1082e8f4345dfe16e64d7a3c26f688f17f2b48b2dd1Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
109ad88a0863110798cef5169dcf917e18b967a7cf6Elliott HughesLOCAL_CFLAGS += $(test_c_flags)
110acf5aa76a56f101607aeb8e6d1fbea24d0d4f68cjeffhaoLOCAL_LDFLAGS += $(test_dynamic_ldflags)
111acf5aa76a56f101607aeb8e6d1fbea24d0d4f68cjeffhaoLOCAL_SHARED_LIBRARIES += libdl
112acf5aa76a56f101607aeb8e6d1fbea24d0d4f68cjeffhaoLOCAL_SRC_FILES := $(test_src_files) $(test_dynamic_src_files)
1135bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_WHOLE_STATIC_LIBRARIES := $(test_fortify_static_libraries)
114c45087bffa528c0809f0df2e0a3708eba7018b33Sergey MelnikovLOCAL_STATIC_LIBRARIES += bionic-unit-tests-unwind-test-impl
115cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughesinclude $(BUILD_NATIVE_TEST)
116cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes
1177be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes# Build tests for the device (with bionic's .a). Run with:
118bfeab1bbe7e8d0c08b7e3f46aedab64e3b2bf706Elliott Hughes#   adb shell /data/nativetest/bionic-unit-tests-static/bionic-unit-tests-static
119bfeab1bbe7e8d0c08b7e3f46aedab64e3b2bf706Elliott Hughesinclude $(CLEAR_VARS)
120bfeab1bbe7e8d0c08b7e3f46aedab64e3b2bf706Elliott HughesLOCAL_MODULE := bionic-unit-tests-static
121bfeab1bbe7e8d0c08b7e3f46aedab64e3b2bf706Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
122ad88a0863110798cef5169dcf917e18b967a7cf6Elliott HughesLOCAL_CFLAGS += $(test_c_flags)
123acf5aa76a56f101607aeb8e6d1fbea24d0d4f68cjeffhaoLOCAL_FORCE_STATIC_EXECUTABLE := true
124bfeab1bbe7e8d0c08b7e3f46aedab64e3b2bf706Elliott HughesLOCAL_SRC_FILES := $(test_src_files)
125c45087bffa528c0809f0df2e0a3708eba7018b33Sergey MelnikovLOCAL_STATIC_LIBRARIES += libstlport_static libstdc++ libm libc bionic-unit-tests-unwind-test-impl
1265bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_WHOLE_STATIC_LIBRARIES := $(test_fortify_static_libraries)
127bfeab1bbe7e8d0c08b7e3f46aedab64e3b2bf706Elliott Hughesinclude $(BUILD_NATIVE_TEST)
128bfeab1bbe7e8d0c08b7e3f46aedab64e3b2bf706Elliott Hughes
1297be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes# -----------------------------------------------------------------------------
1307be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes# Test library for the unit tests.
1317be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes# -----------------------------------------------------------------------------
132124fae9eabd7a25d80dfa8c3b56bed0f0fba16f1Elliott Hughes
133124fae9eabd7a25d80dfa8c3b56bed0f0fba16f1Elliott Hughes# Build no-elf-hash-table-library.so to test dlopen(3) on a library that
134a43e906221a3e9c70a66118a8692cd46f77e144eElliott Hughes# only has a GNU-style hash table. MIPS doesn't support GNU hash style.
135a43e906221a3e9c70a66118a8692cd46f77e144eElliott Hughesifneq ($(TARGET_ARCH),mips)
136124fae9eabd7a25d80dfa8c3b56bed0f0fba16f1Elliott Hughesinclude $(CLEAR_VARS)
137124fae9eabd7a25d80dfa8c3b56bed0f0fba16f1Elliott HughesLOCAL_MODULE := no-elf-hash-table-library
138124fae9eabd7a25d80dfa8c3b56bed0f0fba16f1Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
139124fae9eabd7a25d80dfa8c3b56bed0f0fba16f1Elliott HughesLOCAL_SRC_FILES := empty.cpp
140124fae9eabd7a25d80dfa8c3b56bed0f0fba16f1Elliott HughesLOCAL_LDFLAGS := -Wl,--hash-style=gnu
141124fae9eabd7a25d80dfa8c3b56bed0f0fba16f1Elliott Hughesinclude $(BUILD_SHARED_LIBRARY)
142a43e906221a3e9c70a66118a8692cd46f77e144eElliott Hughesendif
143124fae9eabd7a25d80dfa8c3b56bed0f0fba16f1Elliott Hughes
1447be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes# -----------------------------------------------------------------------------
1457be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes# Unit tests built against glibc.
1467be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes# -----------------------------------------------------------------------------
147124fae9eabd7a25d80dfa8c3b56bed0f0fba16f1Elliott Hughes
1487be369d4c60e9df2316fdb6c73181a40020abef2Elliott Hughes# Build tests for the host (with glibc).
149cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes# Note that this will build against glibc, so it's not useful for testing
150cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes# bionic's implementation, but it does let you use glibc as a reference
151cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughes# implementation for testing the tests themselves.
15238bfa21695b19c21784d2074de30d5d102f08972Elliott Hughesifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86)
153cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughesinclude $(CLEAR_VARS)
1547b841f3b4ad121dd64f639c1858b42defffd60bdJoe OnoratoLOCAL_MODULE := bionic-unit-tests-glibc
1552e8f4345dfe16e64d7a3c26f688f17f2b48b2dd1Elliott HughesLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
156ad88a0863110798cef5169dcf917e18b967a7cf6Elliott HughesLOCAL_CFLAGS += $(test_c_flags)
157acf5aa76a56f101607aeb8e6d1fbea24d0d4f68cjeffhaoLOCAL_LDFLAGS += -lpthread -ldl
158acf5aa76a56f101607aeb8e6d1fbea24d0d4f68cjeffhaoLOCAL_LDFLAGS += $(test_dynamic_ldflags)
159acf5aa76a56f101607aeb8e6d1fbea24d0d4f68cjeffhaoLOCAL_SRC_FILES := $(test_src_files) $(test_dynamic_src_files)
160c45087bffa528c0809f0df2e0a3708eba7018b33Sergey MelnikovLOCAL_STATIC_LIBRARIES += bionic-unit-tests-unwind-test-impl-host
161cc213f871bf4c5329eb5eb7a80a0ce9d4a880af8Elliott Hughesinclude $(BUILD_HOST_NATIVE_TEST)
16238bfa21695b19c21784d2074de30d5d102f08972Elliott Hughesendif
1635ac9eee1d3291a0d203a125849b4636a11c0d124Benoit Goby
16416d1af167f8e36a9aa4a07ae77034ad519b00463Nick Kralevich# -----------------------------------------------------------------------------
1655bcf39842e8c4b02ae557a2765a84e724f762469Nick Kralevich# FORTIFY_SOURCE tests
16616d1af167f8e36a9aa4a07ae77034ad519b00463Nick Kralevich# -----------------------------------------------------------------------------
1675bcf39842e8c4b02ae557a2765a84e724f762469Nick Kralevich
1685bcf39842e8c4b02ae557a2765a84e724f762469Nick Kralevichfortify_c_includes = \
1695bcf39842e8c4b02ae557a2765a84e724f762469Nick Kralevich    bionic \
1705bcf39842e8c4b02ae557a2765a84e724f762469Nick Kralevich    bionic/libstdc++/include \
1715bcf39842e8c4b02ae557a2765a84e724f762469Nick Kralevich    external/stlport/stlport \
1725bcf39842e8c4b02ae557a2765a84e724f762469Nick Kralevich    external/gtest/include
1735bcf39842e8c4b02ae557a2765a84e724f762469Nick Kralevichfortify_test_files = fortify_test.cpp
17416d1af167f8e36a9aa4a07ae77034ad519b00463Nick Kralevich
17516d1af167f8e36a9aa4a07ae77034ad519b00463Nick Kralevich# -Wno-error=unused-parameter needed as
17616d1af167f8e36a9aa4a07ae77034ad519b00463Nick Kralevich# external/stlport/stlport/stl/_threads.c (included from
17716d1af167f8e36a9aa4a07ae77034ad519b00463Nick Kralevich# external/gtest/include/gtest/gtest.h) does not compile cleanly under
17816d1af167f8e36a9aa4a07ae77034ad519b00463Nick Kralevich# clang. TODO: fix this.
1795bcf39842e8c4b02ae557a2765a84e724f762469Nick Kralevichfortify_c_flags = $(test_c_flags) -Wno-error=unused-parameter
1805bcf39842e8c4b02ae557a2765a84e724f762469Nick Kralevich
1815bcf39842e8c4b02ae557a2765a84e724f762469Nick Kralevichinclude $(CLEAR_VARS)
1825bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_SRC_FILES := $(fortify_test_files)
1835bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_MODULE := fortify1-tests-gcc
1845bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_CFLAGS += $(fortify_c_flags) -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DTEST_NAME=Fortify1_Gcc
1855bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
1865bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_C_INCLUDES += $(fortify_c_includes)
1875bcf39842e8c4b02ae557a2765a84e724f762469Nick Kralevichinclude $(BUILD_STATIC_LIBRARY)
1885bcf39842e8c4b02ae557a2765a84e724f762469Nick Kralevich
1895bcf39842e8c4b02ae557a2765a84e724f762469Nick Kralevichinclude $(CLEAR_VARS)
1905bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_SRC_FILES := $(fortify_test_files)
1915bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_MODULE := fortify2-tests-gcc
1925bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_CFLAGS += $(fortify_c_flags) -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -DTEST_NAME=Fortify2_Gcc
1935bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
1945bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_C_INCLUDES += $(fortify_c_includes)
1955bcf39842e8c4b02ae557a2765a84e724f762469Nick Kralevichinclude $(BUILD_STATIC_LIBRARY)
19616d1af167f8e36a9aa4a07ae77034ad519b00463Nick Kralevich
1975bcf39842e8c4b02ae557a2765a84e724f762469Nick Kralevichinclude $(CLEAR_VARS)
1985bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_SRC_FILES := $(fortify_test_files)
1995bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_MODULE := fortify1-tests-clang
2005bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_CLANG := true
2015bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_CFLAGS += $(fortify_c_flags) -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DTEST_NAME=Fortify1_Clang
20216d1af167f8e36a9aa4a07ae77034ad519b00463Nick KralevichLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
2035bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_C_INCLUDES += $(fortify_c_includes)
2045bcf39842e8c4b02ae557a2765a84e724f762469Nick Kralevichinclude $(BUILD_STATIC_LIBRARY)
20516d1af167f8e36a9aa4a07ae77034ad519b00463Nick Kralevich
2065bcf39842e8c4b02ae557a2765a84e724f762469Nick Kralevichinclude $(CLEAR_VARS)
2075bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_SRC_FILES := $(fortify_test_files)
2085bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_MODULE := fortify2-tests-clang
2095bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_CLANG := true
2105bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_CFLAGS += $(fortify_c_flags) -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -DTEST_NAME=Fortify2_Clang
2115bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
2125bcf39842e8c4b02ae557a2765a84e724f762469Nick KralevichLOCAL_C_INCLUDES += $(fortify_c_includes)
21316d1af167f8e36a9aa4a07ae77034ad519b00463Nick Kralevichinclude $(BUILD_STATIC_LIBRARY)
21416d1af167f8e36a9aa4a07ae77034ad519b00463Nick Kralevich
2155ac9eee1d3291a0d203a125849b4636a11c0d124Benoit Gobyendif # !BUILD_TINY_ANDROID
216