blob: 9d75d9db847f7ab678e99a754fdd7e22c38361b1 [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)
66LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
67LOCAL_C_INCLUDES := $(buffetCommonCIncludes)
68LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries)
69LOCAL_STATIC_LIBRARIES :=
70LOCAL_RTTI_FLAG := -frtti
71LOCAL_CLANG := true
72LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
73
74LOCAL_SRC_FILES := \
Peter Qiu786a9062015-10-02 11:45:01 -070075 buffet/ap_manager_client.cc \
76 buffet/avahi_mdns_client.cc \
Alex Vakulenko0bc967f2015-08-18 11:22:07 -070077 buffet/buffet_config.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070078 buffet/dbus_command_dispatcher.cc \
79 buffet/dbus_command_proxy.cc \
80 buffet/dbus_conversion.cc \
81 buffet/dbus_constants.cc \
Peter Qiu786a9062015-10-02 11:45:01 -070082 buffet/flouride_socket_bluetooth_client.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070083 buffet/http_transport_client.cc \
84 buffet/manager.cc \
Peter Qiu786a9062015-10-02 11:45:01 -070085 buffet/shill_client.cc \
Alex Vakulenko0bc967f2015-08-18 11:22:07 -070086 buffet/socket_stream.cc \
Alex Vakulenko1642bec2015-08-19 09:34:58 -070087 buffet/webserv_client.cc \
Christopher Wileyc21ae072015-08-19 13:46:58 -070088 buffet/dbus_bindings/dbus-service-config.json \
Christopher Wiley892a5c42015-08-21 13:41:43 -070089 buffet/dbus_bindings/com.android.Weave.Command.dbus-xml \
90 buffet/dbus_bindings/com.android.Weave.Manager.dbus-xml \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070091
Darren Krahn31196852015-10-19 20:24:56 +000092ifdef BRILLO
93LOCAL_SRC_FILES += buffet/keystore_encryptor.cc
94else
Alex Vakulenkodf381642015-10-08 07:34:23 -070095LOCAL_SRC_FILES += buffet/fake_encryptor.cc
Darren Krahn31196852015-10-19 20:24:56 +000096endif
Alex Vakulenkodf381642015-10-08 07:34:23 -070097
Alex Vakulenkod78756d2015-08-11 12:32:02 -070098include $(BUILD_STATIC_LIBRARY)
99
Alex Vakulenko790643f2015-11-19 14:38:30 -0800100# weaved-brillo-api
101# ========================================================
102include $(CLEAR_VARS)
103LOCAL_MODULE := weaved-brillo-api
104LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
105LOCAL_CFLAGS := $(buffetCommonCFlags)
106LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
107LOCAL_CLANG := true
108LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
109
110LOCAL_SRC_FILES := \
111 brillo/weaved_system_properties.cc \
112
113include $(BUILD_STATIC_LIBRARY)
114
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700115# weaved
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700116# ========================================================
117include $(CLEAR_VARS)
118LOCAL_MODULE := weaved
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700119LOCAL_REQUIRED_MODULES := \
Robert Gindacf92c662015-08-20 09:30:11 -0700120 avahi-daemon \
Alex Vakulenko63bdf082015-08-21 09:27:12 -0700121 com.android.Weave.conf \
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700122 libweaved \
Alex Vakulenko1642bec2015-08-19 09:34:58 -0700123 webservd \
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700124
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700125LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
126LOCAL_CFLAGS := $(buffetCommonCFlags)
127LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
128LOCAL_C_INCLUDES := $(buffetCommonCIncludes)
Jorge Lucangeli Obes87df55b2015-09-28 11:21:57 -0700129LOCAL_INIT_RC := weaved.rc
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700130LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries)
Alex Vakulenko790643f2015-11-19 14:38:30 -0800131LOCAL_STATIC_LIBRARIES := weaved-brillo-api
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700132LOCAL_WHOLE_STATIC_LIBRARIES := buffet-common
133LOCAL_CLANG := true
134LOCAL_RTTI_FLAG := -frtti
135
136LOCAL_SRC_FILES := \
137 buffet/main.cc
138
139include $(BUILD_EXECUTABLE)
140
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700141# libweaved-internal
Alex Vakulenkoee805c42015-08-20 10:37:49 -0700142# ========================================================
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700143# You do not want to depend on this. Depend on libweaved instead.
144# libweaved abstracts and helps you consume this interface.
Alex Vakulenkoee805c42015-08-20 10:37:49 -0700145include $(CLEAR_VARS)
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700146LOCAL_MODULE := libweaved-internal
Alex Vakulenkoee805c42015-08-20 10:37:49 -0700147LOCAL_DBUS_PROXY_PREFIX := buffet
148
149LOCAL_SRC_FILES := \
150 buffet/dbus_bindings/dbus-service-config.json \
Christopher Wiley892a5c42015-08-21 13:41:43 -0700151 buffet/dbus_bindings/com.android.Weave.Command.dbus-xml \
152 buffet/dbus_bindings/com.android.Weave.Manager.dbus-xml \
Alex Vakulenkoee805c42015-08-20 10:37:49 -0700153
154include $(BUILD_SHARED_LIBRARY)
155
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700156# libweaved
157# ========================================================
158include $(CLEAR_VARS)
159LOCAL_MODULE := libweaved
160LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
161LOCAL_CFLAGS := $(buffetCommonCFlags)
162LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
163LOCAL_C_INCLUDES := external/gtest/include
164LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
165LOCAL_SHARED_LIBRARIES := \
166 $(buffetSharedLibraries) \
167 libweaved-internal \
168
169LOCAL_STATIC_LIBRARIES :=
170LOCAL_RTTI_FLAG := -frtti
171LOCAL_CLANG := true
172
173LOCAL_SRC_FILES := \
174 libweaved/command.cc \
175 libweaved/device.cc \
176
177include $(BUILD_SHARED_LIBRARY)
178
Alex Vakulenko8a808bc2015-11-12 15:50:11 -0800179# weaved_test
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700180# ========================================================
181include $(CLEAR_VARS)
Alex Vakulenko8a808bc2015-11-12 15:50:11 -0800182LOCAL_MODULE := weaved_test
183LOCAL_MODULE_TAGS := debug
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700184LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
185LOCAL_CFLAGS := $(buffetCommonCFlags)
186LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
187LOCAL_C_INCLUDES := \
188 $(buffetCommonCIncludes) \
189 external/gmock/include \
190
191LOCAL_SHARED_LIBRARIES := \
192 $(buffetSharedLibraries) \
193
194LOCAL_STATIC_LIBRARIES := \
195 buffet-common \
Alex Vakulenko2e32e932015-10-27 11:47:43 -0700196 libbrillo-test-helpers \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700197 libchrome_dbus_test_helpers \
198 libchrome_test_helpers \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700199 libgtest \
200 libgmock \
201 libweave-test \
Alex Vakulenko790643f2015-11-19 14:38:30 -0800202 weaved-brillo-api \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700203
204LOCAL_RTTI_FLAG := -frtti
205LOCAL_CLANG := true
206
207LOCAL_SRC_FILES := \
Alex Vakulenkodf381642015-10-08 07:34:23 -0700208 buffet/buffet_config_unittest.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700209 buffet/buffet_testrunner.cc \
210 buffet/dbus_command_proxy_unittest.cc \
211 buffet/dbus_conversion_unittest.cc \
212
213include $(BUILD_NATIVE_TEST)
214
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700215# DBus config files for /etc/dbus-1
216# ========================================================
217include $(CLEAR_VARS)
Alex Vakulenko63bdf082015-08-21 09:27:12 -0700218LOCAL_MODULE := com.android.Weave.conf
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700219LOCAL_MODULE_CLASS := ETC
220LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/dbus-1
Alex Vakulenko63bdf082015-08-21 09:27:12 -0700221LOCAL_SRC_FILES := buffet/etc/dbus-1/com.android.Weave.conf
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700222include $(BUILD_PREBUILT)