Android.mk revision 6765efdf49f824c98d13afefe920bdee237e1c0f
1# 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
17# Common variables
18# ========================================================
19
20buffetCommonCppExtension := .cc
21buffetCommonCFlags := -DBUFFET_USE_WIFI_BOOTSTRAPPING -Wall -Werror \
22	-Wno-char-subscripts -Wno-missing-field-initializers \
23	-Wno-unused-function -Wno-unused-parameter \
24
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 \
34	external/cros/system_api \
35	external/gtest/include \
36
37buffetSharedLibraries := \
38	libapmanager-client \
39	libavahi-common \
40	libchrome \
41	libchrome-dbus \
42	libchromeos \
43	libchromeos-dbus \
44	libchromeos-http \
45	libchromeos-stream \
46	libdbus \
47	libshill-client \
48	libweave \
49	libwebserv \
50
51ifdef BRILLO
52
53buffetSharedLibraries += \
54	libkeymaster_messages \
55	libkeystore_binder \
56
57endif
58
59# 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 := \
74	buffet/ap_manager_client.cc \
75	buffet/avahi_mdns_client.cc \
76	buffet/buffet_config.cc \
77	buffet/dbus_command_dispatcher.cc \
78	buffet/dbus_command_proxy.cc \
79	buffet/dbus_conversion.cc \
80	buffet/dbus_constants.cc \
81	buffet/flouride_socket_bluetooth_client.cc \
82	buffet/http_transport_client.cc \
83	buffet/manager.cc \
84	buffet/shill_client.cc \
85	buffet/socket_stream.cc \
86	buffet/webserv_client.cc \
87	buffet/dbus_bindings/dbus-service-config.json \
88	buffet/dbus_bindings/com.android.Weave.Command.dbus-xml \
89	buffet/dbus_bindings/com.android.Weave.Manager.dbus-xml \
90
91#ifdef BRILLO
92#LOCAL_SRC_FILES += buffet/keystore_encryptor.cc
93#else
94LOCAL_SRC_FILES += buffet/fake_encryptor.cc
95#endif
96
97include $(BUILD_STATIC_LIBRARY)
98
99# weaved
100# ========================================================
101include $(CLEAR_VARS)
102LOCAL_MODULE := weaved
103LOCAL_REQUIRED_MODULES := \
104	avahi-daemon \
105	com.android.Weave.conf \
106	libweaved \
107	webservd \
108
109LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
110LOCAL_CFLAGS := $(buffetCommonCFlags)
111LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
112LOCAL_C_INCLUDES := $(buffetCommonCIncludes)
113LOCAL_INIT_RC := weaved.rc
114LOCAL_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
124# libweaved-internal
125# ========================================================
126# You do not want to depend on this.  Depend on libweaved instead.
127# libweaved abstracts and helps you consume this interface.
128include $(CLEAR_VARS)
129LOCAL_MODULE := libweaved-internal
130LOCAL_DBUS_PROXY_PREFIX := buffet
131
132LOCAL_SRC_FILES := \
133	buffet/dbus_bindings/dbus-service-config.json \
134	buffet/dbus_bindings/com.android.Weave.Command.dbus-xml \
135	buffet/dbus_bindings/com.android.Weave.Manager.dbus-xml \
136
137include $(BUILD_SHARED_LIBRARY)
138
139# 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
162# 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 := \
189	buffet/buffet_config_unittest.cc \
190	buffet/buffet_testrunner.cc \
191	buffet/dbus_command_proxy_unittest.cc \
192	buffet/dbus_conversion_unittest.cc \
193
194include $(BUILD_NATIVE_TEST)
195
196# DBus config files for /etc/dbus-1
197# ========================================================
198include $(CLEAR_VARS)
199LOCAL_MODULE := com.android.Weave.conf
200LOCAL_MODULE_CLASS := ETC
201LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/dbus-1
202LOCAL_SRC_FILES := buffet/etc/dbus-1/com.android.Weave.conf
203include $(BUILD_PREBUILT)
204