blob: 7f8ac065b176a0a59a522470de48a42d9bf0f6ee [file] [log] [blame]
Alex Vakulenkod78756d2015-08-11 12:32:02 -07001# Copyright (C) 2015 The Android Open Source Project
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15LOCAL_PATH := $(call my-dir)
16
Alex Vakulenkod78756d2015-08-11 12:32:02 -070017# Common variables
18# ========================================================
19
20buffetCommonCppExtension := .cc
Alex Vakulenkof0f55342015-08-18 15:51:40 -070021buffetCommonCFlags := -DBUFFET_USE_WIFI_BOOTSTRAPPING -Wall -Werror \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070022 -Wno-char-subscripts -Wno-missing-field-initializers \
Alex Vakulenkof0f55342015-08-18 15:51:40 -070023 -Wno-unused-function -Wno-unused-parameter \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070024
25buffetCommonCppFlags := \
26 -Wno-deprecated-register \
27 -Wno-sign-compare \
28 -Wno-sign-promo \
29 -Wno-non-virtual-dtor \
30
31buffetCommonCIncludes := \
32 $(LOCAL_PATH)/.. \
33 $(LOCAL_PATH)/dbus-proxies \
Peter Qiu786a9062015-10-02 11:45:01 -070034 external/cros/system_api \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070035 external/gtest/include \
36
37buffetSharedLibraries := \
Peter Qiu786a9062015-10-02 11:45:01 -070038 libapmanager-client \
Robert Gindacf92c662015-08-20 09:30:11 -070039 libavahi-common \
Casey Dahlin494b7242015-12-14 11:42:47 -080040 libavahi-client \
Alex Vakulenko2e32e932015-10-27 11:47:43 -070041 libbrillo \
42 libbrillo-dbus \
43 libbrillo-http \
44 libbrillo-stream \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070045 libchrome \
46 libchrome-dbus \
Alex Vakulenko790643f2015-11-19 14:38:30 -080047 libcutils \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070048 libdbus \
Peter Qiu786a9062015-10-02 11:45:01 -070049 libshill-client \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070050 libweave \
Alex Vakulenko1642bec2015-08-19 09:34:58 -070051 libwebserv \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070052
Alex Vakulenkodf381642015-10-08 07:34:23 -070053ifdef BRILLO
54
55buffetSharedLibraries += \
56 libkeymaster_messages \
57 libkeystore_binder \
58
59endif
60
Alex Vakulenkod78756d2015-08-11 12:32:02 -070061# buffet-common
62# ========================================================
63include $(CLEAR_VARS)
64LOCAL_MODULE := buffet-common
65LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
66LOCAL_CFLAGS := $(buffetCommonCFlags)
Alex Vakulenko14b3e6e2015-12-10 10:01:36 -080067# TODO(avakulenko): Remove -Wno-deprecated-declarations when legacy libweave
68# APIs are removed (see: b/25917708).
69LOCAL_CPPFLAGS := $(buffetCommonCppFlags) -Wno-deprecated-declarations
Alex Vakulenkod78756d2015-08-11 12:32:02 -070070LOCAL_C_INCLUDES := $(buffetCommonCIncludes)
71LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries)
72LOCAL_STATIC_LIBRARIES :=
73LOCAL_RTTI_FLAG := -frtti
74LOCAL_CLANG := true
75LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
76
77LOCAL_SRC_FILES := \
Peter Qiu786a9062015-10-02 11:45:01 -070078 buffet/ap_manager_client.cc \
79 buffet/avahi_mdns_client.cc \
Alex Vakulenko0bc967f2015-08-18 11:22:07 -070080 buffet/buffet_config.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070081 buffet/dbus_command_dispatcher.cc \
82 buffet/dbus_command_proxy.cc \
83 buffet/dbus_conversion.cc \
84 buffet/dbus_constants.cc \
Peter Qiu786a9062015-10-02 11:45:01 -070085 buffet/flouride_socket_bluetooth_client.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070086 buffet/http_transport_client.cc \
87 buffet/manager.cc \
Peter Qiu786a9062015-10-02 11:45:01 -070088 buffet/shill_client.cc \
Alex Vakulenko0bc967f2015-08-18 11:22:07 -070089 buffet/socket_stream.cc \
Alex Vakulenko1642bec2015-08-19 09:34:58 -070090 buffet/webserv_client.cc \
Christopher Wileyc21ae072015-08-19 13:46:58 -070091 buffet/dbus_bindings/dbus-service-config.json \
Christopher Wiley892a5c42015-08-21 13:41:43 -070092 buffet/dbus_bindings/com.android.Weave.Command.dbus-xml \
93 buffet/dbus_bindings/com.android.Weave.Manager.dbus-xml \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070094
Darren Krahn31196852015-10-19 20:24:56 +000095ifdef BRILLO
96LOCAL_SRC_FILES += buffet/keystore_encryptor.cc
97else
Alex Vakulenkodf381642015-10-08 07:34:23 -070098LOCAL_SRC_FILES += buffet/fake_encryptor.cc
Darren Krahn31196852015-10-19 20:24:56 +000099endif
Alex Vakulenkodf381642015-10-08 07:34:23 -0700100
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700101include $(BUILD_STATIC_LIBRARY)
102
Alex Vakulenko790643f2015-11-19 14:38:30 -0800103# weaved-brillo-api
104# ========================================================
105include $(CLEAR_VARS)
106LOCAL_MODULE := weaved-brillo-api
107LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
108LOCAL_CFLAGS := $(buffetCommonCFlags)
109LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
110LOCAL_CLANG := true
111LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
112
113LOCAL_SRC_FILES := \
114 brillo/weaved_system_properties.cc \
115
116include $(BUILD_STATIC_LIBRARY)
117
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700118# weaved
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700119# ========================================================
120include $(CLEAR_VARS)
121LOCAL_MODULE := weaved
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700122LOCAL_REQUIRED_MODULES := \
Robert Gindacf92c662015-08-20 09:30:11 -0700123 avahi-daemon \
Alex Vakulenko63bdf082015-08-21 09:27:12 -0700124 com.android.Weave.conf \
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700125 libweaved \
Alex Vakulenko1642bec2015-08-19 09:34:58 -0700126 webservd \
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700127
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700128LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
129LOCAL_CFLAGS := $(buffetCommonCFlags)
130LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
131LOCAL_C_INCLUDES := $(buffetCommonCIncludes)
Jorge Lucangeli Obes87df55b2015-09-28 11:21:57 -0700132LOCAL_INIT_RC := weaved.rc
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700133LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries)
Alex Vakulenko790643f2015-11-19 14:38:30 -0800134LOCAL_STATIC_LIBRARIES := weaved-brillo-api
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700135LOCAL_WHOLE_STATIC_LIBRARIES := buffet-common
136LOCAL_CLANG := true
137LOCAL_RTTI_FLAG := -frtti
138
139LOCAL_SRC_FILES := \
140 buffet/main.cc
141
142include $(BUILD_EXECUTABLE)
143
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700144# libweaved-internal
Alex Vakulenkoee805c42015-08-20 10:37:49 -0700145# ========================================================
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700146# You do not want to depend on this. Depend on libweaved instead.
147# libweaved abstracts and helps you consume this interface.
Alex Vakulenkoee805c42015-08-20 10:37:49 -0700148include $(CLEAR_VARS)
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700149LOCAL_MODULE := libweaved-internal
Alex Vakulenkoee805c42015-08-20 10:37:49 -0700150LOCAL_DBUS_PROXY_PREFIX := buffet
151
152LOCAL_SRC_FILES := \
153 buffet/dbus_bindings/dbus-service-config.json \
Christopher Wiley892a5c42015-08-21 13:41:43 -0700154 buffet/dbus_bindings/com.android.Weave.Command.dbus-xml \
155 buffet/dbus_bindings/com.android.Weave.Manager.dbus-xml \
Alex Vakulenkoee805c42015-08-20 10:37:49 -0700156
157include $(BUILD_SHARED_LIBRARY)
158
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700159# libweaved
160# ========================================================
161include $(CLEAR_VARS)
162LOCAL_MODULE := libweaved
163LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
164LOCAL_CFLAGS := $(buffetCommonCFlags)
165LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
166LOCAL_C_INCLUDES := external/gtest/include
167LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
168LOCAL_SHARED_LIBRARIES := \
169 $(buffetSharedLibraries) \
170 libweaved-internal \
171
172LOCAL_STATIC_LIBRARIES :=
173LOCAL_RTTI_FLAG := -frtti
174LOCAL_CLANG := true
175
176LOCAL_SRC_FILES := \
177 libweaved/command.cc \
178 libweaved/device.cc \
179
180include $(BUILD_SHARED_LIBRARY)
181
Alex Vakulenko8a808bc2015-11-12 15:50:11 -0800182# weaved_test
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700183# ========================================================
184include $(CLEAR_VARS)
Alex Vakulenko8a808bc2015-11-12 15:50:11 -0800185LOCAL_MODULE := weaved_test
186LOCAL_MODULE_TAGS := debug
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700187LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
188LOCAL_CFLAGS := $(buffetCommonCFlags)
189LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
190LOCAL_C_INCLUDES := \
191 $(buffetCommonCIncludes) \
192 external/gmock/include \
193
194LOCAL_SHARED_LIBRARIES := \
195 $(buffetSharedLibraries) \
196
197LOCAL_STATIC_LIBRARIES := \
198 buffet-common \
Alex Vakulenko2e32e932015-10-27 11:47:43 -0700199 libbrillo-test-helpers \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700200 libchrome_dbus_test_helpers \
201 libchrome_test_helpers \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700202 libgtest \
203 libgmock \
204 libweave-test \
Alex Vakulenko790643f2015-11-19 14:38:30 -0800205 weaved-brillo-api \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700206
207LOCAL_RTTI_FLAG := -frtti
208LOCAL_CLANG := true
209
210LOCAL_SRC_FILES := \
Alex Vakulenkodf381642015-10-08 07:34:23 -0700211 buffet/buffet_config_unittest.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700212 buffet/buffet_testrunner.cc \
213 buffet/dbus_command_proxy_unittest.cc \
214 buffet/dbus_conversion_unittest.cc \
215
216include $(BUILD_NATIVE_TEST)
217
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700218# DBus config files for /etc/dbus-1
219# ========================================================
220include $(CLEAR_VARS)
Alex Vakulenko63bdf082015-08-21 09:27:12 -0700221LOCAL_MODULE := com.android.Weave.conf
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700222LOCAL_MODULE_CLASS := ETC
223LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/dbus-1
Alex Vakulenko63bdf082015-08-21 09:27:12 -0700224LOCAL_SRC_FILES := buffet/etc/dbus-1/com.android.Weave.conf
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700225include $(BUILD_PREBUILT)