blob: c405446eb787ffa459d75d91ddedc93d99ebd16f [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 Wileyb8b59f62015-09-15 12:19:53 -070010aidl_static_libraries := libbase libcutils
Christopher Wiley7c3a1eb2015-09-12 10:19:52 -070011
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 Wiley4427d862015-09-14 11:07:39 -070017LOCAL_C_INCLUDES := external/gtest/include
Christopher Wileye0146cf2015-08-24 15:06:58 -070018LOCAL_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
Christopher Wiley7c3a1eb2015-09-12 10:19:52 -070028LOCAL_STATIC_LIBRARIES := $(aidl_static_libraries)
Christopher Wileye0146cf2015-08-24 15:06:58 -070029
The Android Open Source Project46c012c2008-10-21 07:00:00 -070030LOCAL_SRC_FILES := \
Christopher Wiley89e35862015-08-30 10:57:07 -070031 aidl.cpp \
32 aidl_language.cpp \
33 aidl_language_l.l \
34 aidl_language_y.y \
Christopher Wileyf600a552015-09-12 14:07:44 -070035 ast_cpp.cpp \
Christopher Wiley038485e2015-09-12 11:14:14 -070036 ast_java.cpp \
Christopher Wileyfdeb0f42015-09-11 15:38:22 -070037 code_writer.cpp \
Christopher Wileyeb1acc12015-09-16 11:25:13 -070038 generate_cpp.cpp \
Christopher Wiley89e35862015-08-30 10:57:07 -070039 generate_java.cpp \
40 generate_java_binder.cpp \
Christopher Wiley4a2884b2015-10-07 11:27:45 -070041 io_delegate.cpp \
Christopher Wiley89e35862015-08-30 10:57:07 -070042 options.cpp \
Christopher Wileyf690be52015-09-14 15:19:10 -070043 parse_helpers.cpp \
Christopher Wiley89e35862015-08-30 10:57:07 -070044 search_path.cpp \
Christopher Wileya8a2dc02015-09-28 16:35:31 -070045 type_cpp.cpp \
Christopher Wiley775fa1f2015-09-22 15:00:12 -070046 type_java.cpp \
Christopher Wileyfb4b22d2015-09-25 15:16:13 -070047 type_namespace.cpp \
The Android Open Source Project46c012c2008-10-21 07:00:00 -070048
Christopher Wiley3616d132015-09-01 11:07:48 -070049include $(BUILD_HOST_STATIC_LIBRARY)
The Android Open Source Project46c012c2008-10-21 07:00:00 -070050
Christopher Wiley3616d132015-09-01 11:07:48 -070051
52# aidl executable
53include $(CLEAR_VARS)
54LOCAL_MODULE := aidl
55
56LOCAL_MODULE_HOST_OS := darwin linux windows
57LOCAL_CFLAGS := -Wall -Werror
Christopher Wiley4427d862015-09-14 11:07:39 -070058LOCAL_C_INCLUDES := external/gtest/include
Christopher Wiley89eaab52015-09-15 14:46:46 -070059LOCAL_SRC_FILES := main_java.cpp
Christopher Wiley7c3a1eb2015-09-12 10:19:52 -070060LOCAL_STATIC_LIBRARIES := libaidl-common $(aidl_static_libraries)
The Android Open Source Project46c012c2008-10-21 07:00:00 -070061include $(BUILD_HOST_EXECUTABLE)
62
Christopher Wileya590de82015-09-15 15:46:28 -070063# aidl-cpp executable
64include $(CLEAR_VARS)
65LOCAL_MODULE := aidl-cpp
66
67LOCAL_MODULE_HOST_OS := darwin linux windows
68LOCAL_CFLAGS := -Wall -Werror
69LOCAL_C_INCLUDES := external/gtest/include
70LOCAL_SRC_FILES := main_cpp.cpp
71LOCAL_STATIC_LIBRARIES := libaidl-common $(aidl_static_libraries)
72include $(BUILD_HOST_EXECUTABLE)
73
Christopher Wiley3616d132015-09-01 11:07:48 -070074
Christopher Wiley856a8692015-08-31 17:36:41 -070075# TODO(wiley) Compile these for mac as well after b/22771504
76ifeq ($(HOST_OS),linux)
Casey Dahlind8cc5092015-08-28 15:46:48 -070077# Unit tests
78include $(CLEAR_VARS)
79LOCAL_MODULE := aidl_unittests
Christopher Wiley3616d132015-09-01 11:07:48 -070080
81LOCAL_CFLAGS := -g -DUNIT_TEST -Wall -Werror
Christopher Wiley856a8692015-08-31 17:36:41 -070082# Tragically, the code is riddled with unused parameters.
83LOCAL_CLANG_CFLAGS := -Wno-unused-parameter
Christopher Wiley3616d132015-09-01 11:07:48 -070084LOCAL_SRC_FILES := \
Christopher Wileyf600a552015-09-12 14:07:44 -070085 ast_cpp_unittest.cpp \
Christopher Wileyfdeb0f42015-09-11 15:38:22 -070086 ast_java_unittest.cpp \
Casey Dahlina834dd42015-09-23 11:52:15 -070087 generate_cpp_unittest.cpp \
Christopher Wiley3616d132015-09-01 11:07:48 -070088 options_unittest.cpp \
Christopher Wileyf690be52015-09-14 15:19:10 -070089 parse_helpers_unittest.cpp \
Christopher Wileyf321efd2015-09-01 12:39:25 -070090 test_main.cpp \
Christopher Wiley856a8692015-08-31 17:36:41 -070091 tests/end_to_end_tests.cpp \
92 tests/example_interface_test_data.cpp \
Christopher Wiley4a2884b2015-10-07 11:27:45 -070093 tests/fake_io_delegate.cpp \
Christopher Wileya8a2dc02015-09-28 16:35:31 -070094 type_cpp_unittest.cpp \
Christopher Wiley4582ecb2015-09-25 13:27:45 -070095 type_java_unittest.cpp \
Christopher Wiley856a8692015-08-31 17:36:41 -070096
97LOCAL_SHARED_LIBRARIES := \
98 libchrome-host \
Christopher Wiley3616d132015-09-01 11:07:48 -070099
100LOCAL_STATIC_LIBRARIES := \
101 libaidl-common \
Christopher Wiley7c3a1eb2015-09-12 10:19:52 -0700102 $(aidl_static_libraries) \
Christopher Wiley3616d132015-09-01 11:07:48 -0700103 libgmock_host \
104 libgtest_host \
Christopher Wileyf321efd2015-09-01 12:39:25 -0700105
Christopher Wileyc545b7c2015-09-01 18:36:44 -0700106LOCAL_LDLIBS_linux := -lrt
107
Casey Dahlind8cc5092015-08-28 15:46:48 -0700108include $(BUILD_HOST_NATIVE_TEST)
Christopher Wiley856a8692015-08-31 17:36:41 -0700109endif # HOST_OS == linux
Casey Dahlind8cc5092015-08-28 15:46:48 -0700110
Ying Wangc7cf53e2014-03-07 15:55:14 -0800111endif # No TARGET_BUILD_APPS or TARGET_BUILD_PDK