| The Android Open Source Project | 46c012c | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1 | # |
| Christopher Wiley | 130e686 | 2015-10-18 17:53:11 -0700 | [diff] [blame] | 2 | # Copyright (C) 2015 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 | |
| 17 | LOCAL_PATH := $(call my-dir) |
| The Android Open Source Project | 46c012c | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 18 | |
| Christopher Wiley | c5a9e28 | 2015-10-23 11:45:28 -0700 | [diff] [blame] | 19 | aidl_cflags := -Wall -Wextra -Werror |
| Christopher Wiley | e392ed7 | 2015-11-20 14:32:44 -0800 | [diff] [blame] | 20 | aidl_static_libraries := libbase libcutils |
| 21 | |
| 22 | aidl_module_host_os := darwin linux windows |
| 23 | ifdef BRILLO |
| 24 | aidl_module_host_os := darwin linux |
| 25 | endif |
| Christopher Wiley | c5a9e28 | 2015-10-23 11:45:28 -0700 | [diff] [blame] | 26 | |
| Joe Onorato | 54fba42 | 2010-06-10 18:34:55 -0700 | [diff] [blame] | 27 | # This tool is prebuilt if we're doing an app-only build. |
| Ying Wang | c7cf53e | 2014-03-07 15:55:14 -0800 | [diff] [blame] | 28 | ifeq ($(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)),) |
| Joe Onorato | 54fba42 | 2010-06-10 18:34:55 -0700 | [diff] [blame] | 29 | |
| Christopher Wiley | 3616d13 | 2015-09-01 11:07:48 -0700 | [diff] [blame] | 30 | # Logic shared between aidl and its unittests |
| The Android Open Source Project | 46c012c | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 31 | include $(CLEAR_VARS) |
| Christopher Wiley | 3616d13 | 2015-09-01 11:07:48 -0700 | [diff] [blame] | 32 | LOCAL_MODULE := libaidl-common |
| Christopher Wiley | e392ed7 | 2015-11-20 14:32:44 -0800 | [diff] [blame] | 33 | LOCAL_MODULE_HOST_OS := $(aidl_module_host_os) |
| The Android Open Source Project | 46c012c | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 34 | |
| Christopher Wiley | 4427d86 | 2015-09-14 11:07:39 -0700 | [diff] [blame] | 35 | LOCAL_C_INCLUDES := external/gtest/include |
| Christopher Wiley | c5a9e28 | 2015-10-23 11:45:28 -0700 | [diff] [blame] | 36 | LOCAL_CLANG_CFLAGS := $(aidl_cflags) |
| Christopher Wiley | e0146cf | 2015-08-24 15:06:58 -0700 | [diff] [blame] | 37 | # Tragically, the code is riddled with unused parameters. |
| 38 | LOCAL_CLANG_CFLAGS += -Wno-unused-parameter |
| 39 | # yacc dumps a lot of code *just in case*. |
| 40 | LOCAL_CLANG_CFLAGS += -Wno-unused-function |
| 41 | LOCAL_CLANG_CFLAGS += -Wno-unneeded-internal-declaration |
| 42 | # yacc is a tool from a more civilized age. |
| 43 | LOCAL_CLANG_CFLAGS += -Wno-deprecated-register |
| 44 | # yacc also has a habit of using char* over const char*. |
| 45 | LOCAL_CLANG_CFLAGS += -Wno-writable-strings |
| Christopher Wiley | 7c3a1eb | 2015-09-12 10:19:52 -0700 | [diff] [blame] | 46 | LOCAL_STATIC_LIBRARIES := $(aidl_static_libraries) |
| Christopher Wiley | e0146cf | 2015-08-24 15:06:58 -0700 | [diff] [blame] | 47 | |
| The Android Open Source Project | 46c012c | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 48 | LOCAL_SRC_FILES := \ |
| Christopher Wiley | 89e3586 | 2015-08-30 10:57:07 -0700 | [diff] [blame] | 49 | aidl.cpp \ |
| 50 | aidl_language.cpp \ |
| Ying Wang | 3000e75 | 2016-01-11 18:05:59 -0800 | [diff] [blame] | 51 | aidl_language_l.ll \ |
| 52 | aidl_language_y.yy \ |
| Christopher Wiley | f600a55 | 2015-09-12 14:07:44 -0700 | [diff] [blame] | 53 | ast_cpp.cpp \ |
| Christopher Wiley | 038485e | 2015-09-12 11:14:14 -0700 | [diff] [blame] | 54 | ast_java.cpp \ |
| Christopher Wiley | fdeb0f4 | 2015-09-11 15:38:22 -0700 | [diff] [blame] | 55 | code_writer.cpp \ |
| Christopher Wiley | eb1acc1 | 2015-09-16 11:25:13 -0700 | [diff] [blame] | 56 | generate_cpp.cpp \ |
| Christopher Wiley | 89e3586 | 2015-08-30 10:57:07 -0700 | [diff] [blame] | 57 | generate_java.cpp \ |
| 58 | generate_java_binder.cpp \ |
| Christopher Wiley | 72877ac | 2015-10-06 14:41:42 -0700 | [diff] [blame] | 59 | import_resolver.cpp \ |
| Christopher Wiley | ef14093 | 2015-11-03 09:29:19 -0800 | [diff] [blame] | 60 | line_reader.cpp \ |
| Christopher Wiley | 4a2884b | 2015-10-07 11:27:45 -0700 | [diff] [blame] | 61 | io_delegate.cpp \ |
| Christopher Wiley | 89e3586 | 2015-08-30 10:57:07 -0700 | [diff] [blame] | 62 | options.cpp \ |
| Christopher Wiley | a8a2dc0 | 2015-09-28 16:35:31 -0700 | [diff] [blame] | 63 | type_cpp.cpp \ |
| Christopher Wiley | 775fa1f | 2015-09-22 15:00:12 -0700 | [diff] [blame] | 64 | type_java.cpp \ |
| Christopher Wiley | fb4b22d | 2015-09-25 15:16:13 -0700 | [diff] [blame] | 65 | type_namespace.cpp \ |
| The Android Open Source Project | 46c012c | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 66 | |
| Christopher Wiley | 3616d13 | 2015-09-01 11:07:48 -0700 | [diff] [blame] | 67 | include $(BUILD_HOST_STATIC_LIBRARY) |
| The Android Open Source Project | 46c012c | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 68 | |
| Christopher Wiley | 3616d13 | 2015-09-01 11:07:48 -0700 | [diff] [blame] | 69 | |
| 70 | # aidl executable |
| 71 | include $(CLEAR_VARS) |
| 72 | LOCAL_MODULE := aidl |
| 73 | |
| Christopher Wiley | e392ed7 | 2015-11-20 14:32:44 -0800 | [diff] [blame] | 74 | LOCAL_MODULE_HOST_OS := $(aidl_module_host_os) |
| Christopher Wiley | c5a9e28 | 2015-10-23 11:45:28 -0700 | [diff] [blame] | 75 | LOCAL_CFLAGS := $(aidl_cflags) |
| Christopher Wiley | 4427d86 | 2015-09-14 11:07:39 -0700 | [diff] [blame] | 76 | LOCAL_C_INCLUDES := external/gtest/include |
| Christopher Wiley | 89eaab5 | 2015-09-15 14:46:46 -0700 | [diff] [blame] | 77 | LOCAL_SRC_FILES := main_java.cpp |
| Christopher Wiley | 7c3a1eb | 2015-09-12 10:19:52 -0700 | [diff] [blame] | 78 | LOCAL_STATIC_LIBRARIES := libaidl-common $(aidl_static_libraries) |
| The Android Open Source Project | 46c012c | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 79 | include $(BUILD_HOST_EXECUTABLE) |
| 80 | |
| Christopher Wiley | a590de8 | 2015-09-15 15:46:28 -0700 | [diff] [blame] | 81 | # aidl-cpp executable |
| 82 | include $(CLEAR_VARS) |
| 83 | LOCAL_MODULE := aidl-cpp |
| 84 | |
| Christopher Wiley | e392ed7 | 2015-11-20 14:32:44 -0800 | [diff] [blame] | 85 | LOCAL_MODULE_HOST_OS := $(aidl_module_host_os) |
| Christopher Wiley | c5a9e28 | 2015-10-23 11:45:28 -0700 | [diff] [blame] | 86 | LOCAL_CFLAGS := $(aidl_cflags) |
| Christopher Wiley | a590de8 | 2015-09-15 15:46:28 -0700 | [diff] [blame] | 87 | LOCAL_C_INCLUDES := external/gtest/include |
| 88 | LOCAL_SRC_FILES := main_cpp.cpp |
| 89 | LOCAL_STATIC_LIBRARIES := libaidl-common $(aidl_static_libraries) |
| 90 | include $(BUILD_HOST_EXECUTABLE) |
| 91 | |
| Casey Dahlin | d8cc509 | 2015-08-28 15:46:48 -0700 | [diff] [blame] | 92 | # Unit tests |
| 93 | include $(CLEAR_VARS) |
| 94 | LOCAL_MODULE := aidl_unittests |
| Christopher Wiley | f047e02 | 2015-11-13 14:42:00 -0800 | [diff] [blame] | 95 | LOCAL_MODULE_HOST_OS := darwin linux |
| Christopher Wiley | 3616d13 | 2015-09-01 11:07:48 -0700 | [diff] [blame] | 96 | |
| Christopher Wiley | c5a9e28 | 2015-10-23 11:45:28 -0700 | [diff] [blame] | 97 | LOCAL_CFLAGS := $(aidl_cflags) -g -DUNIT_TEST |
| Christopher Wiley | 856a869 | 2015-08-31 17:36:41 -0700 | [diff] [blame] | 98 | # Tragically, the code is riddled with unused parameters. |
| 99 | LOCAL_CLANG_CFLAGS := -Wno-unused-parameter |
| Christopher Wiley | 3616d13 | 2015-09-01 11:07:48 -0700 | [diff] [blame] | 100 | LOCAL_SRC_FILES := \ |
| Christopher Wiley | 90be4e3 | 2015-10-20 14:55:25 -0700 | [diff] [blame] | 101 | aidl_unittest.cpp \ |
| Christopher Wiley | f600a55 | 2015-09-12 14:07:44 -0700 | [diff] [blame] | 102 | ast_cpp_unittest.cpp \ |
| Christopher Wiley | fdeb0f4 | 2015-09-11 15:38:22 -0700 | [diff] [blame] | 103 | ast_java_unittest.cpp \ |
| Casey Dahlin | a834dd4 | 2015-09-23 11:52:15 -0700 | [diff] [blame] | 104 | generate_cpp_unittest.cpp \ |
| Christopher Wiley | 3616d13 | 2015-09-01 11:07:48 -0700 | [diff] [blame] | 105 | options_unittest.cpp \ |
| Christopher Wiley | 856a869 | 2015-08-31 17:36:41 -0700 | [diff] [blame] | 106 | tests/end_to_end_tests.cpp \ |
| Christopher Wiley | 4a2884b | 2015-10-07 11:27:45 -0700 | [diff] [blame] | 107 | tests/fake_io_delegate.cpp \ |
| Christopher Wiley | db6c711 | 2015-10-18 12:10:12 -0700 | [diff] [blame] | 108 | tests/main.cpp \ |
| Christopher Wiley | af2d510 | 2015-10-18 11:36:23 -0700 | [diff] [blame] | 109 | tests/test_data_example_interface.cpp \ |
| 110 | tests/test_data_ping_responder.cpp \ |
| Christopher Wiley | ea6e382 | 2015-10-07 13:16:34 -0700 | [diff] [blame] | 111 | tests/test_util.cpp \ |
| Christopher Wiley | a8a2dc0 | 2015-09-28 16:35:31 -0700 | [diff] [blame] | 112 | type_cpp_unittest.cpp \ |
| Christopher Wiley | 4582ecb | 2015-09-25 13:27:45 -0700 | [diff] [blame] | 113 | type_java_unittest.cpp \ |
| Christopher Wiley | 856a869 | 2015-08-31 17:36:41 -0700 | [diff] [blame] | 114 | |
| Christopher Wiley | 3616d13 | 2015-09-01 11:07:48 -0700 | [diff] [blame] | 115 | LOCAL_STATIC_LIBRARIES := \ |
| 116 | libaidl-common \ |
| Christopher Wiley | 7c3a1eb | 2015-09-12 10:19:52 -0700 | [diff] [blame] | 117 | $(aidl_static_libraries) \ |
| Christopher Wiley | 3616d13 | 2015-09-01 11:07:48 -0700 | [diff] [blame] | 118 | libgmock_host \ |
| 119 | libgtest_host \ |
| Christopher Wiley | f321efd | 2015-09-01 12:39:25 -0700 | [diff] [blame] | 120 | |
| Christopher Wiley | c545b7c | 2015-09-01 18:36:44 -0700 | [diff] [blame] | 121 | LOCAL_LDLIBS_linux := -lrt |
| Casey Dahlin | d8cc509 | 2015-08-28 15:46:48 -0700 | [diff] [blame] | 122 | include $(BUILD_HOST_NATIVE_TEST) |
| 123 | |
| Ying Wang | c7cf53e | 2014-03-07 15:55:14 -0800 | [diff] [blame] | 124 | endif # No TARGET_BUILD_APPS or TARGET_BUILD_PDK |
| Christopher Wiley | b5e698c | 2015-10-17 09:32:22 -0700 | [diff] [blame] | 125 | |
| Christopher Wiley | d0724f6 | 2015-11-19 07:25:29 -0800 | [diff] [blame] | 126 | # |
| 127 | # Everything below here is used for integration testing of generated AIDL code. |
| 128 | # |
| 129 | aidl_integration_test_cflags := $(aidl_cflags) -Wunused-parameter |
| 130 | aidl_integration_test_shared_libs := \ |
| Christopher Wiley | c795833 | 2016-02-01 09:56:03 -0800 | [diff] [blame] | 131 | libbase \ |
| Christopher Wiley | b5e698c | 2015-10-17 09:32:22 -0700 | [diff] [blame] | 132 | libbinder \ |
| 133 | liblog \ |
| 134 | libutils |
| Christopher Wiley | d0724f6 | 2015-11-19 07:25:29 -0800 | [diff] [blame] | 135 | |
| 136 | include $(CLEAR_VARS) |
| 137 | LOCAL_MODULE := libaidl-integration-test |
| 138 | LOCAL_MODULE_CLASS := SHARED_LIBRARIES |
| 139 | LOCAL_CFLAGS := $(aidl_integration_test_cflags) |
| Christopher Wiley | c795833 | 2016-02-01 09:56:03 -0800 | [diff] [blame] | 140 | LOCAL_SHARED_LIBRARIES := $(aidl_integration_test_shared_libs) |
| Samuel Tan | 88c3200 | 2015-12-03 16:30:43 -0800 | [diff] [blame] | 141 | LOCAL_AIDL_INCLUDES := \ |
| 142 | system/tools/aidl/tests/ \ |
| Samuel Tan | 13ace34 | 2016-01-12 16:18:22 -0800 | [diff] [blame] | 143 | frameworks/native/aidl/binder |
| Christopher Wiley | d0724f6 | 2015-11-19 07:25:29 -0800 | [diff] [blame] | 144 | LOCAL_SRC_FILES := \ |
| 145 | tests/android/aidl/tests/ITestService.aidl \ |
| Christopher Wiley | 996775a | 2015-11-19 07:03:45 -0800 | [diff] [blame] | 146 | tests/android/aidl/tests/INamedCallback.aidl \ |
| 147 | tests/simple_parcelable.cpp |
| Christopher Wiley | d0724f6 | 2015-11-19 07:25:29 -0800 | [diff] [blame] | 148 | include $(BUILD_SHARED_LIBRARY) |
| 149 | |
| 150 | include $(CLEAR_VARS) |
| 151 | LOCAL_MODULE := aidl_test_service |
| 152 | LOCAL_CFLAGS := $(aidl_integration_test_cflags) |
| 153 | LOCAL_SHARED_LIBRARIES := \ |
| 154 | libaidl-integration-test \ |
| 155 | $(aidl_integration_test_shared_libs) |
| 156 | LOCAL_SRC_FILES := \ |
| 157 | tests/aidl_test_service.cpp |
| Christopher Wiley | b5e698c | 2015-10-17 09:32:22 -0700 | [diff] [blame] | 158 | include $(BUILD_EXECUTABLE) |
| 159 | |
| 160 | include $(CLEAR_VARS) |
| Christopher Wiley | 33ad81e | 2015-10-21 14:41:11 -0700 | [diff] [blame] | 161 | LOCAL_MODULE := aidl_test_client |
| Christopher Wiley | d0724f6 | 2015-11-19 07:25:29 -0800 | [diff] [blame] | 162 | LOCAL_CFLAGS := $(aidl_integration_test_cflags) |
| Christopher Wiley | b5e698c | 2015-10-17 09:32:22 -0700 | [diff] [blame] | 163 | LOCAL_SHARED_LIBRARIES := \ |
| Christopher Wiley | d0724f6 | 2015-11-19 07:25:29 -0800 | [diff] [blame] | 164 | libaidl-integration-test \ |
| 165 | $(aidl_integration_test_shared_libs) |
| 166 | LOCAL_SRC_FILES := \ |
| Samuel Tan | 546d27d | 2015-12-03 15:06:01 -0800 | [diff] [blame] | 167 | tests/aidl_test_client.cpp \ |
| Christopher Wiley | 7621d4d | 2015-11-28 16:58:06 -0800 | [diff] [blame] | 168 | tests/aidl_test_client_file_descriptors.cpp \ |
| Samuel Tan | 546d27d | 2015-12-03 15:06:01 -0800 | [diff] [blame] | 169 | tests/aidl_test_client_parcelables.cpp \ |
| Casey Dahlin | 57dbe24 | 2015-12-04 11:44:02 -0800 | [diff] [blame] | 170 | tests/aidl_test_client_nullables.cpp \ |
| Christopher Wiley | 7621d4d | 2015-11-28 16:58:06 -0800 | [diff] [blame] | 171 | tests/aidl_test_client_primitives.cpp \ |
| Christopher Wiley | dca2ecf | 2016-01-29 10:55:43 -0800 | [diff] [blame] | 172 | tests/aidl_test_client_utf8_strings.cpp \ |
| Christopher Wiley | 7621d4d | 2015-11-28 16:58:06 -0800 | [diff] [blame] | 173 | tests/aidl_test_client_service_exceptions.cpp |
| Christopher Wiley | b5e698c | 2015-10-17 09:32:22 -0700 | [diff] [blame] | 174 | include $(BUILD_EXECUTABLE) |
| Christopher Wiley | 130e686 | 2015-10-18 17:53:11 -0700 | [diff] [blame] | 175 | |
| Christopher Wiley | 2971cf3 | 2015-10-23 11:50:21 -0700 | [diff] [blame] | 176 | include $(CLEAR_VARS) |
| 177 | LOCAL_MODULE := aidl_test_sentinel_searcher |
| 178 | LOCAL_SRC_FILES := tests/aidl_test_sentinel_searcher.cpp |
| Christopher Wiley | d0724f6 | 2015-11-19 07:25:29 -0800 | [diff] [blame] | 179 | LOCAL_CFLAGS := $(aidl_integration_test_cflags) |
| Christopher Wiley | 2971cf3 | 2015-10-23 11:50:21 -0700 | [diff] [blame] | 180 | include $(BUILD_EXECUTABLE) |
| 181 | |
| Christopher Wiley | 130e686 | 2015-10-18 17:53:11 -0700 | [diff] [blame] | 182 | |
| 183 | # aidl on its own doesn't need the framework, but testing native/java |
| 184 | # compatibility introduces java dependencies. |
| 185 | ifndef BRILLO |
| 186 | |
| 187 | include $(CLEAR_VARS) |
| 188 | LOCAL_PACKAGE_NAME := aidl_test_services |
| Christopher Wiley | 34bbc7b | 2015-11-09 09:24:36 -0800 | [diff] [blame] | 189 | # Turn off Java optimization tools to speed up our test iterations. |
| Christopher Wiley | 34bbc7b | 2015-11-09 09:24:36 -0800 | [diff] [blame] | 190 | LOCAL_PROGUARD_ENABLED := disabled |
| Christopher Wiley | 130e686 | 2015-10-18 17:53:11 -0700 | [diff] [blame] | 191 | LOCAL_DEX_PREOPT := false |
| 192 | LOCAL_CERTIFICATE := platform |
| 193 | LOCAL_MANIFEST_FILE := tests/java_app/AndroidManifest.xml |
| Christopher Wiley | 130e686 | 2015-10-18 17:53:11 -0700 | [diff] [blame] | 194 | LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/tests/java_app/resources |
| 195 | LOCAL_SRC_FILES := \ |
| Christopher Wiley | 521bb61 | 2015-10-22 11:40:30 -0700 | [diff] [blame] | 196 | tests/android/aidl/tests/ITestService.aidl \ |
| Casey Dahlin | 389781f | 2015-10-22 13:13:21 -0700 | [diff] [blame] | 197 | tests/android/aidl/tests/INamedCallback.aidl \ |
| Christopher Wiley | 996775a | 2015-11-19 07:03:45 -0800 | [diff] [blame] | 198 | tests/java_app/src/android/aidl/tests/SimpleParcelable.java \ |
| Christopher Wiley | 521bb61 | 2015-10-22 11:40:30 -0700 | [diff] [blame] | 199 | tests/java_app/src/android/aidl/tests/TestServiceClient.java |
| Samuel Tan | 13ace34 | 2016-01-12 16:18:22 -0800 | [diff] [blame] | 200 | LOCAL_AIDL_INCLUDES := \ |
| 201 | system/tools/aidl/tests/ \ |
| 202 | frameworks/native/aidl/binder |
| Christopher Wiley | 130e686 | 2015-10-18 17:53:11 -0700 | [diff] [blame] | 203 | include $(BUILD_PACKAGE) |
| 204 | |
| 205 | endif # not defined BRILLO |