1f5b20388Scodeironman# Makefile.toml 2f5b20388Scodeironman 3f5b20388Scodeironman[env] 4*7c28051eSlinfengTOOLCHAIN = "+nightly-2024-11-05-x86_64-unknown-linux-gnu" 5f5b20388Scodeironman 6f5b20388ScodeironmanARCH = { default = "x86_64" } 7f5b20388ScodeironmanRUST_TARGET = { default = { if = "eq(env.ARCH, 'riscv64')", value = "riscv64gc-unknown-linux-gnu", else = "x86_64-unknown-linux-musl" } } 8f5b20388ScodeironmanINSTALL_DIR = { default = { if = "defined(env.DADK_CURRENT_BUILD_DIR)", value = "${DADK_CURRENT_BUILD_DIR}", else = "./install" } } 9f5b20388Scodeironman 10f5b20388Scodeironman[tasks.build] 11f5b20388Scodeironmandescription = "Build the project" 12f5b20388Scodeironmancommand = "cargo" 13f5b20388Scodeironmanargs = ["${TOOLCHAIN}", "build", "--target", "${RUST_TARGET}"] 14f5b20388Scodeironman 15f5b20388Scodeironman[tasks.run] 16f5b20388Scodeironmandescription = "Run the project" 17f5b20388Scodeironmancommand = "cargo" 18f5b20388Scodeironmanargs = ["${TOOLCHAIN}", "run", "--target", "${RUST_TARGET}"] 19f5b20388Scodeironman 20f5b20388Scodeironman[tasks.clean] 21f5b20388Scodeironmandescription = "Clean the project" 22f5b20388Scodeironmancommand = "cargo" 23f5b20388Scodeironmanargs = ["${TOOLCHAIN}", "clean", "--target", "${RUST_TARGET}"] 24f5b20388Scodeironman 25f5b20388Scodeironman[tasks.test] 26f5b20388Scodeironmandescription = "Run the tests" 27f5b20388Scodeironmancommand = "cargo" 28f5b20388Scodeironmanargs = ["${TOOLCHAIN}", "test", "--target", "${RUST_TARGET}"] 29f5b20388Scodeironman 30f5b20388Scodeironman[tasks.doc] 31f5b20388Scodeironmandescription = "Generate documentation" 32f5b20388Scodeironmancommand = "cargo" 33f5b20388Scodeironmanargs = ["${TOOLCHAIN}", "doc", "--target", "${RUST_TARGET}"] 34f5b20388Scodeironman 35f5b20388Scodeironman[tasks.fmt] 36f5b20388Scodeironmandescription = "Format the code" 37f5b20388Scodeironmancommand = "cargo" 38f5b20388Scodeironmanargs = ["${TOOLCHAIN}", "fmt"] 39f5b20388Scodeironman 40f5b20388Scodeironman[tasks.fmt-check] 41f5b20388Scodeironmandescription = "Check code format" 42f5b20388Scodeironmancommand = "cargo" 43f5b20388Scodeironmanargs = ["${TOOLCHAIN}", "fmt", "--check"] 44f5b20388Scodeironman 45f5b20388Scodeironman[tasks.run-release] 46f5b20388Scodeironmandescription = "Run the project in release mode" 47f5b20388Scodeironmancommand = "cargo" 48f5b20388Scodeironmanargs = ["${TOOLCHAIN}", "run", "--target", "${RUST_TARGET}", "--release"] 49f5b20388Scodeironman 50f5b20388Scodeironman[tasks.build-release] 51f5b20388Scodeironmandescription = "Build the project in release mode" 52f5b20388Scodeironmancommand = "cargo" 53f5b20388Scodeironmanargs = ["${TOOLCHAIN}", "build", "--target", "${RUST_TARGET}", "--release"] 54f5b20388Scodeironman 55f5b20388Scodeironman[tasks.test-release] 56f5b20388Scodeironmandescription = "Test the project in release mode" 57f5b20388Scodeironmancommand = "cargo" 58f5b20388Scodeironmanargs = ["${TOOLCHAIN}", "test", "--target", "${RUST_TARGET}", "--release"] 59f5b20388Scodeironman 60f5b20388Scodeironman[tasks.install] 61f5b20388Scodeironmandescription = "Install the project" 62f5b20388Scodeironmancommand = "cargo" 63f5b20388Scodeironmanargs = ["${TOOLCHAIN}", "install", "--target", "${RUST_TARGET}", "--path", ".", "--no-track", "--root", "${INSTALL_DIR}", "--force"] 64