Hasini Gunasinghe | af6ff83 | 2022-05-19 23:57:10 +0000 | [diff] [blame] | 1 | # Copyright (C) 2022 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 | |
| 16 | LOCAL_DIR := $(GET_LOCAL_DIR) |
| 17 | |
| 18 | MODULE := $(LOCAL_DIR) |
| 19 | |
| 20 | MANIFEST := $(LOCAL_DIR)/manifest.json |
| 21 | |
| 22 | MODULE_SRCS += \ |
Orlando Arbildo | e79b531 | 2022-10-07 23:08:04 +0000 | [diff] [blame] | 23 | $(LOCAL_DIR)/lib.rs \ |
Hasini Gunasinghe | af6ff83 | 2022-05-19 23:57:10 +0000 | [diff] [blame] | 24 | |
| 25 | MODULE_CRATE_NAME := keymint |
| 26 | |
| 27 | MODULE_LIBRARY_DEPS += \ |
Orlando Arbildo | ede9128 | 2023-02-18 01:14:02 +0000 | [diff] [blame] | 28 | trusty/user/base/interface/keybox \ |
Hasini Gunasinghe | cfae16e | 2022-12-15 02:52:40 +0000 | [diff] [blame] | 29 | trusty/user/base/lib/hwbcc/rust \ |
Orlando Arbildo | 367ef08 | 2022-10-11 22:12:34 +0000 | [diff] [blame] | 30 | trusty/user/base/lib/hwkey/rust \ |
Orlando Arbildo | e682781 | 2022-11-02 17:21:17 +0000 | [diff] [blame] | 31 | trusty/user/base/lib/hwwsk/rust \ |
Hasini Gunasinghe | 900251b | 2022-06-15 05:35:51 +0000 | [diff] [blame] | 32 | trusty/user/base/lib/keymint-rust/boringssl \ |
Hasini Gunasinghe | af6ff83 | 2022-05-19 23:57:10 +0000 | [diff] [blame] | 33 | trusty/user/base/lib/keymint-rust/common \ |
| 34 | trusty/user/base/lib/keymint-rust/ta \ |
Per Larsen | ac9e6f7 | 2023-09-08 23:12:29 +0000 | [diff] [blame] | 35 | $(call FIND_CRATE,log) \ |
Per Larsen | 6b6e023 | 2023-09-15 01:11:35 +0000 | [diff] [blame] | 36 | $(call FIND_CRATE,protobuf)/2.27.1 \ |
Orlando Arbildo | 95d1774 | 2022-10-28 20:29:39 +0000 | [diff] [blame] | 37 | trusty/user/base/lib/storage/rust \ |
Hasini Gunasinghe | af6ff83 | 2022-05-19 23:57:10 +0000 | [diff] [blame] | 38 | trusty/user/base/lib/tipc/rust \ |
Orlando Arbildo | d3e5064 | 2022-12-09 00:56:30 +0000 | [diff] [blame] | 39 | trusty/user/base/lib/system_state/rust \ |
Hasini Gunasinghe | af6ff83 | 2022-05-19 23:57:10 +0000 | [diff] [blame] | 40 | trusty/user/base/lib/trusty-log \ |
| 41 | trusty/user/base/lib/trusty-std \ |
| 42 | |
Hasini Gunasinghe | e3bc700 | 2023-01-25 00:48:04 +0000 | [diff] [blame] | 43 | ifdef TRUSTY_KM_RUST_ACCESS_POLICY |
| 44 | MODULE_LIBRARY_DEPS+= $(TRUSTY_KM_RUST_ACCESS_POLICY) |
| 45 | else |
| 46 | MODULE_LIBRARY_DEPS+= trusty/user/app/keymint/generic_access_policy |
| 47 | endif |
| 48 | |
David Drysdale | de68aed | 2022-12-19 11:57:48 +0000 | [diff] [blame] | 49 | MODULE_RUSTFLAGS += \ |
| 50 | --cfg 'feature="soft_attestation_fallback"' \ |
David Drysdale | 94562a5 | 2023-02-20 14:43:36 +0000 | [diff] [blame] | 51 | --cfg 'feature="auto_second_imei"' \ |
David Drysdale | de68aed | 2022-12-19 11:57:48 +0000 | [diff] [blame] | 52 | |
Orlando Arbildo | e79b531 | 2022-10-07 23:08:04 +0000 | [diff] [blame] | 53 | MODULE_RUST_TESTS := true |
| 54 | |
David Drysdale | f2e821c | 2024-02-12 15:49:29 +0000 | [diff] [blame] | 55 | # The port tests are built and installed regardless of whether the KeyMint Rust TA |
| 56 | # is enabled, so set a config value to allow tests that involve the TA to be skipped. |
| 57 | ifeq (rust,$(TRUSTY_KEYMINT_IMPL)) |
| 58 | MODULE_RUSTFLAGS += --cfg 'kmr_enabled' |
| 59 | endif |
| 60 | |
Orlando Arbildo | ede9128 | 2023-02-18 01:14:02 +0000 | [diff] [blame] | 61 | MODULE_BINDGEN_ALLOW_TYPES := \ |
| 62 | keybox.* \ |
| 63 | |
David Drysdale | 4176f24 | 2023-03-21 09:58:59 +0000 | [diff] [blame] | 64 | MODULE_BINDGEN_ALLOW_FUNCTIONS := \ |
| 65 | trusty_rng_.* \ |
| 66 | |
Orlando Arbildo | ede9128 | 2023-02-18 01:14:02 +0000 | [diff] [blame] | 67 | MODULE_BINDGEN_ALLOW_VARS := \ |
| 68 | KEYBOX.* \ |
| 69 | |
| 70 | MODULE_BINDGEN_SRC_HEADER := $(LOCAL_DIR)/bindings.h |
| 71 | |
David Drysdale | 2b13024 | 2024-05-29 10:29:32 +0100 | [diff] [blame] | 72 | MODULE_RUST_USE_CLIPPY := true |
| 73 | |
Orlando Arbildo | e682781 | 2022-11-02 17:21:17 +0000 | [diff] [blame] | 74 | include make/library.mk |