justfile 657 B

12345678910111213141516171819202122232425
  1. target := "riscv64imac-unknown-none-elf"
  2. mode := "debug"
  3. build-path := "../../target/" + target + "/" + mode + "/"
  4. m-firmware-file := build-path + "rustsbi-qemu"
  5. m-bin-file := build-path + "rustsbi-qemu.bin"
  6. objcopy := "rust-objcopy --binary-architecture=riscv64"
  7. threads := "1"
  8. build: firmware
  9. @{{objcopy}} {{m-firmware-file}} --strip-all -O binary {{m-bin-file}}
  10. firmware:
  11. @cargo build --target={{target}}
  12. qemu: build
  13. @qemu-system-riscv64 \
  14. -machine virt \
  15. -nographic \
  16. -bios none \
  17. -device loader,file={{m-bin-file}},addr=0x80000000 \
  18. -smp threads={{threads}}
  19. run: build qemu