1# 2# Copyright 2019 The Android Open Source Project 3# 4# Licensed under the Apache License, Version 2.0 (the "License"); 5# you may not use this file except in compliance with the License. 6# You may obtain a copy of the License at 7# 8# http://www.apache.org/licenses/LICENSE-2.0 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16 17LOCAL_PATH := $(call my-dir) 18 19# Don't build the daemon for targets that don't contain a vendor image as 20# libsdsprpc and libadsprpc are provided by vendor code 21ifeq ($(BUILDING_VENDOR_IMAGE),true) 22 23ifeq ($(CHRE_DAEMON_ENABLED),true) 24 25include $(CLEAR_VARS) 26 27# CHRE AP-side daemon 28# NOTE: This can't be converted to a blueprint file until libsdsprpc / 29# libadsprpc is converted as blueprint targets can't depend on targets exposed 30# by makefiles 31LOCAL_MODULE := chre 32LOCAL_MODULE_OWNER := google 33LOCAL_MODULE_TAGS := optional 34LOCAL_VENDOR_MODULE := true 35LOCAL_INIT_RC := chre_daemon.rc 36 37LOCAL_CPP_EXTENSION := .cc 38LOCAL_CFLAGS += -Wall -Werror -Wextra 39 40# Enable the LPMA feature for devices that support audio 41ifeq ($(CHRE_DAEMON_LPMA_ENABLED),true) 42LOCAL_CFLAGS += -DCHRE_DAEMON_LPMA_ENABLED 43endif 44 45ifeq ($(CHRE_DAEMON_LOAD_INTO_SENSORSPD),true) 46LOCAL_CFLAGS += -DCHRE_DAEMON_LOAD_INTO_SENSORSPD 47endif 48 49LOCAL_SRC_FILES := \ 50 host/common/fragmented_load_transaction.cc \ 51 host/common/host_protocol_host.cc \ 52 host/common/socket_server.cc \ 53 host/msm/daemon/chre_daemon.cc \ 54 host/msm/daemon/generated/chre_slpi_stub.c \ 55 platform/shared/host_protocol_common.cc 56 57LOCAL_C_INCLUDES := \ 58 external/fastrpc/inc \ 59 system/chre/external/flatbuffers/include \ 60 system/chre/host/common/include \ 61 system/chre/host/msm/daemon \ 62 system/chre/platform/shared/include \ 63 system/chre/platform/slpi/include \ 64 system/chre/util/include \ 65 system/core/base/include \ 66 system/core/libcutils/include \ 67 system/core/liblog/include \ 68 system/core/libutils/include \ 69 70LOCAL_SHARED_LIBRARIES := \ 71 libjsoncpp \ 72 libutils \ 73 libcutils \ 74 liblog \ 75 libhidlbase 76 77ifeq ($(CHRE_DAEMON_LPMA_ENABLED),true) 78LOCAL_SHARED_LIBRARIES += android.hardware.soundtrigger@2.0 79LOCAL_SHARED_LIBRARIES += libpower 80endif 81 82ifeq ($(CHRE_DAEMON_USE_SDSPRPC),true) 83LOCAL_SHARED_LIBRARIES += libsdsprpc 84else 85LOCAL_SHARED_LIBRARIES += libadsprpc 86endif 87 88include $(BUILD_EXECUTABLE) 89 90endif 91endif