assemble.ps1 933 B

123456789101112131415161718192021222324252627
  1. New-Item -Force -Name bin -Type Directory
  2. # remove existing blobs because otherwise this will append object files to the old blobs
  3. Remove-Item -Force bin/*.a
  4. $crate = "riscv-rt"
  5. $extension_sets = @("i", "im", "ic", "imc", "if", "ifc", "imf", "imfc", "ifd", "ifdc", "imfd", "imfdc")
  6. $pwd = Get-Location
  7. foreach ($ext in $extension_sets)
  8. {
  9. $abi = ""
  10. if ($ext.contains("d"))
  11. {$abi = "d"}
  12. elseif ($ext.contains("f"))
  13. {$abi = "f"}
  14. riscv64-unknown-elf-gcc -ggdb3 -fdebug-prefix-map=$pwd=/riscv-rt -c "-mabi=ilp32$abi" "-march=rv32$ext" asm.S -o bin/$crate.o
  15. riscv64-unknown-elf-ar crs bin/riscv32$ext-unknown-none-elf.a bin/$crate.o
  16. riscv64-unknown-elf-gcc -ggdb3 -fdebug-prefix-map=$pwd=/riscv-rt -c "-mabi=lp64$abi" "-march=rv64$ext" asm.S -o bin/$crate.o
  17. riscv64-unknown-elf-ar crs bin/riscv64$ext-unknown-none-elf.a bin/$crate.o
  18. }
  19. Remove-Item bin/$crate.o