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
7 COMPILE
= $(CC
) -nostdlib
-nostartfiles
-I..
-Tlink.
ld
10 DEPS
= debug_rom.S link.
ld debug_rom_defines.h
12 all: $(patsubst %,%.h
,$(ELFS
))
15 xxd
-i
$^ | sed
"s/^unsigned/static const unsigned/" > $@
18 $(OBJCOPY
) -O binary
--only-section .text
$^
$@
24 rm -f
$(ELFS
) debug_rom
*.raw debug_rom.h