Android.mk revision 4427d8654985209c1ebf2fb4705bb3e1a4262be2
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
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    Type.cpp \
32    aidl.cpp \
33    aidl_language.cpp \
34    aidl_language_l.l \
35    aidl_language_y.y \
36    ast_cpp.cpp \
37    ast_java.cpp \
38    code_writer.cpp \
39    generate_java.cpp \
40    generate_java_binder.cpp \
41    options.cpp \
42    search_path.cpp \
43
44include $(BUILD_HOST_STATIC_LIBRARY)
45
46
47# aidl executable
48include $(CLEAR_VARS)
49LOCAL_MODULE := aidl
50
51LOCAL_MODULE_HOST_OS := darwin linux windows
52LOCAL_CFLAGS := -Wall -Werror
53LOCAL_C_INCLUDES := external/gtest/include
54LOCAL_SRC_FILES := main.cpp
55LOCAL_STATIC_LIBRARIES := libaidl-common $(aidl_static_libraries)
56include $(BUILD_HOST_EXECUTABLE)
57
58
59# TODO(wiley) Compile these for mac as well after b/22771504
60ifeq ($(HOST_OS),linux)
61# Unit tests
62include $(CLEAR_VARS)
63LOCAL_MODULE := aidl_unittests
64
65LOCAL_CFLAGS := -g -DUNIT_TEST -Wall -Werror
66# Tragically, the code is riddled with unused parameters.
67LOCAL_CLANG_CFLAGS := -Wno-unused-parameter
68LOCAL_SRC_FILES := \
69    ast_cpp_unittest.cpp \
70    ast_java_unittest.cpp \
71    options_unittest.cpp \
72    test_main.cpp \
73    tests/end_to_end_tests.cpp \
74    tests/example_interface_test_data.cpp \
75
76LOCAL_SHARED_LIBRARIES := \
77    libchrome-host \
78
79LOCAL_STATIC_LIBRARIES := \
80    libaidl-common \
81    $(aidl_static_libraries) \
82    libgmock_host \
83    libgtest_host \
84
85LOCAL_LDLIBS_linux := -lrt
86
87include $(BUILD_HOST_NATIVE_TEST)
88endif # HOST_OS == linux
89
90endif # No TARGET_BUILD_APPS or TARGET_BUILD_PDK
91