blob: baf3bd5b58bc6ac48eae3322e0d4f5bdd00255f7 [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 :=
Alex Vakulenkod78756d2015-08-11 12:32:02 -070073LOCAL_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
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700136
137LOCAL_SRC_FILES := \
138 buffet/main.cc
139
140include $(BUILD_EXECUTABLE)
141
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700142# libweaved-internal
Alex Vakulenkoee805c42015-08-20 10:37:49 -0700143# ========================================================
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700144# You do not want to depend on this. Depend on libweaved instead.
145# libweaved abstracts and helps you consume this interface.
Alex Vakulenkoee805c42015-08-20 10:37:49 -0700146include $(CLEAR_VARS)
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700147LOCAL_MODULE := libweaved-internal
Alex Vakulenkoee805c42015-08-20 10:37:49 -0700148LOCAL_DBUS_PROXY_PREFIX := buffet
149
150LOCAL_SRC_FILES := \
151 buffet/dbus_bindings/dbus-service-config.json \
Christopher Wiley892a5c42015-08-21 13:41:43 -0700152 buffet/dbus_bindings/com.android.Weave.Command.dbus-xml \
153 buffet/dbus_bindings/com.android.Weave.Manager.dbus-xml \
Alex Vakulenkoee805c42015-08-20 10:37:49 -0700154
155include $(BUILD_SHARED_LIBRARY)
156
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700157# libweaved
158# ========================================================
159include $(CLEAR_VARS)
160LOCAL_MODULE := libweaved
161LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
162LOCAL_CFLAGS := $(buffetCommonCFlags)
163LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
164LOCAL_C_INCLUDES := external/gtest/include
165LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
166LOCAL_SHARED_LIBRARIES := \
167 $(buffetSharedLibraries) \
168 libweaved-internal \
169
170LOCAL_STATIC_LIBRARIES :=
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700171LOCAL_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
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700204LOCAL_CLANG := true
205
206LOCAL_SRC_FILES := \
Alex Vakulenkodf381642015-10-08 07:34:23 -0700207 buffet/buffet_config_unittest.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700208 buffet/buffet_testrunner.cc \
209 buffet/dbus_command_proxy_unittest.cc \
210 buffet/dbus_conversion_unittest.cc \
211
212include $(BUILD_NATIVE_TEST)
213
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700214# DBus config files for /etc/dbus-1
215# ========================================================
216include $(CLEAR_VARS)
Alex Vakulenko63bdf082015-08-21 09:27:12 -0700217LOCAL_MODULE := com.android.Weave.conf
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700218LOCAL_MODULE_CLASS := ETC
219LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/dbus-1
Alex Vakulenko63bdf082015-08-21 09:27:12 -0700220LOCAL_SRC_FILES := buffet/etc/dbus-1/com.android.Weave.conf
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700221include $(BUILD_PREBUILT)