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