Makefile 466 B

1234567891011121314151617181920
  1. CROSS ?= riscv-none-embed-
  2. CC = $(CROSS)gcc
  3. OBJCOPY = $(CROSS)objcopy
  4. CFLAGS=-Wall -Os -march=rv32i -mabi=ilp32 -ffreestanding -flto -nostartfiles -fomit-frame-pointer -Wl,--gc-section --specs=nano.specs
  5. boot.elf: lnk-boot.lds boot.S
  6. $(CC) $(CFLAGS) -Wl,-Bstatic,-T,lnk-boot.lds,--strip-debug -DFLASH_APP_ADDR=0x00100000 -o $@ boot.S
  7. %.hex: %.bin
  8. ./bin2hex.py $< $@
  9. %.bin: %.elf
  10. $(OBJCOPY) -O binary $< $@
  11. clean:
  12. rm -f *.bin *.hex *.elf *.o
  13. .PHONY: clean