blob: f207dbe44831dea38b88f773ffc55d345501c230 [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 Vakulenkod78756d2015-08-11 12:32:02 -070040 libchrome \
41 libchrome-dbus \
42 libchromeos \
43 libchromeos-dbus \
44 libchromeos-http \
45 libchromeos-stream \
46 libdbus \
Peter Qiu786a9062015-10-02 11:45:01 -070047 libshill-client \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070048 libweave \
Alex Vakulenko1642bec2015-08-19 09:34:58 -070049 libwebserv \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070050
Alex Vakulenkodf381642015-10-08 07:34:23 -070051ifdef BRILLO
52
53buffetSharedLibraries += \
54 libkeymaster_messages \
55 libkeystore_binder \
56
57endif
58
Alex Vakulenkod78756d2015-08-11 12:32:02 -070059# buffet-common
60# ========================================================
61include $(CLEAR_VARS)
62LOCAL_MODULE := buffet-common
63LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
64LOCAL_CFLAGS := $(buffetCommonCFlags)
65LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
66LOCAL_C_INCLUDES := $(buffetCommonCIncludes)
67LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries)
68LOCAL_STATIC_LIBRARIES :=
69LOCAL_RTTI_FLAG := -frtti
70LOCAL_CLANG := true
71LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
72
73LOCAL_SRC_FILES := \
Peter Qiu786a9062015-10-02 11:45:01 -070074 buffet/ap_manager_client.cc \
75 buffet/avahi_mdns_client.cc \
Alex Vakulenko0bc967f2015-08-18 11:22:07 -070076 buffet/buffet_config.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070077 buffet/dbus_command_dispatcher.cc \
78 buffet/dbus_command_proxy.cc \
79 buffet/dbus_conversion.cc \
80 buffet/dbus_constants.cc \
Peter Qiu786a9062015-10-02 11:45:01 -070081 buffet/flouride_socket_bluetooth_client.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070082 buffet/http_transport_client.cc \
83 buffet/manager.cc \
Peter Qiu786a9062015-10-02 11:45:01 -070084 buffet/shill_client.cc \
Alex Vakulenko0bc967f2015-08-18 11:22:07 -070085 buffet/socket_stream.cc \
Alex Vakulenko1642bec2015-08-19 09:34:58 -070086 buffet/webserv_client.cc \
Christopher Wileyc21ae072015-08-19 13:46:58 -070087 buffet/dbus_bindings/dbus-service-config.json \
Christopher Wiley892a5c42015-08-21 13:41:43 -070088 buffet/dbus_bindings/com.android.Weave.Command.dbus-xml \
89 buffet/dbus_bindings/com.android.Weave.Manager.dbus-xml \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070090
Darren Krahn31196852015-10-19 20:24:56 +000091ifdef BRILLO
92LOCAL_SRC_FILES += buffet/keystore_encryptor.cc
93else
Alex Vakulenkodf381642015-10-08 07:34:23 -070094LOCAL_SRC_FILES += buffet/fake_encryptor.cc
Darren Krahn31196852015-10-19 20:24:56 +000095endif
Alex Vakulenkodf381642015-10-08 07:34:23 -070096
Alex Vakulenkod78756d2015-08-11 12:32:02 -070097include $(BUILD_STATIC_LIBRARY)
98
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -070099# weaved
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700100# ========================================================
101include $(CLEAR_VARS)
102LOCAL_MODULE := weaved
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700103LOCAL_REQUIRED_MODULES := \
Robert Gindacf92c662015-08-20 09:30:11 -0700104 avahi-daemon \
Alex Vakulenko63bdf082015-08-21 09:27:12 -0700105 com.android.Weave.conf \
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700106 libweaved \
Alex Vakulenko1642bec2015-08-19 09:34:58 -0700107 webservd \
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700108
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700109LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
110LOCAL_CFLAGS := $(buffetCommonCFlags)
111LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
112LOCAL_C_INCLUDES := $(buffetCommonCIncludes)
Jorge Lucangeli Obes87df55b2015-09-28 11:21:57 -0700113LOCAL_INIT_RC := weaved.rc
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700114LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries)
115LOCAL_WHOLE_STATIC_LIBRARIES := buffet-common
116LOCAL_CLANG := true
117LOCAL_RTTI_FLAG := -frtti
118
119LOCAL_SRC_FILES := \
120 buffet/main.cc
121
122include $(BUILD_EXECUTABLE)
123
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700124# libweaved-internal
Alex Vakulenkoee805c42015-08-20 10:37:49 -0700125# ========================================================
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700126# You do not want to depend on this. Depend on libweaved instead.
127# libweaved abstracts and helps you consume this interface.
Alex Vakulenkoee805c42015-08-20 10:37:49 -0700128include $(CLEAR_VARS)
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700129LOCAL_MODULE := libweaved-internal
Alex Vakulenkoee805c42015-08-20 10:37:49 -0700130LOCAL_DBUS_PROXY_PREFIX := buffet
131
132LOCAL_SRC_FILES := \
133 buffet/dbus_bindings/dbus-service-config.json \
Christopher Wiley892a5c42015-08-21 13:41:43 -0700134 buffet/dbus_bindings/com.android.Weave.Command.dbus-xml \
135 buffet/dbus_bindings/com.android.Weave.Manager.dbus-xml \
Alex Vakulenkoee805c42015-08-20 10:37:49 -0700136
137include $(BUILD_SHARED_LIBRARY)
138
Alex Vakulenkoabbcdea2015-10-09 19:33:15 -0700139# libweaved
140# ========================================================
141include $(CLEAR_VARS)
142LOCAL_MODULE := libweaved
143LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
144LOCAL_CFLAGS := $(buffetCommonCFlags)
145LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
146LOCAL_C_INCLUDES := external/gtest/include
147LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
148LOCAL_SHARED_LIBRARIES := \
149 $(buffetSharedLibraries) \
150 libweaved-internal \
151
152LOCAL_STATIC_LIBRARIES :=
153LOCAL_RTTI_FLAG := -frtti
154LOCAL_CLANG := true
155
156LOCAL_SRC_FILES := \
157 libweaved/command.cc \
158 libweaved/device.cc \
159
160include $(BUILD_SHARED_LIBRARY)
161
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700162# buffet_testrunner
163# ========================================================
164include $(CLEAR_VARS)
165LOCAL_MODULE := buffet_testrunner
166LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
167LOCAL_CFLAGS := $(buffetCommonCFlags)
168LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
169LOCAL_C_INCLUDES := \
170 $(buffetCommonCIncludes) \
171 external/gmock/include \
172
173LOCAL_SHARED_LIBRARIES := \
174 $(buffetSharedLibraries) \
175
176LOCAL_STATIC_LIBRARIES := \
177 buffet-common \
178 libchrome_dbus_test_helpers \
179 libchrome_test_helpers \
180 libchromeos-test-helpers \
181 libgtest \
182 libgmock \
183 libweave-test \
184
185LOCAL_RTTI_FLAG := -frtti
186LOCAL_CLANG := true
187
188LOCAL_SRC_FILES := \
Alex Vakulenkodf381642015-10-08 07:34:23 -0700189 buffet/buffet_config_unittest.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700190 buffet/buffet_testrunner.cc \
191 buffet/dbus_command_proxy_unittest.cc \
192 buffet/dbus_conversion_unittest.cc \
193
194include $(BUILD_NATIVE_TEST)
195
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700196# DBus config files for /etc/dbus-1
197# ========================================================
198include $(CLEAR_VARS)
Alex Vakulenko63bdf082015-08-21 09:27:12 -0700199LOCAL_MODULE := com.android.Weave.conf
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700200LOCAL_MODULE_CLASS := ETC
201LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/dbus-1
Alex Vakulenko63bdf082015-08-21 09:27:12 -0700202LOCAL_SRC_FILES := buffet/etc/dbus-1/com.android.Weave.conf
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700203include $(BUILD_PREBUILT)