Anthony Stange | abf4bcc | 2019-10-10 13:25:24 -0400 | [diff] [blame] | 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 | |
| 17 | LOCAL_PATH := $(call my-dir) |
| 18 | |
Anthony Stange | 970f630 | 2019-11-18 09:24:33 -0500 | [diff] [blame] | 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 |
| 21 | ifeq ($(BUILDING_VENDOR_IMAGE),true) |
| 22 | |
Anthony Stange | abf4bcc | 2019-10-10 13:25:24 -0400 | [diff] [blame] | 23 | ifeq ($(CHRE_DAEMON_ENABLED),true) |
| 24 | |
| 25 | include $(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 |
| 31 | LOCAL_MODULE := chre |
Bob Badour | 5f6f008 | 2021-02-25 15:05:44 -0800 | [diff] [blame] | 32 | LOCAL_LICENSE_KINDS := SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD |
| 33 | LOCAL_LICENSE_CONDITIONS := notice |
| 34 | LOCAL_NOTICE_FILE := $(LOCAL_PATH)/NOTICE |
Anthony Stange | abf4bcc | 2019-10-10 13:25:24 -0400 | [diff] [blame] | 35 | LOCAL_MODULE_OWNER := google |
| 36 | LOCAL_MODULE_TAGS := optional |
| 37 | LOCAL_VENDOR_MODULE := true |
| 38 | LOCAL_INIT_RC := chre_daemon.rc |
| 39 | |
| 40 | LOCAL_CPP_EXTENSION := .cc |
| 41 | LOCAL_CFLAGS += -Wall -Werror -Wextra |
| 42 | |
| 43 | # Enable the LPMA feature for devices that support audio |
| 44 | ifeq ($(CHRE_DAEMON_LPMA_ENABLED),true) |
| 45 | LOCAL_CFLAGS += -DCHRE_DAEMON_LPMA_ENABLED |
| 46 | endif |
| 47 | |
| 48 | ifeq ($(CHRE_DAEMON_LOAD_INTO_SENSORSPD),true) |
| 49 | LOCAL_CFLAGS += -DCHRE_DAEMON_LOAD_INTO_SENSORSPD |
| 50 | endif |
| 51 | |
karthik bharadwaj | 4fc7045 | 2020-02-04 16:11:41 -0800 | [diff] [blame] | 52 | # Disable Tokenized Logging |
| 53 | CHRE_USE_TOKENIZED_LOGGING := false |
| 54 | |
Anthony Stange | abf4bcc | 2019-10-10 13:25:24 -0400 | [diff] [blame] | 55 | LOCAL_SRC_FILES := \ |
Karthik Bharadwaj | 980208b | 2020-03-13 21:23:55 +0000 | [diff] [blame] | 56 | host/common/daemon_base.cc \ |
Anthony Stange | abf4bcc | 2019-10-10 13:25:24 -0400 | [diff] [blame] | 57 | host/common/fragmented_load_transaction.cc \ |
| 58 | host/common/host_protocol_host.cc \ |
Karthik Bharadwaj | 980208b | 2020-03-13 21:23:55 +0000 | [diff] [blame] | 59 | host/common/log_message_parser_base.cc \ |
Anthony Stange | abf4bcc | 2019-10-10 13:25:24 -0400 | [diff] [blame] | 60 | host/common/socket_server.cc \ |
Karthik Bharadwaj | 980208b | 2020-03-13 21:23:55 +0000 | [diff] [blame] | 61 | host/common/st_hal_lpma_handler.cc \ |
| 62 | host/msm/daemon/fastrpc_daemon.cc \ |
| 63 | host/msm/daemon/main.cc \ |
Anthony Stange | abf4bcc | 2019-10-10 13:25:24 -0400 | [diff] [blame] | 64 | host/msm/daemon/generated/chre_slpi_stub.c \ |
| 65 | platform/shared/host_protocol_common.cc |
| 66 | |
| 67 | LOCAL_C_INCLUDES := \ |
| 68 | external/fastrpc/inc \ |
| 69 | system/chre/external/flatbuffers/include \ |
| 70 | system/chre/host/common/include \ |
| 71 | system/chre/host/msm/daemon \ |
| 72 | system/chre/platform/shared/include \ |
| 73 | system/chre/platform/slpi/include \ |
| 74 | system/chre/util/include \ |
Baligh Uddin | 5b8f53f | 2020-10-23 05:45:29 +0000 | [diff] [blame] | 75 | system/libbase/include \ |
Anthony Stange | abf4bcc | 2019-10-10 13:25:24 -0400 | [diff] [blame] | 76 | system/core/libcutils/include \ |
Baligh Uddin | 31f970e | 2020-10-26 14:46:31 +0000 | [diff] [blame] | 77 | system/logging/liblog/include \ |
Anthony Stange | abf4bcc | 2019-10-10 13:25:24 -0400 | [diff] [blame] | 78 | system/core/libutils/include \ |
| 79 | |
| 80 | LOCAL_SHARED_LIBRARIES := \ |
| 81 | libjsoncpp \ |
| 82 | libutils \ |
| 83 | libcutils \ |
| 84 | liblog \ |
karthik bharadwaj | 4fc7045 | 2020-02-04 16:11:41 -0800 | [diff] [blame] | 85 | libhidlbase \ |
Karthik Bharadwaj | 980208b | 2020-03-13 21:23:55 +0000 | [diff] [blame] | 86 | libbase \ |
| 87 | android.hardware.soundtrigger@2.0 \ |
| 88 | libpower |
karthik bharadwaj | 4fc7045 | 2020-02-04 16:11:41 -0800 | [diff] [blame] | 89 | |
| 90 | # Enable tokenized logging |
| 91 | ifeq ($(CHRE_USE_TOKENIZED_LOGGING),true) |
| 92 | LOCAL_CFLAGS += -DCHRE_USE_TOKENIZED_LOGGING |
karthik bharadwaj | 4fc7045 | 2020-02-04 16:11:41 -0800 | [diff] [blame] | 93 | PIGWEED_TOKENIZER_DIR = vendor/google_contexthub/chre/external/pigweed |
| 94 | PIGWEED_TOKENIZER_DIR_RELPATH = ../../$(PIGWEED_TOKENIZER_DIR) |
| 95 | LOCAL_CFLAGS += -I$(PIGWEED_TOKENIZER_DIR)/pw_polyfill/public |
| 96 | LOCAL_CFLAGS += -I$(PIGWEED_TOKENIZER_DIR)/pw_polyfill/public_overrides |
| 97 | LOCAL_CFLAGS += -I$(PIGWEED_TOKENIZER_DIR)/pw_polyfill/standard_library_public |
| 98 | LOCAL_CFLAGS += -I$(PIGWEED_TOKENIZER_DIR)/pw_preprocessor/public |
| 99 | LOCAL_CFLAGS += -I$(PIGWEED_TOKENIZER_DIR)/pw_tokenizer/public |
| 100 | LOCAL_CFLAGS += -I$(PIGWEED_TOKENIZER_DIR)/pw_varint/public |
| 101 | LOCAL_CFLAGS += -I$(PIGWEED_TOKENIZER_DIR)/pw_span/public |
| 102 | |
| 103 | LOCAL_SRC_FILES += $(PIGWEED_TOKENIZER_DIR_RELPATH)/pw_tokenizer/detokenize.cc |
| 104 | LOCAL_SRC_FILES += $(PIGWEED_TOKENIZER_DIR_RELPATH)/pw_tokenizer/decode.cc |
| 105 | LOCAL_SRC_FILES += $(PIGWEED_TOKENIZER_DIR_RELPATH)/pw_varint/varint.cc |
karthik bharadwaj | eff0863 | 2020-02-10 11:05:06 -0800 | [diff] [blame] | 106 | endif |
Anthony Stange | abf4bcc | 2019-10-10 13:25:24 -0400 | [diff] [blame] | 107 | |
Anthony Stange | abf4bcc | 2019-10-10 13:25:24 -0400 | [diff] [blame] | 108 | ifeq ($(CHRE_DAEMON_USE_SDSPRPC),true) |
| 109 | LOCAL_SHARED_LIBRARIES += libsdsprpc |
| 110 | else |
| 111 | LOCAL_SHARED_LIBRARIES += libadsprpc |
| 112 | endif |
| 113 | |
| 114 | include $(BUILD_EXECUTABLE) |
| 115 | |
Anthony Stange | 970f630 | 2019-11-18 09:24:33 -0500 | [diff] [blame] | 116 | endif |
karthik bharadwaj | 4fc7045 | 2020-02-04 16:11:41 -0800 | [diff] [blame] | 117 | endif |