blob: d11264e7da5ef3ba6f36a3ba2ac79ccdee766edd [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
10# Logic shared between aidl and its unittests
The Android Open Source Project46c012c2008-10-21 07:00:00 -070011include $(CLEAR_VARS)
Christopher Wiley3616d132015-09-01 11:07:48 -070012LOCAL_MODULE := libaidl-common
Dan Willemseneada0252015-09-04 14:21:26 -070013LOCAL_MODULE_HOST_OS := darwin linux windows
The Android Open Source Project46c012c2008-10-21 07:00:00 -070014
Christopher Wileye0146cf2015-08-24 15:06:58 -070015LOCAL_CLANG_CFLAGS := -Wall -Werror
16# Tragically, the code is riddled with unused parameters.
17LOCAL_CLANG_CFLAGS += -Wno-unused-parameter
18# yacc dumps a lot of code *just in case*.
19LOCAL_CLANG_CFLAGS += -Wno-unused-function
20LOCAL_CLANG_CFLAGS += -Wno-unneeded-internal-declaration
21# yacc is a tool from a more civilized age.
22LOCAL_CLANG_CFLAGS += -Wno-deprecated-register
23# yacc also has a habit of using char* over const char*.
24LOCAL_CLANG_CFLAGS += -Wno-writable-strings
25
The Android Open Source Project46c012c2008-10-21 07:00:00 -070026LOCAL_SRC_FILES := \
Christopher Wiley89e35862015-08-30 10:57:07 -070027 AST.cpp \
28 Type.cpp \
29 aidl.cpp \
30 aidl_language.cpp \
31 aidl_language_l.l \
32 aidl_language_y.y \
33 generate_java.cpp \
34 generate_java_binder.cpp \
Christopher Wiley89e35862015-08-30 10:57:07 -070035 options.cpp \
36 search_path.cpp \
The Android Open Source Project46c012c2008-10-21 07:00:00 -070037
Christopher Wiley3616d132015-09-01 11:07:48 -070038include $(BUILD_HOST_STATIC_LIBRARY)
The Android Open Source Project46c012c2008-10-21 07:00:00 -070039
Christopher Wiley3616d132015-09-01 11:07:48 -070040
41# aidl executable
42include $(CLEAR_VARS)
43LOCAL_MODULE := aidl
44
45LOCAL_MODULE_HOST_OS := darwin linux windows
46LOCAL_CFLAGS := -Wall -Werror
47LOCAL_SRC_FILES := main.cpp
48LOCAL_STATIC_LIBRARIES := libaidl-common
The Android Open Source Project46c012c2008-10-21 07:00:00 -070049include $(BUILD_HOST_EXECUTABLE)
50
Christopher Wiley3616d132015-09-01 11:07:48 -070051
Christopher Wiley856a8692015-08-31 17:36:41 -070052# TODO(wiley) Compile these for mac as well after b/22771504
53ifeq ($(HOST_OS),linux)
Casey Dahlind8cc5092015-08-28 15:46:48 -070054# Unit tests
55include $(CLEAR_VARS)
56LOCAL_MODULE := aidl_unittests
Christopher Wiley3616d132015-09-01 11:07:48 -070057
58LOCAL_CFLAGS := -g -DUNIT_TEST -Wall -Werror
Christopher Wiley856a8692015-08-31 17:36:41 -070059# Tragically, the code is riddled with unused parameters.
60LOCAL_CLANG_CFLAGS := -Wno-unused-parameter
Christopher Wiley3616d132015-09-01 11:07:48 -070061LOCAL_SRC_FILES := \
62 options_unittest.cpp \
Christopher Wileyf321efd2015-09-01 12:39:25 -070063 test_main.cpp \
Christopher Wiley856a8692015-08-31 17:36:41 -070064 tests/end_to_end_tests.cpp \
65 tests/example_interface_test_data.cpp \
66
67LOCAL_SHARED_LIBRARIES := \
68 libchrome-host \
Christopher Wiley3616d132015-09-01 11:07:48 -070069
70LOCAL_STATIC_LIBRARIES := \
71 libaidl-common \
72 libgmock_host \
73 libgtest_host \
Christopher Wileyf321efd2015-09-01 12:39:25 -070074
Christopher Wileyc545b7c2015-09-01 18:36:44 -070075LOCAL_LDLIBS_linux := -lrt
76
Casey Dahlind8cc5092015-08-28 15:46:48 -070077include $(BUILD_HOST_NATIVE_TEST)
Christopher Wiley856a8692015-08-31 17:36:41 -070078endif # HOST_OS == linux
Casey Dahlind8cc5092015-08-28 15:46:48 -070079
Ying Wangc7cf53e2014-03-07 15:55:14 -080080endif # No TARGET_BUILD_APPS or TARGET_BUILD_PDK