mirror of
https://github.com/olofk/serv.git
synced 2026-01-11 23:42:50 +00:00
sw/Makefile: allow setting CC
Useful for CC="clang --target=..." so you don't need a full GCC toolchain. Signed-off-by: Alfred Persson Forsberg <cat@catcream.org>
This commit is contained in:
parent
f8ce26f3b0
commit
2311403691
@ -1,9 +1,11 @@
|
|||||||
TOOLCHAIN_PREFIX?=riscv64-unknown-elf-
|
TOOLCHAIN_PREFIX?=riscv64-unknown-elf-
|
||||||
|
CC?=$(TOOLCHAIN_PREFIX)gcc
|
||||||
|
OBJCOPY=$(TOOLCHAIN_PREFIX)objcopy
|
||||||
|
|
||||||
%.elf: %.S link.ld
|
%.elf: %.S link.ld
|
||||||
$(TOOLCHAIN_PREFIX)gcc -nostartfiles -nostdlib -march=rv32i_zicsr -mabi=ilp32 -Tlink.ld -o$@ $<
|
$(CC) -nostartfiles -nostdlib -march=rv32i_zicsr -mabi=ilp32 -Tlink.ld -o$@ $<
|
||||||
%.bin: %.elf
|
%.bin: %.elf
|
||||||
$(TOOLCHAIN_PREFIX)objcopy -O binary $< $@
|
$(OBJCOPY) -O binary $< $@
|
||||||
%.hex: %.bin
|
%.hex: %.bin
|
||||||
python3 makehex.py $< > $@
|
python3 makehex.py $< > $@
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user