| The Android Open Source Project | 46c012c | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 1 | # Copyright 2007 The Android Open Source Project |
| 2 | # |
| 3 | # Copies files into the directory structure described by a manifest |
| 4 | |
| Joe Onorato | 54fba42 | 2010-06-10 18:34:55 -0700 | [diff] [blame] | 5 | # This tool is prebuilt if we're doing an app-only build. |
| Ying Wang | c7cf53e | 2014-03-07 15:55:14 -0800 | [diff] [blame] | 6 | ifeq ($(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)),) |
| Joe Onorato | 54fba42 | 2010-06-10 18:34:55 -0700 | [diff] [blame] | 7 | |
| The Android Open Source Project | 46c012c | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 8 | LOCAL_PATH:= $(call my-dir) |
| Christopher Wiley | 3616d13 | 2015-09-01 11:07:48 -0700 | [diff] [blame] | 9 | |
| Christopher Wiley | b8b59f6 | 2015-09-15 12:19:53 -0700 | [diff] [blame^] | 10 | aidl_static_libraries := libbase libcutils |
| Christopher Wiley | 7c3a1eb | 2015-09-12 10:19:52 -0700 | [diff] [blame] | 11 | |
| Christopher Wiley | 3616d13 | 2015-09-01 11:07:48 -0700 | [diff] [blame] | 12 | # Logic shared between aidl and its unittests |
| The Android Open Source Project | 46c012c | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 13 | include $(CLEAR_VARS) |
| Christopher Wiley | 3616d13 | 2015-09-01 11:07:48 -0700 | [diff] [blame] | 14 | LOCAL_MODULE := libaidl-common |
| Dan Willemsen | eada025 | 2015-09-04 14:21:26 -0700 | [diff] [blame] | 15 | LOCAL_MODULE_HOST_OS := darwin linux windows |
| The Android Open Source Project | 46c012c | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 16 | |
| Christopher Wiley | 4427d86 | 2015-09-14 11:07:39 -0700 | [diff] [blame] | 17 | LOCAL_C_INCLUDES := external/gtest/include |
| Christopher Wiley | e0146cf | 2015-08-24 15:06:58 -0700 | [diff] [blame] | 18 | LOCAL_CLANG_CFLAGS := -Wall -Werror |
| 19 | # Tragically, the code is riddled with unused parameters. |
| 20 | LOCAL_CLANG_CFLAGS += -Wno-unused-parameter |
| 21 | # yacc dumps a lot of code *just in case*. |
| 22 | LOCAL_CLANG_CFLAGS += -Wno-unused-function |
| 23 | LOCAL_CLANG_CFLAGS += -Wno-unneeded-internal-declaration |
| 24 | # yacc is a tool from a more civilized age. |
| 25 | LOCAL_CLANG_CFLAGS += -Wno-deprecated-register |
| 26 | # yacc also has a habit of using char* over const char*. |
| 27 | LOCAL_CLANG_CFLAGS += -Wno-writable-strings |
| Christopher Wiley | 7c3a1eb | 2015-09-12 10:19:52 -0700 | [diff] [blame] | 28 | LOCAL_STATIC_LIBRARIES := $(aidl_static_libraries) |
| Christopher Wiley | e0146cf | 2015-08-24 15:06:58 -0700 | [diff] [blame] | 29 | |
| The Android Open Source Project | 46c012c | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 30 | LOCAL_SRC_FILES := \ |
| Christopher Wiley | 89e3586 | 2015-08-30 10:57:07 -0700 | [diff] [blame] | 31 | Type.cpp \ |
| 32 | aidl.cpp \ |
| 33 | aidl_language.cpp \ |
| 34 | aidl_language_l.l \ |
| 35 | aidl_language_y.y \ |
| Christopher Wiley | f600a55 | 2015-09-12 14:07:44 -0700 | [diff] [blame] | 36 | ast_cpp.cpp \ |
| Christopher Wiley | 038485e | 2015-09-12 11:14:14 -0700 | [diff] [blame] | 37 | ast_java.cpp \ |
| Christopher Wiley | fdeb0f4 | 2015-09-11 15:38:22 -0700 | [diff] [blame] | 38 | code_writer.cpp \ |
| Christopher Wiley | 89e3586 | 2015-08-30 10:57:07 -0700 | [diff] [blame] | 39 | generate_java.cpp \ |
| 40 | generate_java_binder.cpp \ |
| Christopher Wiley | 89e3586 | 2015-08-30 10:57:07 -0700 | [diff] [blame] | 41 | options.cpp \ |
| 42 | search_path.cpp \ |
| The Android Open Source Project | 46c012c | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 43 | |
| Christopher Wiley | 3616d13 | 2015-09-01 11:07:48 -0700 | [diff] [blame] | 44 | include $(BUILD_HOST_STATIC_LIBRARY) |
| The Android Open Source Project | 46c012c | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 45 | |
| Christopher Wiley | 3616d13 | 2015-09-01 11:07:48 -0700 | [diff] [blame] | 46 | |
| 47 | # aidl executable |
| 48 | include $(CLEAR_VARS) |
| 49 | LOCAL_MODULE := aidl |
| 50 | |
| 51 | LOCAL_MODULE_HOST_OS := darwin linux windows |
| 52 | LOCAL_CFLAGS := -Wall -Werror |
| Christopher Wiley | 4427d86 | 2015-09-14 11:07:39 -0700 | [diff] [blame] | 53 | LOCAL_C_INCLUDES := external/gtest/include |
| Christopher Wiley | 3616d13 | 2015-09-01 11:07:48 -0700 | [diff] [blame] | 54 | LOCAL_SRC_FILES := main.cpp |
| Christopher Wiley | 7c3a1eb | 2015-09-12 10:19:52 -0700 | [diff] [blame] | 55 | LOCAL_STATIC_LIBRARIES := libaidl-common $(aidl_static_libraries) |
| The Android Open Source Project | 46c012c | 2008-10-21 07:00:00 -0700 | [diff] [blame] | 56 | include $(BUILD_HOST_EXECUTABLE) |
| 57 | |
| Christopher Wiley | 3616d13 | 2015-09-01 11:07:48 -0700 | [diff] [blame] | 58 | |
| Christopher Wiley | 856a869 | 2015-08-31 17:36:41 -0700 | [diff] [blame] | 59 | # TODO(wiley) Compile these for mac as well after b/22771504 |
| 60 | ifeq ($(HOST_OS),linux) |
| Casey Dahlin | d8cc509 | 2015-08-28 15:46:48 -0700 | [diff] [blame] | 61 | # Unit tests |
| 62 | include $(CLEAR_VARS) |
| 63 | LOCAL_MODULE := aidl_unittests |
| Christopher Wiley | 3616d13 | 2015-09-01 11:07:48 -0700 | [diff] [blame] | 64 | |
| 65 | LOCAL_CFLAGS := -g -DUNIT_TEST -Wall -Werror |
| Christopher Wiley | 856a869 | 2015-08-31 17:36:41 -0700 | [diff] [blame] | 66 | # Tragically, the code is riddled with unused parameters. |
| 67 | LOCAL_CLANG_CFLAGS := -Wno-unused-parameter |
| Christopher Wiley | 3616d13 | 2015-09-01 11:07:48 -0700 | [diff] [blame] | 68 | LOCAL_SRC_FILES := \ |
| Christopher Wiley | f600a55 | 2015-09-12 14:07:44 -0700 | [diff] [blame] | 69 | ast_cpp_unittest.cpp \ |
| Christopher Wiley | fdeb0f4 | 2015-09-11 15:38:22 -0700 | [diff] [blame] | 70 | ast_java_unittest.cpp \ |
| Christopher Wiley | 3616d13 | 2015-09-01 11:07:48 -0700 | [diff] [blame] | 71 | options_unittest.cpp \ |
| Christopher Wiley | f321efd | 2015-09-01 12:39:25 -0700 | [diff] [blame] | 72 | test_main.cpp \ |
| Christopher Wiley | 856a869 | 2015-08-31 17:36:41 -0700 | [diff] [blame] | 73 | tests/end_to_end_tests.cpp \ |
| 74 | tests/example_interface_test_data.cpp \ |
| 75 | |
| 76 | LOCAL_SHARED_LIBRARIES := \ |
| 77 | libchrome-host \ |
| Christopher Wiley | 3616d13 | 2015-09-01 11:07:48 -0700 | [diff] [blame] | 78 | |
| 79 | LOCAL_STATIC_LIBRARIES := \ |
| 80 | libaidl-common \ |
| Christopher Wiley | 7c3a1eb | 2015-09-12 10:19:52 -0700 | [diff] [blame] | 81 | $(aidl_static_libraries) \ |
| Christopher Wiley | 3616d13 | 2015-09-01 11:07:48 -0700 | [diff] [blame] | 82 | libgmock_host \ |
| 83 | libgtest_host \ |
| Christopher Wiley | f321efd | 2015-09-01 12:39:25 -0700 | [diff] [blame] | 84 | |
| Christopher Wiley | c545b7c | 2015-09-01 18:36:44 -0700 | [diff] [blame] | 85 | LOCAL_LDLIBS_linux := -lrt |
| 86 | |
| Casey Dahlin | d8cc509 | 2015-08-28 15:46:48 -0700 | [diff] [blame] | 87 | include $(BUILD_HOST_NATIVE_TEST) |
| Christopher Wiley | 856a869 | 2015-08-31 17:36:41 -0700 | [diff] [blame] | 88 | endif # HOST_OS == linux |
| Casey Dahlin | d8cc509 | 2015-08-28 15:46:48 -0700 | [diff] [blame] | 89 | |
| Ying Wang | c7cf53e | 2014-03-07 15:55:14 -0800 | [diff] [blame] | 90 | endif # No TARGET_BUILD_APPS or TARGET_BUILD_PDK |