build.sh 806 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. PREFIX=riscv64-linux-gnu-
  2. export CC=${PREFIX}gcc
  3. export LD=${PREFIX}ld
  4. export OD=${PREFIX}objdump
  5. export CFLAGS="-g -march=rv64id -mabi=lp64d"
  6. export LDFLAGS="-march=rv64id -mabi=lp64d"
  7. rm app/*.o
  8. rm native/*.o
  9. cd app/
  10. for prog in hello_world hello_puts
  11. do
  12. make $prog.o
  13. make $prog
  14. $OD -S $prog > $prog.dis
  15. done
  16. cd ..
  17. PREFIX=riscv32-unknown-linux-gnu-
  18. export CC=${PREFIX}gcc
  19. export LD=${PREFIX}ld
  20. export OD=${PREFIX}objdump
  21. export CFLAGS="-nostdlib -march=rv32i -mabi=ilp32"
  22. export LDFLAGS="-nostdlib -march=rv32i -mabi=ilp32"
  23. cd native/
  24. for prog in add math calls
  25. do
  26. make $prog.o
  27. make $prog
  28. $OD -S $prog > $prog.dis
  29. done
  30. cd ..
  31. export AS=${PREFIX}as
  32. cd asm/
  33. for prog in add os gamut
  34. do
  35. ${AS} ${prog}.asm -o ${prog}.o
  36. ${LD} ${prog}.o -o ${prog}
  37. ${OD} -S ${prog} > ${prog}.dis
  38. done