blob: 3fef9a5745f18ec48a9b032a39a7ad195b08214a [file] [log] [blame]
Sylvain Munaut21b03ba2020-09-14 10:01:45 +02001CROSS = riscv-none-embed-
2
3CC := $(CROSS)gcc
4OBJCOPY := $(CROSS)objcopy
5
6CFLAGS=-Wall -Os -march=rv32i -mabi=ilp32 -ffreestanding -flto -nostartfiles -fomit-frame-pointer -Wl,--gc-section
7
8all: boot.hex
9
10boot.elf: lnk-boot.lds boot.S
11 $(CC) $(CFLAGS) -Wl,-Bstatic,-T,lnk-boot.lds,--strip-debug -DAPP_FLASH_ADDR=0x000a0000 -o $@ boot.S
12
13%.bin: %.elf
14 $(OBJCOPY) -O binary $< $@
15
16%.hex: %.bin
17 ./bin2hex.py $< $@
18
19clean:
20 rm -f *.bin *.hex *.elf *.o
21
22.PHONY: clean