blob: 2523f5703872ffa50c9389d5510157cf455d382a [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
17# TODO(avakulenko): Remove this condition when libchromeos can be built on
18# non-Linux host.
19ifeq ($(HOST_OS),linux)
20
21# Common variables
22# ========================================================
23
24buffetCommonCppExtension := .cc
Alex Vakulenkof0f55342015-08-18 15:51:40 -070025buffetCommonCFlags := -DBUFFET_USE_WIFI_BOOTSTRAPPING -Wall -Werror \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070026 -Wno-char-subscripts -Wno-missing-field-initializers \
Alex Vakulenkof0f55342015-08-18 15:51:40 -070027 -Wno-unused-function -Wno-unused-parameter \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070028
29buffetCommonCppFlags := \
30 -Wno-deprecated-register \
31 -Wno-sign-compare \
32 -Wno-sign-promo \
33 -Wno-non-virtual-dtor \
34
35buffetCommonCIncludes := \
36 $(LOCAL_PATH)/.. \
37 $(LOCAL_PATH)/dbus-proxies \
38 external/gtest/include \
39
40buffetSharedLibraries := \
41 libchrome \
42 libchrome-dbus \
43 libchromeos \
44 libchromeos-dbus \
45 libchromeos-http \
46 libchromeos-stream \
47 libdbus \
48 libweave \
Alex Vakulenko1642bec2015-08-19 09:34:58 -070049 libwebserv \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070050
Alex Vakulenkof0f55342015-08-18 15:51:40 -070051ifdef BRILLO
52buffetCommonCFlags += -D__BRILLO__
53buffetSharedLibraries += libconnectivity
54endif
55
Alex Vakulenkod78756d2015-08-11 12:32:02 -070056# buffet-common
57# ========================================================
58include $(CLEAR_VARS)
59LOCAL_MODULE := buffet-common
60LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
61LOCAL_CFLAGS := $(buffetCommonCFlags)
62LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
63LOCAL_C_INCLUDES := $(buffetCommonCIncludes)
64LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries)
65LOCAL_STATIC_LIBRARIES :=
66LOCAL_RTTI_FLAG := -frtti
67LOCAL_CLANG := true
68LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
69
70LOCAL_SRC_FILES := \
Alex Vakulenko0bc967f2015-08-18 11:22:07 -070071 buffet/buffet_config.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070072 buffet/dbus_command_dispatcher.cc \
73 buffet/dbus_command_proxy.cc \
74 buffet/dbus_conversion.cc \
75 buffet/dbus_constants.cc \
76 buffet/http_transport_client.cc \
77 buffet/manager.cc \
Alex Vakulenko0bc967f2015-08-18 11:22:07 -070078 buffet/socket_stream.cc \
Alex Vakulenko1642bec2015-08-19 09:34:58 -070079 buffet/webserv_client.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070080
Alex Vakulenkof0f55342015-08-18 15:51:40 -070081ifdef BRILLO
82
83LOCAL_SRC_FILES += \
84 buffet/avahi_mdns_client.cc \
85 buffet/brillo_network_client.cc \
86
87else # BRILLO
88
89LOCAL_SRC_FILES += \
90 buffet/stub_mdns_client.cc \
91 buffet/stub_network_client.cc \
92
93endif # BRILLO
Alex Vakulenkod78756d2015-08-11 12:32:02 -070094
95include $(BUILD_STATIC_LIBRARY)
96
97# buffet
98# ========================================================
99include $(CLEAR_VARS)
100LOCAL_MODULE := weaved
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700101LOCAL_REQUIRED_MODULES := \
102 base_state.defaults.json \
103 base_state.schema.json \
104 gcd.json \
105 org.chromium.Buffet.conf \
Alex Vakulenko1642bec2015-08-19 09:34:58 -0700106 webservd \
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700107
108ifdef INITRC_TEMPLATE
109LOCAL_REQUIRED_MODULES += init.weaved.rc
110endif
111
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700112LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
113LOCAL_CFLAGS := $(buffetCommonCFlags)
114LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
115LOCAL_C_INCLUDES := $(buffetCommonCIncludes)
116LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries)
117LOCAL_WHOLE_STATIC_LIBRARIES := buffet-common
118LOCAL_CLANG := true
119LOCAL_RTTI_FLAG := -frtti
120
121LOCAL_SRC_FILES := \
122 buffet/main.cc
123
124include $(BUILD_EXECUTABLE)
125
Gilad Arnoldc1b676c2015-08-18 10:30:48 -0700126ifdef INITRC_TEMPLATE
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700127include $(CLEAR_VARS)
128LOCAL_MODULE := init.weaved.rc
129LOCAL_MODULE_CLASS := ETC
130LOCAL_MODULE_PATH := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_INITRCD)
131
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700132include $(BUILD_SYSTEM)/base_rules.mk
133
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700134$(LOCAL_BUILT_MODULE): $(INITRC_TEMPLATE)
Alex Vakulenko0bc967f2015-08-18 11:22:07 -0700135 $(call generate-initrc-file,weaved,,)
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700136endif
137
138# buffet_testrunner
139# ========================================================
140include $(CLEAR_VARS)
141LOCAL_MODULE := buffet_testrunner
142LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
143LOCAL_CFLAGS := $(buffetCommonCFlags)
144LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
145LOCAL_C_INCLUDES := \
146 $(buffetCommonCIncludes) \
147 external/gmock/include \
148
149LOCAL_SHARED_LIBRARIES := \
150 $(buffetSharedLibraries) \
151
152LOCAL_STATIC_LIBRARIES := \
153 buffet-common \
154 libchrome_dbus_test_helpers \
155 libchrome_test_helpers \
156 libchromeos-test-helpers \
157 libgtest \
158 libgmock \
159 libweave-test \
160
161LOCAL_RTTI_FLAG := -frtti
162LOCAL_CLANG := true
163
164LOCAL_SRC_FILES := \
165 buffet/buffet_testrunner.cc \
166 buffet/dbus_command_proxy_unittest.cc \
167 buffet/dbus_conversion_unittest.cc \
168
169include $(BUILD_NATIVE_TEST)
170
Alex Vakulenkof0f55342015-08-18 15:51:40 -0700171# Config files for /etc/buffet
172# ========================================================
173include $(CLEAR_VARS)
174LOCAL_MODULE := base_state.defaults.json
175LOCAL_MODULE_CLASS := ETC
176LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/buffet
177LOCAL_SRC_FILES := buffet/etc/buffet/base_state.defaults.json
178include $(BUILD_PREBUILT)
179
180include $(CLEAR_VARS)
181LOCAL_MODULE := base_state.schema.json
182LOCAL_MODULE_CLASS := ETC
183LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/buffet
184LOCAL_SRC_FILES := buffet/etc/buffet/base_state.schema.json
185include $(BUILD_PREBUILT)
186
187include $(CLEAR_VARS)
188LOCAL_MODULE := gcd.json
189LOCAL_MODULE_CLASS := ETC
190LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/buffet
191LOCAL_SRC_FILES := buffet/etc/buffet/gcd.json
192include $(BUILD_PREBUILT)
193
194# DBus config files for /etc/dbus-1
195# ========================================================
196include $(CLEAR_VARS)
197LOCAL_MODULE := org.chromium.Buffet.conf
198LOCAL_MODULE_CLASS := ETC
199LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/dbus-1
200LOCAL_SRC_FILES := buffet/etc/dbus-1/org.chromium.Buffet.conf
201include $(BUILD_PREBUILT)
202
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700203endif # HOST_OS == linux