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