1 # Recursive make is bad, but in this case we're cross compiling which is a
2 # pretty unusual use case.
4 CC
= $(RISCV
)/bin
/riscv64-unknown-elf-gcc
5 OBJCOPY
= $(RISCV
)/bin
/riscv64-unknown-elf-objcopy
10 debug_rom.h
: debug_rom.raw
11 xxd
-i
$^ | sed
"s/^unsigned/static const unsigned/" > $@
13 debug_rom.raw
: debug_rom
14 $(OBJCOPY
) -O binary
--only-section .text debug_rom debug_rom.raw
16 debug_rom
: debug_rom.o
17 $(CC
) -nostdlib
-nostartfiles
-Tlink.
ld -o
$@
$^
20 rm -f debug_rom debug_rom.o debug_rom.raw debug_rom.h