microsoft/mu_feature_ffa

Public

mirrored fromhttps://github.com/microsoft/mu_feature_ffaAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
0585e78f1afa24d3c50c412af8a8d0b220cf4312

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

Makefile.toml

96lines · modecode

1[config]
2default_to_workspace = false
3
4[env]
5CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
6RUSTC_BOOTSTRAP = 1
7ARCH = "X64"
8TARGET_TRIPLE = { source = "${ARCH}", mapping = { "X64" = "x86_64-unknown-uefi", "IA32" = "i686-unknown-uefi", "AARCH64" = "aarch64-unknown-uefi", "LOCAL" = "${CARGO_MAKE_RUST_TARGET_TRIPLE}" }, condition = { env_not_set = [ "TARGET_TRIPLE" ] } }
9
10CARGO_FEATURES_FLAG = {value = "--features ${FEATURES}", condition = {env_set = ["FEATURES"], env_true = ["FEATURES"]}}
11BUILD_FLAGS = "--profile ${RUSTC_PROFILE} --target ${TARGET_TRIPLE} -Zbuild-std=core,compiler_builtins,alloc -Zbuild-std-features=compiler-builtins-mem -Zunstable-options --timings=html"
12TEST_FLAGS = { value = "", condition = { env_not_set = ["TEST_FLAGS"] } }
13COV_FLAGS = { value = "--out html --exclude-files **/tests/*", condition = { env_not_set = ["COV_FLAGS"] } }
14
15[env.development]
16RUSTC_PROFILE = "dev"
17RUSTC_TARGET = "debug"
18
19[env.release]
20RUSTC_PROFILE = "release"
21RUSTC_TARGET = "release"
22
23[tasks.individual-package-targets]
24script_runner = "@duckscript"
25script = '''
26args = get_env CARGO_MAKE_TASK_ARGS
27
28if is_empty ${args}
29 exit
30end
31
321 = array ""
332 = split ${args} ,
343 = array_concat ${1} ${2}
35joined_args = array_join ${3} " -p "
36release ${1}
37release ${2}
38release ${3}
39
40joined_args = trim ${joined_args}
41set_env INDIVIDUAL_PACKAGE_TARGETS ${joined_args}
42release ${joined_args}
43'''
44
45[tasks.build]
46description = """Builds a single rust package.
47
48Customizations:
49 -p [development|release]: Builds in debug or release. Default: development
50 -e ARCH=[IA32|X64|AARCH64|LOCAL]: Builds with specifed arch. Default: X64
51 -e FEATURES=[feature,...]: Builds with the specified features. Default: none
52
53Example:
54 `cargo make build RustModule`
55 `cargo make -p release build RustModule`
56 `cargo make -e ARCH=IA32 build RustLib`
57 `cargo make -e FEATURES=feature1,feature2 build RustLib`
58"""
59clear = true
60command = "cargo"
61args = ["build", "@@split(INDIVIDUAL_PACKAGE_TARGETS, )", "@@split(BUILD_FLAGS, )", "@@split(CARGO_FEATURES_FLAG, ,remove-empty)"]
62dependencies = ["individual-package-targets"]
63
64[tasks.check]
65description = "Checks rust code for errors. Example `cargo make check`"
66clear = true
67command = "cargo"
68args = ["check", "@@split(INDIVIDUAL_PACKAGE_TARGETS, )", "@@split(BUILD_FLAGS, )"]
69dependencies = ["individual-package-targets"]
70
71[tasks.check_json]
72description = "Checks rust code for errors with results in JSON. Example `cargo make check_json`"
73clear = true
74command = "cargo"
75args = ["check", "@@split(INDIVIDUAL_PACKAGE_TARGETS, )", "@@split(BUILD_FLAGS, )", "--message-format=json"]
76dependencies = ["individual-package-targets"]
77
78[tasks.test]
79description = "Builds all rust tests in the workspace. Example `cargo make test`"
80clear = true
81command = "cargo"
82args = ["test", "@@split(INDIVIDUAL_PACKAGE_TARGETS, )", "@@split(TEST_FLAGS, )"]
83dependencies = ["individual-package-targets"]
84
85[tasks.coverage]
86description = "Build and run all tests and calculate coverage."
87clear = true
88command = "cargo"
89args = ["tarpaulin", "@@split(INDIVIDUAL_PACKAGE_TARGETS, )", "@@split(COV_FLAGS, )", "--output-dir", "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target"]
90dependencies = ["individual-package-targets"]
91
92[tasks.clippy]
93description = "Run cargo clippy."
94clear = true
95command = "cargo"
96args = ["clippy", "--all-targets", "--", "-D", "warnings"]
97