blob: 7ebdf2b42924b2bbb46da775f2c54165134cc44f [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 \
Alex Vakulenko2e32e932015-10-27 11:47:43 -070040 libbrillo \
41 libbrillo-dbus \
42 libbrillo-http \
43 libbrillo-stream \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070044 libchrome \
45 libchrome-dbus \
Alex Vakulenko790643f2015-11-19 14:38:30 -080046 libcutils \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070047 libdbus \
Peter Qiu786a9062015-10-02 11:45:01 -070048 libshill-client \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070049 libweave \
Alex Vakulenko1642bec2015-08-19 09:34:58 -070050 libwebserv \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070051
Alex Vakulenkodf381642015-10-08 07:34:23 -070052ifdef BRILLO
53
54buffetSharedLibraries += \
55 libkeymaster_messages \
56 libkeystore_binder \
57
58endif
59
Alex Vakulenkod78756d2015-08-11 12:32:02 -070060# buffet-common
61# ========================================================
62include $(CLEAR_VARS)
63LOCAL_MODULE := buffet-common
64LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
65LOCAL_CFLAGS := $(buffetCommonCFlags)
Alex Vakulenko14b3e6e2015-12-10 10:01:36 -080066# TODO(avakulenko): Remove -Wno-deprecated-declarations when legacy libweave
67# APIs are removed (see: b/25917708).
68LOCAL_CPPFLAGS := $(buffetCommonCppFlags) -Wno-deprecated-declarations
Alex Vakulenkod78756d2015-08-11 12:32:02 -070069LOCAL_C_INCLUDES := $(buffetCommonCIncludes)
70LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries)
71LOCAL_STATIC_LIBRARIES :=
72LOCAL_RTTI_FLAG := -frtti
73LOCAL_CLANG := true
74LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
75
76LOCAL_SRC_FILES := \
Peter Qiu786a9062015-10-02 11:45:01 -070077 buffet/ap_manager_client.cc \
78 buffet/avahi_mdns_client.cc \
Alex Vakulenko0bc967f2015-08-18 11:22:07 -070079 buffet/buffet_config.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070080 buffet/dbus_command_dispatcher.cc \
81 buffet/dbus_command_proxy.cc \
82 buffet/dbus_conversion.cc \
83 buffet/dbus_constants.cc \
Peter Qiu786a9062015-10-02 11:45:01 -070084 buffet/flouride_socket_bluetooth_client.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070085 buffet/http_transport_client.cc \
86 buffet/manager.cc \
Peter Qiu786a9062015-10-02 11:45:01 -070087 buffet/shill_client.cc \
Alex Vakulenko0bc967f2015-08-18 11:22:07 -070088 buffet/socket_stream.cc \
Alex Vakulenko1642bec2015-08-19 09:34:58 -070089 buffet/webserv_client.cc \
Christopher Wileyc21ae072015-08-19 13:46:58 -070090 buffet/dbus_bindings/dbus-service-config.json \
Christopher Wiley892a5c42015-08-21 13:41:43 -070091 buffet/dbus_bindings/com.android.Weave.Command.dbus-xml \
92 buffet/dbus_bindings/com.android.Weave.Manager.dbus-xml \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070093
Darren Krahn31196852015-10-19 20:24:56 +000094ifdef BRILLO
95LOCAL_SRC_FILES += buffet/keystore_encryptor.cc
96else
Alex Vakulenkodf381642015-10-08 07:34:23 -070097LOCAL_SRC_FILES += buffet/fake_encryptor.cc
Darren Krahn31196852015-10-19 20:24:56 +000098endif
Alex Vakulenkodf381642015-10-08 07:34:23 -070099
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700100include $(BUILD_STATIC_LIBRARY)
101
Alex Vakulenko790643f2015-11-19 14:38:30 -0800102# weaved-brillo-api
103# ========================================================
104include $(CLEAR_VARS)
105LOCAL_MODULE := weaved-brillo-api
106LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
107LOCAL_CFLAGS := $(buffetCommonCFlags)
108LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
109LOCAL_CLANG := true
110LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
111
112LOCAL_SRC_FILES := \
113 brillo/weaved_system_properties.cc \
114
115include $(BUILD_STATIC_LIBRARY)
116
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700117# weaved
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700118# ========================================================
119include $(CLEAR_VARS)
120LOCAL_MODULE := weaved
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700121LOCAL_REQUIRED_MODULES := \
Robert Gindacf92c662015-08-20 09:30:11 -0700122 avahi-daemon \
Alex Vakulenko63bdf082015-08-21 09:27:12 -0700123 com.android.Weave.conf \
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700124 libweaved \
Alex Vakulenko1642bec2015-08-19 09:34:58 -0700125 webservd \
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700126
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700127LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
128LOCAL_CFLAGS := $(buffetCommonCFlags)
129LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
130LOCAL_C_INCLUDES := $(buffetCommonCIncludes)
Jorge Lucangeli Obes87df55b2015-09-28 11:21:57 -0700131LOCAL_INIT_RC := weaved.rc
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700132LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries)
Alex Vakulenko790643f2015-11-19 14:38:30 -0800133LOCAL_STATIC_LIBRARIES := weaved-brillo-api
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700134LOCAL_WHOLE_STATIC_LIBRARIES := buffet-common
135LOCAL_CLANG := true
136LOCAL_RTTI_FLAG := -frtti
137
138LOCAL_SRC_FILES := \
139 buffet/main.cc
140
141include $(BUILD_EXECUTABLE)
142
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700143# libweaved-internal
Alex Vakulenkoee805c42015-08-20 10:37:49 -0700144# ========================================================
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700145# You do not want to depend on this. Depend on libweaved instead.
146# libweaved abstracts and helps you consume this interface.
Alex Vakulenkoee805c42015-08-20 10:37:49 -0700147include $(CLEAR_VARS)
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700148LOCAL_MODULE := libweaved-internal
Alex Vakulenkoee805c42015-08-20 10:37:49 -0700149LOCAL_DBUS_PROXY_PREFIX := buffet
150
151LOCAL_SRC_FILES := \
152 buffet/dbus_bindings/dbus-service-config.json \
Christopher Wiley892a5c42015-08-21 13:41:43 -0700153 buffet/dbus_bindings/com.android.Weave.Command.dbus-xml \
154 buffet/dbus_bindings/com.android.Weave.Manager.dbus-xml \
Alex Vakulenkoee805c42015-08-20 10:37:49 -0700155
156include $(BUILD_SHARED_LIBRARY)
157
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700158# libweaved
159# ========================================================
160include $(CLEAR_VARS)
161LOCAL_MODULE := libweaved
162LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
163LOCAL_CFLAGS := $(buffetCommonCFlags)
164LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
165LOCAL_C_INCLUDES := external/gtest/include
166LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
167LOCAL_SHARED_LIBRARIES := \
168 $(buffetSharedLibraries) \
169 libweaved-internal \
170
171LOCAL_STATIC_LIBRARIES :=
172LOCAL_RTTI_FLAG := -frtti
173LOCAL_CLANG := true
174
175LOCAL_SRC_FILES := \
176 libweaved/command.cc \
177 libweaved/device.cc \
178
179include $(BUILD_SHARED_LIBRARY)
180
Alex Vakulenko8a808bc2015-11-12 15:50:11 -0800181# weaved_test
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700182# ========================================================
183include $(CLEAR_VARS)
Alex Vakulenko8a808bc2015-11-12 15:50:11 -0800184LOCAL_MODULE := weaved_test
185LOCAL_MODULE_TAGS := debug
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700186LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
187LOCAL_CFLAGS := $(buffetCommonCFlags)
188LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
189LOCAL_C_INCLUDES := \
190 $(buffetCommonCIncludes) \
191 external/gmock/include \
192
193LOCAL_SHARED_LIBRARIES := \
194 $(buffetSharedLibraries) \
195
196LOCAL_STATIC_LIBRARIES := \
197 buffet-common \
Alex Vakulenko2e32e932015-10-27 11:47:43 -0700198 libbrillo-test-helpers \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700199 libchrome_dbus_test_helpers \
200 libchrome_test_helpers \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700201 libgtest \
202 libgmock \
203 libweave-test \
Alex Vakulenko790643f2015-11-19 14:38:30 -0800204 weaved-brillo-api \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700205
206LOCAL_RTTI_FLAG := -frtti
207LOCAL_CLANG := true
208
209LOCAL_SRC_FILES := \
Alex Vakulenkodf381642015-10-08 07:34:23 -0700210 buffet/buffet_config_unittest.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700211 buffet/buffet_testrunner.cc \
212 buffet/dbus_command_proxy_unittest.cc \
213 buffet/dbus_conversion_unittest.cc \
214
215include $(BUILD_NATIVE_TEST)
216
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700217# DBus config files for /etc/dbus-1
218# ========================================================
219include $(CLEAR_VARS)
Alex Vakulenko63bdf082015-08-21 09:27:12 -0700220LOCAL_MODULE := com.android.Weave.conf
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700221LOCAL_MODULE_CLASS := ETC
222LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/dbus-1
Alex Vakulenko63bdf082015-08-21 09:27:12 -0700223LOCAL_SRC_FILES := buffet/etc/dbus-1/com.android.Weave.conf
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700224include $(BUILD_PREBUILT)