Android.mk revision 90be4e3fe6d16ea8e8263b80989ef2ab4e6ef9c6
1# Copyright 2007 The Android Open Source Project 2# 3# Copies files into the directory structure described by a manifest 4 5# This tool is prebuilt if we're doing an app-only build. 6ifeq ($(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)),) 7 8LOCAL_PATH:= $(call my-dir) 9 10aidl_static_libraries := libbase libcutils 11 12# Logic shared between aidl and its unittests 13include $(CLEAR_VARS) 14LOCAL_MODULE := libaidl-common 15LOCAL_MODULE_HOST_OS := darwin linux windows 16 17LOCAL_C_INCLUDES := external/gtest/include 18LOCAL_CLANG_CFLAGS := -Wall -Werror 19# Tragically, the code is riddled with unused parameters. 20LOCAL_CLANG_CFLAGS += -Wno-unused-parameter 21# yacc dumps a lot of code *just in case*. 22LOCAL_CLANG_CFLAGS += -Wno-unused-function 23LOCAL_CLANG_CFLAGS += -Wno-unneeded-internal-declaration 24# yacc is a tool from a more civilized age. 25LOCAL_CLANG_CFLAGS += -Wno-deprecated-register 26# yacc also has a habit of using char* over const char*. 27LOCAL_CLANG_CFLAGS += -Wno-writable-strings 28LOCAL_STATIC_LIBRARIES := $(aidl_static_libraries) 29 30LOCAL_SRC_FILES := \ 31 aidl.cpp \ 32 aidl_language.cpp \ 33 aidl_language_l.l \ 34 aidl_language_y.y \ 35 ast_cpp.cpp \ 36 ast_java.cpp \ 37 code_writer.cpp \ 38 generate_cpp.cpp \ 39 generate_java.cpp \ 40 generate_java_binder.cpp \ 41 import_resolver.cpp \ 42 io_delegate.cpp \ 43 options.cpp \ 44 type_cpp.cpp \ 45 type_java.cpp \ 46 type_namespace.cpp \ 47 48include $(BUILD_HOST_STATIC_LIBRARY) 49 50 51# aidl executable 52include $(CLEAR_VARS) 53LOCAL_MODULE := aidl 54 55LOCAL_MODULE_HOST_OS := darwin linux windows 56LOCAL_CFLAGS := -Wall -Werror 57LOCAL_C_INCLUDES := external/gtest/include 58LOCAL_SRC_FILES := main_java.cpp 59LOCAL_STATIC_LIBRARIES := libaidl-common $(aidl_static_libraries) 60include $(BUILD_HOST_EXECUTABLE) 61 62# aidl-cpp executable 63include $(CLEAR_VARS) 64LOCAL_MODULE := aidl-cpp 65 66LOCAL_MODULE_HOST_OS := darwin linux windows 67LOCAL_CFLAGS := -Wall -Werror 68LOCAL_C_INCLUDES := external/gtest/include 69LOCAL_SRC_FILES := main_cpp.cpp 70LOCAL_STATIC_LIBRARIES := libaidl-common $(aidl_static_libraries) 71include $(BUILD_HOST_EXECUTABLE) 72 73 74# TODO(wiley) Compile these for mac as well after b/22771504 75ifeq ($(HOST_OS),linux) 76# Unit tests 77include $(CLEAR_VARS) 78LOCAL_MODULE := aidl_unittests 79 80LOCAL_CFLAGS := -g -DUNIT_TEST -Wall -Werror 81# Tragically, the code is riddled with unused parameters. 82LOCAL_CLANG_CFLAGS := -Wno-unused-parameter 83LOCAL_SRC_FILES := \ 84 aidl_unittest.cpp \ 85 ast_cpp_unittest.cpp \ 86 ast_java_unittest.cpp \ 87 generate_cpp_unittest.cpp \ 88 options_unittest.cpp \ 89 tests/end_to_end_tests.cpp \ 90 tests/fake_io_delegate.cpp \ 91 tests/main.cpp \ 92 tests/test_data_example_interface.cpp \ 93 tests/test_data_ping_responder.cpp \ 94 tests/test_util.cpp \ 95 type_cpp_unittest.cpp \ 96 type_java_unittest.cpp \ 97 98LOCAL_SHARED_LIBRARIES := \ 99 libchrome-host \ 100 101LOCAL_STATIC_LIBRARIES := \ 102 libaidl-common \ 103 $(aidl_static_libraries) \ 104 libgmock_host \ 105 libgtest_host \ 106 107LOCAL_LDLIBS_linux := -lrt 108 109include $(BUILD_HOST_NATIVE_TEST) 110endif # HOST_OS == linux 111 112endif # No TARGET_BUILD_APPS or TARGET_BUILD_PDK 113 114include $(CLEAR_VARS) 115LOCAL_MODULE := hellod 116LOCAL_C_INCLUDES := tests/ping_responder 117LOCAL_SRC_FILES := \ 118 tests/ping_responder/aidl/android/os/IPingResponder.aidl \ 119 tests/ping_responder/hellod.cpp 120LOCAL_SHARED_LIBRARIES := \ 121 libbinder \ 122 liblog \ 123 libutils 124LOCAL_CFLAGS := -Wall -Wextra -Werror 125include $(BUILD_EXECUTABLE) 126 127include $(CLEAR_VARS) 128LOCAL_MODULE := helloc 129LOCAL_C_INCLUDES := tests/ping_responder 130LOCAL_SRC_FILES := \ 131 tests/ping_responder/aidl/android/os/IPingResponder.aidl \ 132 tests/ping_responder/helloc.cpp 133LOCAL_SHARED_LIBRARIES := \ 134 libbinder \ 135 liblog \ 136 libutils 137LOCAL_CFLAGS := -Wall -Wextra -Werror 138include $(BUILD_EXECUTABLE) 139