blob: b44852d29f5b6594acbb2416e5ad98ce9e45b46f [file] [log] [blame]
The Android Open Source Project46c012c2008-10-21 07:00:00 -07001# Copyright 2007 The Android Open Source Project
2#
3# Copies files into the directory structure described by a manifest
4
Joe Onorato54fba422010-06-10 18:34:55 -07005# This tool is prebuilt if we're doing an app-only build.
Ying Wangc7cf53e2014-03-07 15:55:14 -08006ifeq ($(TARGET_BUILD_APPS)$(filter true,$(TARGET_BUILD_PDK)),)
Joe Onorato54fba422010-06-10 18:34:55 -07007
The Android Open Source Project46c012c2008-10-21 07:00:00 -07008LOCAL_PATH:= $(call my-dir)
Christopher Wiley3616d132015-09-01 11:07:48 -07009
Christopher Wiley7c3a1eb2015-09-12 10:19:52 -070010aidl_static_libraries := libbase
11
Christopher Wiley3616d132015-09-01 11:07:48 -070012# Logic shared between aidl and its unittests
The Android Open Source Project46c012c2008-10-21 07:00:00 -070013include $(CLEAR_VARS)
Christopher Wiley3616d132015-09-01 11:07:48 -070014LOCAL_MODULE := libaidl-common
Dan Willemseneada0252015-09-04 14:21:26 -070015LOCAL_MODULE_HOST_OS := darwin linux windows
The Android Open Source Project46c012c2008-10-21 07:00:00 -070016
Christopher Wileye0146cf2015-08-24 15:06:58 -070017LOCAL_CLANG_CFLAGS := -Wall -Werror
18# Tragically, the code is riddled with unused parameters.
19LOCAL_CLANG_CFLAGS += -Wno-unused-parameter
20# yacc dumps a lot of code *just in case*.
21LOCAL_CLANG_CFLAGS += -Wno-unused-function
22LOCAL_CLANG_CFLAGS += -Wno-unneeded-internal-declaration
23# yacc is a tool from a more civilized age.
24LOCAL_CLANG_CFLAGS += -Wno-deprecated-register
25# yacc also has a habit of using char* over const char*.
26LOCAL_CLANG_CFLAGS += -Wno-writable-strings
Christopher Wiley7c3a1eb2015-09-12 10:19:52 -070027LOCAL_STATIC_LIBRARIES := $(aidl_static_libraries)
Christopher Wileye0146cf2015-08-24 15:06:58 -070028
The Android Open Source Project46c012c2008-10-21 07:00:00 -070029LOCAL_SRC_FILES := \
Christopher Wiley89e35862015-08-30 10:57:07 -070030 AST.cpp \
31 Type.cpp \
32 aidl.cpp \
33 aidl_language.cpp \
34 aidl_language_l.l \
35 aidl_language_y.y \
36 generate_java.cpp \
37 generate_java_binder.cpp \
Christopher Wiley89e35862015-08-30 10:57:07 -070038 options.cpp \
39 search_path.cpp \
The Android Open Source Project46c012c2008-10-21 07:00:00 -070040
Christopher Wiley3616d132015-09-01 11:07:48 -070041include $(BUILD_HOST_STATIC_LIBRARY)
The Android Open Source Project46c012c2008-10-21 07:00:00 -070042
Christopher Wiley3616d132015-09-01 11:07:48 -070043
44# aidl executable
45include $(CLEAR_VARS)
46LOCAL_MODULE := aidl
47
48LOCAL_MODULE_HOST_OS := darwin linux windows
49LOCAL_CFLAGS := -Wall -Werror
50LOCAL_SRC_FILES := main.cpp
Christopher Wiley7c3a1eb2015-09-12 10:19:52 -070051LOCAL_STATIC_LIBRARIES := libaidl-common $(aidl_static_libraries)
The Android Open Source Project46c012c2008-10-21 07:00:00 -070052include $(BUILD_HOST_EXECUTABLE)
53
Christopher Wiley3616d132015-09-01 11:07:48 -070054
Christopher Wiley856a8692015-08-31 17:36:41 -070055# TODO(wiley) Compile these for mac as well after b/22771504
56ifeq ($(HOST_OS),linux)
Casey Dahlind8cc5092015-08-28 15:46:48 -070057# Unit tests
58include $(CLEAR_VARS)
59LOCAL_MODULE := aidl_unittests
Christopher Wiley3616d132015-09-01 11:07:48 -070060
61LOCAL_CFLAGS := -g -DUNIT_TEST -Wall -Werror
Christopher Wiley856a8692015-08-31 17:36:41 -070062# Tragically, the code is riddled with unused parameters.
63LOCAL_CLANG_CFLAGS := -Wno-unused-parameter
Christopher Wiley3616d132015-09-01 11:07:48 -070064LOCAL_SRC_FILES := \
65 options_unittest.cpp \
Christopher Wileyf321efd2015-09-01 12:39:25 -070066 test_main.cpp \
Christopher Wiley856a8692015-08-31 17:36:41 -070067 tests/end_to_end_tests.cpp \
68 tests/example_interface_test_data.cpp \
69
70LOCAL_SHARED_LIBRARIES := \
71 libchrome-host \
Christopher Wiley3616d132015-09-01 11:07:48 -070072
73LOCAL_STATIC_LIBRARIES := \
74 libaidl-common \
Christopher Wiley7c3a1eb2015-09-12 10:19:52 -070075 $(aidl_static_libraries) \
Christopher Wiley3616d132015-09-01 11:07:48 -070076 libgmock_host \
77 libgtest_host \
Christopher Wileyf321efd2015-09-01 12:39:25 -070078
Christopher Wileyc545b7c2015-09-01 18:36:44 -070079LOCAL_LDLIBS_linux := -lrt
80
Casey Dahlind8cc5092015-08-28 15:46:48 -070081include $(BUILD_HOST_NATIVE_TEST)
Christopher Wiley856a8692015-08-31 17:36:41 -070082endif # HOST_OS == linux
Casey Dahlind8cc5092015-08-28 15:46:48 -070083
Ying Wangc7cf53e2014-03-07 15:55:14 -080084endif # No TARGET_BUILD_APPS or TARGET_BUILD_PDK