assemble.ps1 684 B

12345678910111213141516
  1. # remove existing blobs because otherwise this will append object files to the old blobs
  2. Remove-Item -Force bin/*.a
  3. $crate = "riscv-rt"
  4. $extension_sets = @("i", "im", "ic", "imc")
  5. $pwd = Get-Location
  6. foreach ($ext in $extension_sets) {
  7. riscv64-unknown-elf-gcc -ggdb3 -fdebug-prefix-map=$pwd=/riscv-rt -c -mabi=ilp32 -march=rv32$ext asm.S -o bin/$crate.o
  8. riscv64-unknown-elf-ar crs bin/riscv32$ext-unknown-none-elf.a bin/$crate.o
  9. riscv64-unknown-elf-gcc -ggdb3 -fdebug-prefix-map=$pwd=/riscv-rt -c -mabi=lp64 -march=rv64$ext asm.S -o bin/$crate.o
  10. riscv64-unknown-elf-ar crs bin/riscv64$ext-unknown-none-elf.a bin/$crate.o
  11. }
  12. Remove-Item bin/$crate.o