makefile.toml 1.9 KB

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