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