1# Copyright (C) 2021 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# 15 16LOCAL_DIR := $(GET_LOCAL_DIR) 17 18MODULE := $(LOCAL_DIR) 19 20MODULE_SRCS := $(LOCAL_DIR)/src/lib.rs 21 22MODULE_CRATE_NAME := trusty_sys 23 24MODULE_LIBRARY_EXPORTED_DEPS += \ 25 trusty/user/base/lib/libcompiler_builtins-rust \ 26 trusty/user/base/lib/libcore-rust \ 27 trusty/user/base/lib/syscall-stubs \ 28 29MODULE_ADD_IMPLICIT_DEPS := false 30 31# Get the path to the generated Rust file 32include trusty/user/base/lib/syscall-stubs/common-inc.mk 33 34# Ensure that we have the syscall rust file 35MODULE_RUST_ENV += SYSCALL_INC_FILE=$(SYSCALL_RS) 36 37MODULE_SRCDEPS += $(SYSCALL_RS) 38 39MODULE_BINDGEN_ALLOW_TYPES := \ 40 iovec \ 41 dma_pmem \ 42 uuid \ 43 handle_t \ 44 uevent \ 45 ipc_msg \ 46 ipc_msg_info \ 47 48MODULE_BINDGEN_ALLOW_VARS := \ 49 NO_ERROR \ 50 ERR_.* \ 51 IPC_CONNECT_.* \ 52 MMAP_FLAG_PROT_READ \ 53 MMAP_FLAG_PROT_WRITE \ 54 MMAP_FLAG_IO_HANDLE \ 55 56MODULE_BINDGEN_SRC_HEADER := $(LOCAL_DIR)/bindings.h 57 58# Derive eq and hash for uuid 59MODULE_BINDGEN_FLAGS += --with-derive-eq --with-derive-hash 60 61include make/library.mk 62