blob: 9db260ffc3d0c9182dea47d767c4bfa0a386ec5a [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
25buffetCommonCFlags := -D__BRILLO__ -Wall -Werror \
26 -Wno-char-subscripts -Wno-missing-field-initializers \
27 -Wno-unused-function -Wno-unused-parameter
28
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 \
49
50# buffet-common
51# ========================================================
52include $(CLEAR_VARS)
53LOCAL_MODULE := buffet-common
54LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
55LOCAL_CFLAGS := $(buffetCommonCFlags)
56LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
57LOCAL_C_INCLUDES := $(buffetCommonCIncludes)
58LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries)
59LOCAL_STATIC_LIBRARIES :=
60LOCAL_RTTI_FLAG := -frtti
61LOCAL_CLANG := true
62LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
63
64LOCAL_SRC_FILES := \
65 buffet/dbus_command_dispatcher.cc \
66 buffet/dbus_command_proxy.cc \
67 buffet/dbus_conversion.cc \
68 buffet/dbus_constants.cc \
69 buffet/http_transport_client.cc \
70 buffet/manager.cc \
71
72# buffet/dbus_bindings/org.chromium.Buffet.Command.xml \
73# buffet/dbus_bindings/org.chromium.Buffet.Manager.xml \
74# buffet/ap_manager_client.cc \
75# buffet/peerd_client.cc \
Alex Vakulenko8473fb72015-08-18 00:55:40 +000076# buffet/shill_client.cc \
Alex Vakulenkod78756d2015-08-11 12:32:02 -070077# buffet/webserv_client.cc \
78
79include $(BUILD_STATIC_LIBRARY)
80
81# buffet
82# ========================================================
83include $(CLEAR_VARS)
84LOCAL_MODULE := weaved
Alex Vakulenko8473fb72015-08-18 00:55:40 +000085LOCAL_REQUIRED_MODULES := init.weaved.rc
Alex Vakulenkod78756d2015-08-11 12:32:02 -070086LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
87LOCAL_CFLAGS := $(buffetCommonCFlags)
88LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
89LOCAL_C_INCLUDES := $(buffetCommonCIncludes)
90LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries)
91LOCAL_WHOLE_STATIC_LIBRARIES := buffet-common
92LOCAL_CLANG := true
93LOCAL_RTTI_FLAG := -frtti
94
95LOCAL_SRC_FILES := \
96 buffet/main.cc
97
98include $(BUILD_EXECUTABLE)
99
100include $(CLEAR_VARS)
101LOCAL_MODULE := init.weaved.rc
102LOCAL_MODULE_CLASS := ETC
103LOCAL_MODULE_PATH := $(PRODUCT_OUT)/$(TARGET_COPY_OUT_INITRCD)
104
Alex Vakulenko8473fb72015-08-18 00:55:40 +0000105ifdef INITRC_TEMPLATE
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700106include $(BUILD_SYSTEM)/base_rules.mk
107
Alex Vakulenko8473fb72015-08-18 00:55:40 +0000108weaved_caps :=
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700109$(LOCAL_BUILT_MODULE): $(INITRC_TEMPLATE)
Alex Vakulenko8473fb72015-08-18 00:55:40 +0000110 $(call generate-initrc-file,weaved,$(weaved_caps))
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700111endif
112
113# buffet_testrunner
114# ========================================================
115include $(CLEAR_VARS)
116LOCAL_MODULE := buffet_testrunner
117LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension)
118LOCAL_CFLAGS := $(buffetCommonCFlags)
119LOCAL_CPPFLAGS := $(buffetCommonCppFlags)
120LOCAL_C_INCLUDES := \
121 $(buffetCommonCIncludes) \
122 external/gmock/include \
123
124LOCAL_SHARED_LIBRARIES := \
125 $(buffetSharedLibraries) \
126
127LOCAL_STATIC_LIBRARIES := \
128 buffet-common \
129 libchrome_dbus_test_helpers \
130 libchrome_test_helpers \
131 libchromeos-test-helpers \
132 libgtest \
133 libgmock \
134 libweave-test \
135
136LOCAL_RTTI_FLAG := -frtti
137LOCAL_CLANG := true
138
139LOCAL_SRC_FILES := \
140 buffet/buffet_testrunner.cc \
141 buffet/dbus_command_proxy_unittest.cc \
142 buffet/dbus_conversion_unittest.cc \
143
144include $(BUILD_NATIVE_TEST)
145
Alex Vakulenkod78756d2015-08-11 12:32:02 -0700146endif # HOST_OS == linux