blob: 10d7ba3afd89b41a3c4d62e429cdbd5d77a4f505 [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)/.. \
Peter Qiu786a9062015-10-02 11:45:01 -070033 external/cros/system_api \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070034 external/gtest/include \
35
36buffetSharedLibraries := \
Peter Qiu786a9062015-10-02 11:45:01 -070037 libapmanager-client \
Robert Gindacf92c662015-08-20 09:30:11 -070038 libavahi-common \
Casey Dahlin494b7242015-12-14 11:42:47 -080039 libavahi-client \
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -080040 libbinder \
41 libbinderwrapper \
Alex Vakulenko2e32e932015-10-27 11:47:43 -070042 libbrillo \
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -080043 libbrillo-binder \
Alex Vakulenko2e32e932015-10-27 11:47:43 -070044 libbrillo-dbus \
45 libbrillo-http \
46 libbrillo-stream \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070047 libchrome \
48 libchrome-dbus \
Alex Vakulenko790643f2015-11-19 14:38:30 -080049 libcutils \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070050 libdbus \
Peter Qiu786a9062015-10-02 11:45:01 -070051 libshill-client \
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -080052 libutils \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070053 libweave \
Alex Vakulenko1642bec2015-08-19 09:34:58 -070054 libwebserv \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070055
Alex Vakulenkodf381642015-10-08 07:34:23 -070056ifdef BRILLO
57
58buffetSharedLibraries += \
59 libkeymaster_messages \
60 libkeystore_binder \
61
62endif
63
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -080064# weave-common
65# Code shared between weaved daemon and libweaved client library
Alex Vakulenkod78756d2015-08-11 12:32:02 -070066# ========================================================
67include $(CLEAR_VARS)
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -080068LOCAL_MODULE := weave-common
69LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
70LOCAL_CFLAGS := $(buffetCommonCFlags)
71LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
72LOCAL_C_INCLUDES := $(buffetCommonCIncludes)
73LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/brillo
74LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries)
75LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
76LOCAL_CLANG := true
77
78LOCAL_SRC_FILES := \
79 brillo/android/weave/IWeaveClient.aidl \
80 brillo/android/weave/IWeaveCommand.aidl \
81 brillo/android/weave/IWeaveService.aidl \
82 brillo/android/weave/IWeaveServiceManager.aidl \
83 brillo/android/weave/IWeaveServiceManagerNotificationListener.aidl \
84 common/binder_constants.cc \
85 common/binder_utils.cc \
86 common/data_conversion.cc \
87
88include $(BUILD_STATIC_LIBRARY)
89
90# weave-daemon-common
91# Code shared between weaved daemon and unit test runner.
92# This is essentially the implementation of weaved in a static library format.
93# ========================================================
94include $(CLEAR_VARS)
95LOCAL_MODULE := weave-daemon-common
Alex Vakulenkod78756d2015-08-11 12:32:02 -070096LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
97LOCAL_CFLAGS := $(buffetCommonCFlags)
Alex Vakulenko14b3e6e2015-12-10 10:01:36 -080098# TODO(avakulenko): Remove -Wno-deprecated-declarations when legacy libweave
99# APIs are removed (see: b/25917708).
100LOCAL_CPPFLAGS := $(buffetCommonCppFlags) -Wno-deprecated-declarations
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700101LOCAL_C_INCLUDES := $(buffetCommonCIncludes)
102LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries)
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800103LOCAL_STATIC_LIBRARIES := weave-common
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700104LOCAL_CLANG := true
105LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
106
107LOCAL_SRC_FILES := \
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800108 brillo/weaved_system_properties.cc \
Peter Qiu786a9062015-10-02 11:45:01 -0700109 buffet/ap_manager_client.cc \
110 buffet/avahi_mdns_client.cc \
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800111 buffet/binder_command_proxy.cc \
112 buffet/binder_weave_service.cc \
Alex Vakulenko0bc967f2015-08-18 11:22:07 -0700113 buffet/buffet_config.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700114 buffet/dbus_constants.cc \
Peter Qiu786a9062015-10-02 11:45:01 -0700115 buffet/flouride_socket_bluetooth_client.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700116 buffet/http_transport_client.cc \
117 buffet/manager.cc \
Peter Qiu786a9062015-10-02 11:45:01 -0700118 buffet/shill_client.cc \
Alex Vakulenko0bc967f2015-08-18 11:22:07 -0700119 buffet/socket_stream.cc \
Alex Vakulenko1642bec2015-08-19 09:34:58 -0700120 buffet/webserv_client.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700121
Darren Krahn31196852015-10-19 20:24:56 +0000122ifdef BRILLO
123LOCAL_SRC_FILES += buffet/keystore_encryptor.cc
124else
Alex Vakulenkodf381642015-10-08 07:34:23 -0700125LOCAL_SRC_FILES += buffet/fake_encryptor.cc
Darren Krahn31196852015-10-19 20:24:56 +0000126endif
Alex Vakulenkodf381642015-10-08 07:34:23 -0700127
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700128include $(BUILD_STATIC_LIBRARY)
129
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700130# weaved
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800131# The main binary of the weave daemon.
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700132# ========================================================
133include $(CLEAR_VARS)
134LOCAL_MODULE := weaved
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700135LOCAL_REQUIRED_MODULES := \
Robert Gindacf92c662015-08-20 09:30:11 -0700136 avahi-daemon \
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700137 libweaved \
Alex Vakulenko1642bec2015-08-19 09:34:58 -0700138 webservd \
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700139
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700140LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
141LOCAL_CFLAGS := $(buffetCommonCFlags)
142LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
143LOCAL_C_INCLUDES := $(buffetCommonCIncludes)
Jorge Lucangeli Obes87df55b2015-09-28 11:21:57 -0700144LOCAL_INIT_RC := weaved.rc
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700145LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries)
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800146LOCAL_STATIC_LIBRARIES := weave-common \
147
148LOCAL_WHOLE_STATIC_LIBRARIES := weave-daemon-common
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700149LOCAL_CLANG := true
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700150
151LOCAL_SRC_FILES := \
152 buffet/main.cc
153
154include $(BUILD_EXECUTABLE)
155
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700156# libweaved
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800157# The client library for the weave daemon. You should link to libweaved,
158# if you need to communicate with weaved.
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700159# ========================================================
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)
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800167LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries)
168LOCAL_STATIC_LIBRARIES := weave-common
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700169
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700170LOCAL_CLANG := true
171
172LOCAL_SRC_FILES := \
173 libweaved/command.cc \
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800174 libweaved/service.cc \
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700175
176include $(BUILD_SHARED_LIBRARY)
177
Alex Vakulenko8a808bc2015-11-12 15:50:11 -0800178# weaved_test
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700179# ========================================================
180include $(CLEAR_VARS)
Alex Vakulenko8a808bc2015-11-12 15:50:11 -0800181LOCAL_MODULE := weaved_test
182LOCAL_MODULE_TAGS := debug
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700183LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
184LOCAL_CFLAGS := $(buffetCommonCFlags)
185LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
186LOCAL_C_INCLUDES := \
187 $(buffetCommonCIncludes) \
188 external/gmock/include \
189
190LOCAL_SHARED_LIBRARIES := \
191 $(buffetSharedLibraries) \
192
193LOCAL_STATIC_LIBRARIES := \
Alex Vakulenko2e32e932015-10-27 11:47:43 -0700194 libbrillo-test-helpers \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700195 libchrome_test_helpers \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700196 libgtest \
197 libgmock \
198 libweave-test \
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800199 weave-daemon-common \
200 weave-common \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700201
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700202LOCAL_CLANG := true
203
204LOCAL_SRC_FILES := \
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800205 buffet/binder_command_proxy_unittest.cc \
Alex Vakulenkodf381642015-10-08 07:34:23 -0700206 buffet/buffet_config_unittest.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700207 buffet/buffet_testrunner.cc \
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800208 common/data_conversion_unittest.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700209
210include $(BUILD_NATIVE_TEST)