blob: d1b171d553a944cef3de60fc421ea7644d3a6227 [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 \
Alex Vakulenko0371fea2016-01-07 14:46:25 -080051 libnativepower \
Peter Qiu786a9062015-10-02 11:45:01 -070052 libshill-client \
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -080053 libutils \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070054 libweave \
Alex Vakulenko1642bec2015-08-19 09:34:58 -070055 libwebserv \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070056
Alex Vakulenkodf381642015-10-08 07:34:23 -070057ifdef BRILLO
58
59buffetSharedLibraries += \
60 libkeymaster_messages \
61 libkeystore_binder \
62
63endif
64
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -080065# weave-common
66# Code shared between weaved daemon and libweaved client library
Alex Vakulenkod78756d2015-08-11 12:32:02 -070067# ========================================================
68include $(CLEAR_VARS)
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -080069LOCAL_MODULE := weave-common
70LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
71LOCAL_CFLAGS := $(buffetCommonCFlags)
72LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
73LOCAL_C_INCLUDES := $(buffetCommonCIncludes)
74LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/brillo
75LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries)
76LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
77LOCAL_CLANG := true
78
79LOCAL_SRC_FILES := \
80 brillo/android/weave/IWeaveClient.aidl \
81 brillo/android/weave/IWeaveCommand.aidl \
82 brillo/android/weave/IWeaveService.aidl \
83 brillo/android/weave/IWeaveServiceManager.aidl \
84 brillo/android/weave/IWeaveServiceManagerNotificationListener.aidl \
85 common/binder_constants.cc \
86 common/binder_utils.cc \
87 common/data_conversion.cc \
88
89include $(BUILD_STATIC_LIBRARY)
90
91# weave-daemon-common
92# Code shared between weaved daemon and unit test runner.
93# This is essentially the implementation of weaved in a static library format.
94# ========================================================
95include $(CLEAR_VARS)
96LOCAL_MODULE := weave-daemon-common
Alex Vakulenkod78756d2015-08-11 12:32:02 -070097LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
98LOCAL_CFLAGS := $(buffetCommonCFlags)
Alex Vakulenko14b3e6e2015-12-10 10:01:36 -080099# TODO(avakulenko): Remove -Wno-deprecated-declarations when legacy libweave
100# APIs are removed (see: b/25917708).
101LOCAL_CPPFLAGS := $(buffetCommonCppFlags) -Wno-deprecated-declarations
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700102LOCAL_C_INCLUDES := $(buffetCommonCIncludes)
103LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries)
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800104LOCAL_STATIC_LIBRARIES := weave-common
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700105LOCAL_CLANG := true
106LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
107
108LOCAL_SRC_FILES := \
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800109 brillo/weaved_system_properties.cc \
Peter Qiu786a9062015-10-02 11:45:01 -0700110 buffet/ap_manager_client.cc \
111 buffet/avahi_mdns_client.cc \
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800112 buffet/binder_command_proxy.cc \
113 buffet/binder_weave_service.cc \
Alex Vakulenko0bc967f2015-08-18 11:22:07 -0700114 buffet/buffet_config.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700115 buffet/dbus_constants.cc \
Peter Qiu786a9062015-10-02 11:45:01 -0700116 buffet/flouride_socket_bluetooth_client.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700117 buffet/http_transport_client.cc \
118 buffet/manager.cc \
Peter Qiu786a9062015-10-02 11:45:01 -0700119 buffet/shill_client.cc \
Alex Vakulenko0bc967f2015-08-18 11:22:07 -0700120 buffet/socket_stream.cc \
Alex Vakulenko1642bec2015-08-19 09:34:58 -0700121 buffet/webserv_client.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700122
Darren Krahn31196852015-10-19 20:24:56 +0000123ifdef BRILLO
124LOCAL_SRC_FILES += buffet/keystore_encryptor.cc
125else
Alex Vakulenkodf381642015-10-08 07:34:23 -0700126LOCAL_SRC_FILES += buffet/fake_encryptor.cc
Darren Krahn31196852015-10-19 20:24:56 +0000127endif
Alex Vakulenkodf381642015-10-08 07:34:23 -0700128
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700129include $(BUILD_STATIC_LIBRARY)
130
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700131# weaved
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800132# The main binary of the weave daemon.
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700133# ========================================================
134include $(CLEAR_VARS)
135LOCAL_MODULE := weaved
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700136LOCAL_REQUIRED_MODULES := \
Robert Gindacf92c662015-08-20 09:30:11 -0700137 avahi-daemon \
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700138 libweaved \
Alex Vakulenko1642bec2015-08-19 09:34:58 -0700139 webservd \
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700140
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700141LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
142LOCAL_CFLAGS := $(buffetCommonCFlags)
143LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
144LOCAL_C_INCLUDES := $(buffetCommonCIncludes)
Jorge Lucangeli Obes87df55b2015-09-28 11:21:57 -0700145LOCAL_INIT_RC := weaved.rc
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700146LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries)
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800147LOCAL_STATIC_LIBRARIES := weave-common \
148
149LOCAL_WHOLE_STATIC_LIBRARIES := weave-daemon-common
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700150LOCAL_CLANG := true
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700151
152LOCAL_SRC_FILES := \
153 buffet/main.cc
154
155include $(BUILD_EXECUTABLE)
156
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700157# libweaved
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800158# The client library for the weave daemon. You should link to libweaved,
159# if you need to communicate with weaved.
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700160# ========================================================
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)
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800168LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries)
169LOCAL_STATIC_LIBRARIES := weave-common
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700170
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700171LOCAL_CLANG := true
172
173LOCAL_SRC_FILES := \
174 libweaved/command.cc \
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800175 libweaved/service.cc \
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700176
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 := \
Alex Vakulenko2e32e932015-10-27 11:47:43 -0700195 libbrillo-test-helpers \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700196 libchrome_test_helpers \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700197 libgtest \
198 libgmock \
199 libweave-test \
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800200 weave-daemon-common \
201 weave-common \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700202
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700203LOCAL_CLANG := true
204
205LOCAL_SRC_FILES := \
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800206 buffet/binder_command_proxy_unittest.cc \
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 \
Alex Vakulenkoae29f7d2015-12-21 16:30:37 -0800209 common/data_conversion_unittest.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700210
211include $(BUILD_NATIVE_TEST)