Makefile 1.3 KB

12345678910111213141516171819202122232425262728
  1. all: boot.S bootboot.c fs.h
  2. @echo " src aarch64-rpi (Raspberry Pi 3+)"
  3. @aarch64-elf-gcc -Wall -Wextra -pedantic -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles -fno-stack-protector -c boot.S -o boot.o
  4. @aarch64-elf-gcc -Wall -Wextra -pedantic -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles -fno-stack-protector -I ./ -c tinflate.c -o tinflate.o
  5. @aarch64-elf-gcc -Wall -Wextra -pedantic -O2 -ffreestanding -nostdinc -nostdlib -nostartfiles -fno-stack-protector -I ./ -c bootboot.c -o bootboot.o
  6. @aarch64-elf-ld -r -b binary -o font.o font.psf
  7. @aarch64-elf-ld -nostdlib -nostartfiles boot.o bootboot.o tinflate.o font.o -T link.ld -o bootboot.elf
  8. @aarch64-elf-objcopy -O binary bootboot.elf ../dist/bootboot.img
  9. @rm *.o bootboot.elf
  10. mkboot: mkboot.c
  11. gcc mkboot.c -o mkboot
  12. raspbootcom: raspbootcom.c
  13. gcc raspbootcom.c -o raspbootcom
  14. getfw:
  15. wget -c -q https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/LICENCE.broadcom
  16. wget -c -q https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/bootcode.bin
  17. wget -c -q https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/fixup.dat
  18. wget -c -q https://raw.githubusercontent.com/raspberrypi/firmware/master/boot/start.elf
  19. cleanfw:
  20. @rm LICENCE.broadcom bootcode.bin fixup.dat start.elf
  21. clean:
  22. @rm mkboot raspbootcom *.o >/dev/null 2>/dev/null || true