1
0

rpi2-build.sh 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. #!/bin/sh
  2. set -e
  3. NEWLIB="/usr/lib/arm-none-eabi/newlib"
  4. GCC_OPTS=" -g -O2 -nostartfiles -nostdlib -mhard-float -ffreestanding -mno-unaligned-access -fno-toplevel-reorder -mcpu=cortex-a7 -mfpu=neon-vfpv4 -std=gnu11 -L$NEWLIB/fpu -I./sledge -I. -I/usr/include/newlib -Idevices/rpi2 -Idevices/rpi2/uspi/env/include/ -DCPU_ARM "
  5. COMPILE="arm-none-eabi-gcc $GCC_OPTS"
  6. mkdir -p obj
  7. $COMPILE -c -o obj/alloc.o sledge/alloc.c
  8. $COMPILE -c -o obj/reader.o sledge/reader.c
  9. $COMPILE -c -o obj/strmap.o sledge/strmap.c
  10. $COMPILE -c -o obj/writer.o sledge/writer.c
  11. $COMPILE -c -o obj/stream.o sledge/stream.c
  12. $COMPILE -c -o obj/raspi.o devices/rpi2/raspi.c
  13. $COMPILE -c -o obj/r3d.o devices/rpi2/r3d.c
  14. $COMPILE -c -o obj/debug_util.o devices/debug_util.c
  15. $COMPILE -c -o obj/uspi_glue.o devices/rpi2/uspi_glue.c
  16. $COMPILE -c -o obj/timer2.o devices/rpi2/rpi-boot/timer.c
  17. $COMPILE -c -o obj/block.o devices/rpi2/rpi-boot/block.c
  18. $COMPILE -c -o obj/mbr.o devices/rpi2/rpi-boot/mbr.c
  19. $COMPILE -c -o obj/emmc.o devices/rpi2/rpi-boot/emmc.c
  20. $COMPILE -c -o obj/mbox.o devices/rpi2/rpi-boot/mbox.c
  21. $COMPILE -c -o obj/block_cache.o devices/rpi2/rpi-boot/block_cache.c
  22. $COMPILE -c -o obj/ccsbcs.o devices/rpi2/fat/ccsbcs.c
  23. $COMPILE -c -o obj/ff.o devices/rpi2/fat/ff.c
  24. $COMPILE -c -o obj/diskio.o devices/rpi2/fat/diskio.c
  25. $COMPILE -c -o obj/timer.o devices/rpi2/uspi/env/lib/timer.c
  26. $COMPILE -c -o obj/interrupt.o devices/rpi2/uspi/env/lib/interrupt.c
  27. $COMPILE -c -o obj/memio.o devices/rpi2/uspi/env/lib/memio.c
  28. $COMPILE -c -o obj/assert.o devices/rpi2/uspi/env/lib/assert.c
  29. $COMPILE -c -o obj/bcmpropertytags.o devices/rpi2/uspi/env/lib/bcmpropertytags.c
  30. $COMPILE -c -o obj/bcmmailbox.o devices/rpi2/uspi/env/lib/bcmmailbox.c
  31. $COMPILE -c -o obj/exceptionstub.o devices/rpi2/uspi/env/lib/exceptionstub.S
  32. $COMPILE -c -o obj/exceptionhandler.o devices/rpi2/uspi/env/lib/exceptionhandler.c
  33. $COMPILE -o build/interim-arm.elf -T devices/rpi2/arm.ld devices/rpi2/arm_start.S devices/rpi2/main_rpi2.c\
  34. obj/raspi.o obj/r3d.o\
  35. obj/reader.o obj/strmap.o obj/alloc.o obj/writer.o obj/stream.o\
  36. obj/debug_util.o\
  37. devices/rpi2/uspi/lib/libuspi.a\
  38. \
  39. obj/timer2.o\
  40. obj/block.o\
  41. obj/emmc.o\
  42. obj/mbox.o\
  43. obj/ff.o\
  44. obj/diskio.o\
  45. obj/block_cache.o\
  46. obj/ccsbcs.o\
  47. \
  48. obj/timer.o\
  49. obj/interrupt.o\
  50. obj/memio.o\
  51. obj/assert.o\
  52. obj/bcmpropertytags.o\
  53. obj/bcmmailbox.o\
  54. obj/exceptionstub.o\
  55. obj/exceptionhandler.o\
  56. \
  57. obj/uspi_glue.o\
  58. -lc -lgcc -lm
  59. arm-none-eabi-objcopy build/interim-arm.elf -O binary build/kernel7.img