23 lines
427 B
Makefile
23 lines
427 B
Makefile
bootrom_img = bootrom.img
|
|
bootrom_dump = bootrom.dump
|
|
|
|
GCC=riscv64-unknown-elf-gcc -march=rv64imafd
|
|
OBJCOPY=riscv64-unknown-elf-objcopy
|
|
OBJDUMP=riscv64-unknown-elf-objdump
|
|
|
|
img: $(bootrom_img)
|
|
|
|
dump: $(bootrom_dump)
|
|
|
|
%.img: %.elf
|
|
$(OBJCOPY) -O binary --change-addresses=-0x10000 $< $@
|
|
|
|
%.elf: %.S linker.ld
|
|
$(GCC) -Tlinker.ld $< -nostdlib -static -o $@
|
|
|
|
%.dump: %.elf
|
|
$(OBJDUMP) -d $< > $@
|
|
|
|
clean:
|
|
rm -f *.elf *.dump *.img
|