Android.mk revision 0371fea7a697a8c56ebaa2a3ab6d5e3770da341b
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 external/cros/system_api \ 34 external/gtest/include \ 35 36buffetSharedLibraries := \ 37 libapmanager-client \ 38 libavahi-common \ 39 libavahi-client \ 40 libbinder \ 41 libbinderwrapper \ 42 libbrillo \ 43 libbrillo-binder \ 44 libbrillo-dbus \ 45 libbrillo-http \ 46 libbrillo-stream \ 47 libchrome \ 48 libchrome-dbus \ 49 libcutils \ 50 libdbus \ 51 libnativepower \ 52 libshill-client \ 53 libutils \ 54 libweave \ 55 libwebserv \ 56 57ifdef BRILLO 58 59buffetSharedLibraries += \ 60 libkeymaster_messages \ 61 libkeystore_binder \ 62 63endif 64 65# weave-common 66# Code shared between weaved daemon and libweaved client library 67# ======================================================== 68include $(CLEAR_VARS) 69LOCAL_MODULE := weave-common 70LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension) 71LOCAL_CFLAGS := $(buffetCommonCFlags) 72LOCAL_CPPFLAGS := $(buffetCommonCppFlags) 73LOCAL_C_INCLUDES := $(buffetCommonCIncludes) 74LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/brillo 75LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries) 76LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 77LOCAL_CLANG := true 78 79LOCAL_SRC_FILES := \ 80 brillo/android/weave/IWeaveClient.aidl \ 81 brillo/android/weave/IWeaveCommand.aidl \ 82 brillo/android/weave/IWeaveService.aidl \ 83 brillo/android/weave/IWeaveServiceManager.aidl \ 84 brillo/android/weave/IWeaveServiceManagerNotificationListener.aidl \ 85 common/binder_constants.cc \ 86 common/binder_utils.cc \ 87 common/data_conversion.cc \ 88 89include $(BUILD_STATIC_LIBRARY) 90 91# weave-daemon-common 92# Code shared between weaved daemon and unit test runner. 93# This is essentially the implementation of weaved in a static library format. 94# ======================================================== 95include $(CLEAR_VARS) 96LOCAL_MODULE := weave-daemon-common 97LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension) 98LOCAL_CFLAGS := $(buffetCommonCFlags) 99# TODO(avakulenko): Remove -Wno-deprecated-declarations when legacy libweave 100# APIs are removed (see: b/25917708). 101LOCAL_CPPFLAGS := $(buffetCommonCppFlags) -Wno-deprecated-declarations 102LOCAL_C_INCLUDES := $(buffetCommonCIncludes) 103LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries) 104LOCAL_STATIC_LIBRARIES := weave-common 105LOCAL_CLANG := true 106LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 107 108LOCAL_SRC_FILES := \ 109 brillo/weaved_system_properties.cc \ 110 buffet/ap_manager_client.cc \ 111 buffet/avahi_mdns_client.cc \ 112 buffet/binder_command_proxy.cc \ 113 buffet/binder_weave_service.cc \ 114 buffet/buffet_config.cc \ 115 buffet/dbus_constants.cc \ 116 buffet/flouride_socket_bluetooth_client.cc \ 117 buffet/http_transport_client.cc \ 118 buffet/manager.cc \ 119 buffet/shill_client.cc \ 120 buffet/socket_stream.cc \ 121 buffet/webserv_client.cc \ 122 123ifdef BRILLO 124LOCAL_SRC_FILES += buffet/keystore_encryptor.cc 125else 126LOCAL_SRC_FILES += buffet/fake_encryptor.cc 127endif 128 129include $(BUILD_STATIC_LIBRARY) 130 131# weaved 132# The main binary of the weave daemon. 133# ======================================================== 134include $(CLEAR_VARS) 135LOCAL_MODULE := weaved 136LOCAL_REQUIRED_MODULES := \ 137 avahi-daemon \ 138 libweaved \ 139 webservd \ 140 141LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension) 142LOCAL_CFLAGS := $(buffetCommonCFlags) 143LOCAL_CPPFLAGS := $(buffetCommonCppFlags) 144LOCAL_C_INCLUDES := $(buffetCommonCIncludes) 145LOCAL_INIT_RC := weaved.rc 146LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries) 147LOCAL_STATIC_LIBRARIES := weave-common \ 148 149LOCAL_WHOLE_STATIC_LIBRARIES := weave-daemon-common 150LOCAL_CLANG := true 151 152LOCAL_SRC_FILES := \ 153 buffet/main.cc 154 155include $(BUILD_EXECUTABLE) 156 157# libweaved 158# The client library for the weave daemon. You should link to libweaved, 159# if you need to communicate with weaved. 160# ======================================================== 161include $(CLEAR_VARS) 162LOCAL_MODULE := libweaved 163LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension) 164LOCAL_CFLAGS := $(buffetCommonCFlags) 165LOCAL_CPPFLAGS := $(buffetCommonCppFlags) 166LOCAL_C_INCLUDES := external/gtest/include 167LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH) 168LOCAL_SHARED_LIBRARIES := $(buffetSharedLibraries) 169LOCAL_STATIC_LIBRARIES := weave-common 170 171LOCAL_CLANG := true 172 173LOCAL_SRC_FILES := \ 174 libweaved/command.cc \ 175 libweaved/service.cc \ 176 177include $(BUILD_SHARED_LIBRARY) 178 179# weaved_test 180# ======================================================== 181include $(CLEAR_VARS) 182LOCAL_MODULE := weaved_test 183LOCAL_MODULE_TAGS := debug 184LOCAL_CPP_EXTENSION := $(buffetCommonCppExtension) 185LOCAL_CFLAGS := $(buffetCommonCFlags) 186LOCAL_CPPFLAGS := $(buffetCommonCppFlags) 187LOCAL_C_INCLUDES := \ 188 $(buffetCommonCIncludes) \ 189 external/gmock/include \ 190 191LOCAL_SHARED_LIBRARIES := \ 192 $(buffetSharedLibraries) \ 193 194LOCAL_STATIC_LIBRARIES := \ 195 libbrillo-test-helpers \ 196 libchrome_test_helpers \ 197 libgtest \ 198 libgmock \ 199 libweave-test \ 200 weave-daemon-common \ 201 weave-common \ 202 203LOCAL_CLANG := true 204 205LOCAL_SRC_FILES := \ 206 buffet/binder_command_proxy_unittest.cc \ 207 buffet/buffet_config_unittest.cc \ 208 buffet/buffet_testrunner.cc \ 209 common/data_conversion_unittest.cc \ 210 211include $(BUILD_NATIVE_TEST) 212