Skip to content

Instantly share code, notes, and snippets.

@hanetzer
Created April 20, 2022 23:29
Show Gist options
  • Save hanetzer/55a894448a1b504093b86530ede4f2dd to your computer and use it in GitHub Desktop.
Save hanetzer/55a894448a1b504093b86530ede4f2dd to your computer and use it in GitHub Desktop.
stdin
cross-compile = armv7a-hardfloat-linux-gnueabihf-
cc = ${cross-compile}gcc
ld = ${cross-compile}ld
cpp = ${cross-compile}cpp
objdump = ${cross-compile}objdump
objcopy = ${cross-compile}objcopy
cflags = -O0 -gdwarf-4 -Iinclude
rule assemble
deps = gcc
command = ${cc} -MD -MF ${out}.d ${cflags} -c ${in} -o ${out}
rule link
deps = gcc
command = ${ld} -Tbootrom.ld --dependency-file=${out}.d ${in} -o ${out}
rule bin
command = ${objcopy} --gap-fill 0xff --pad-to 0x1000 -v -O binary ${in} ${out}
rule sha512
command = sha512sum -c ${in}.sha512
rule disassemble
command = ${objdump} -S -d ${in}
build bootrom.o: assemble bootrom.S
build bootrom.elf: link bootrom.o
build bootrom.bin: bin bootrom.elf
build hash: sha512 bootrom.bin
build assembly: disassemble bootrom.elf
default bootrom.bin hash
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment