Android.mk revision 87df55b48d89612ac09c4ac4f17463b4139a6d70
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# 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 := -DBUFFET_USE_WIFI_BOOTSTRAPPING -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 libavahi-common \ 42 libchrome \ 43 libchrome-dbus \ 44 libchromeos \ 45 libchromeos-dbus \ 46 libchromeos-http \ 47 libchromeos-stream \ 48 libdbus \ 49 libweave \ 50 libwebserv \ 51 52ifdef BRILLO 53buffetSharedLibraries += libconnectivity 54endif 55 56# 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 := \ 71 buffet/buffet_config.cc \ 72 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 \ 78 buffet/socket_stream.cc \ 79 buffet/webserv_client.cc \ 80 buffet/dbus_bindings/dbus-service-config.json \ 81 buffet/dbus_bindings/com.android.Weave.Command.dbus-xml \ 82 buffet/dbus_bindings/com.android.Weave.Manager.dbus-xml \ 83 84ifdef BRILLO 85 86LOCAL_SRC_FILES += \ 87 buffet/avahi_mdns_client.cc \ 88 buffet/brillo_network_client.cc \ 89 buffet/flouride_socket_bluetooth_client.cc \ 90 91else # BRILLO 92 93LOCAL_SRC_FILES += \ 94 buffet/stub_bluetooth_client.cc \ 95 buffet/stub_mdns_client.cc \ 96 buffet/stub_network_client.cc \ 97 98endif # BRILLO 99 100include $(BUILD_STATIC_LIBRARY) 101 102# buffet 103# ======================================================== 104include $(CLEAR_VARS) 105LOCAL_MODULE := weaved 106LOCAL_REQUIRED_MODULES := \ 107 avahi-daemon \ 108 base_state.defaults.json \ 109 base_state.schema.json \ 110 weaved.json \ 111 com.android.Weave.conf \ 112 gcd.json \ 113 webservd \ 114 115LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension) 116LOCAL_CFLAGS := $(buffetCommonCFlags) 117LOCAL_CPPFLAGS := $(buffetCommonCppFlags) 118LOCAL_C_INCLUDES := $(buffetCommonCIncludes) 119LOCAL_INIT_RC := weaved.rc 120LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries) 121LOCAL_WHOLE_STATIC_LIBRARIES := buffet-common 122LOCAL_CLANG := true 123LOCAL_RTTI_FLAG := -frtti 124 125LOCAL_SRC_FILES := \ 126 buffet/main.cc 127 128include $(BUILD_EXECUTABLE) 129 130# libweaved-client 131# ======================================================== 132include $(CLEAR_VARS) 133LOCAL_MODULE := libweaved-client 134LOCAL_DBUS_PROXY_PREFIX := buffet 135 136LOCAL_SRC_FILES := \ 137 buffet/dbus_bindings/dbus-service-config.json \ 138 buffet/dbus_bindings/com.android.Weave.Command.dbus-xml \ 139 buffet/dbus_bindings/com.android.Weave.Manager.dbus-xml \ 140 141include $(BUILD_SHARED_LIBRARY) 142 143# buffet_testrunner 144# ======================================================== 145include $(CLEAR_VARS) 146LOCAL_MODULE := buffet_testrunner 147LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension) 148LOCAL_CFLAGS := $(buffetCommonCFlags) 149LOCAL_CPPFLAGS := $(buffetCommonCppFlags) 150LOCAL_C_INCLUDES := \ 151 $(buffetCommonCIncludes) \ 152 external/gmock/include \ 153 154LOCAL_SHARED_LIBRARIES := \ 155 $(buffetSharedLibraries) \ 156 157LOCAL_STATIC_LIBRARIES := \ 158 buffet-common \ 159 libchrome_dbus_test_helpers \ 160 libchrome_test_helpers \ 161 libchromeos-test-helpers \ 162 libgtest \ 163 libgmock \ 164 libweave-test \ 165 166LOCAL_RTTI_FLAG := -frtti 167LOCAL_CLANG := true 168 169LOCAL_SRC_FILES := \ 170 buffet/buffet_testrunner.cc \ 171 buffet/dbus_command_proxy_unittest.cc \ 172 buffet/dbus_conversion_unittest.cc \ 173 174include $(BUILD_NATIVE_TEST) 175 176# weaved_client 177# ======================================================== 178include $(CLEAR_VARS) 179LOCAL_MODULE := weaved_client 180LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension) 181LOCAL_CFLAGS := $(buffetCommonCFlags) 182LOCAL_CPPFLAGS := $(buffetCommonCppFlags) 183LOCAL_C_INCLUDES := $(buffetCommonCIncludes) 184LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries) 185LOCAL_STATIC_LIBRARIES := 186LOCAL_DBUS_PROXY_PREFIX := buffet 187LOCAL_RTTI_FLAG := -frtti 188LOCAL_CLANG := true 189 190LOCAL_SRC_FILES := \ 191 buffet/buffet_client.cc \ 192 buffet/dbus_bindings/dbus-service-config.json \ 193 buffet/dbus_bindings/com.android.Weave.Command.dbus-xml \ 194 buffet/dbus_bindings/com.android.Weave.Manager.dbus-xml \ 195 196include $(BUILD_EXECUTABLE) 197 198# Config files for /etc/weaved 199# ======================================================== 200include $(CLEAR_VARS) 201LOCAL_MODULE := base_state.defaults.json 202LOCAL_MODULE_CLASS := ETC 203LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/weaved 204LOCAL_SRC_FILES := buffet/etc/weaved/base_state.defaults.json 205include $(BUILD_PREBUILT) 206 207include $(CLEAR_VARS) 208LOCAL_MODULE := base_state.schema.json 209LOCAL_MODULE_CLASS := ETC 210LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/weaved 211LOCAL_SRC_FILES := buffet/etc/weaved/base_state.schema.json 212include $(BUILD_PREBUILT) 213 214include $(CLEAR_VARS) 215LOCAL_MODULE := gcd.json 216LOCAL_MODULE_CLASS := ETC 217LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/weaved 218LOCAL_SRC_FILES := buffet/etc/weaved/gcd.json 219include $(BUILD_PREBUILT) 220 221include $(CLEAR_VARS) 222LOCAL_MODULE := weaved.json 223LOCAL_MODULE_CLASS := ETC 224LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/weaved/commands 225LOCAL_SRC_FILES := buffet/etc/weaved/commands/weaved.json 226include $(BUILD_PREBUILT) 227 228# DBus config files for /etc/dbus-1 229# ======================================================== 230include $(CLEAR_VARS) 231LOCAL_MODULE := com.android.Weave.conf 232LOCAL_MODULE_CLASS := ETC 233LOCAL_MODULE_PATH := $(TARGET_OUT_ETC)/dbus-1 234LOCAL_SRC_FILES := buffet/etc/dbus-1/com.android.Weave.conf 235include $(BUILD_PREBUILT) 236 237endif # HOST_OS == linux 238