From 23114036916bb88aa5b4c59f597d7cc202a9950d Mon Sep 17 00:00:00 2001 From: Alfred Persson Forsberg Date: Thu, 20 Feb 2025 16:22:33 +0100 Subject: [PATCH] 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 --- sw/Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sw/Makefile b/sw/Makefile index f82ddc6..71d5e12 100644 --- a/sw/Makefile +++ b/sw/Makefile @@ -1,9 +1,11 @@ TOOLCHAIN_PREFIX?=riscv64-unknown-elf- +CC?=$(TOOLCHAIN_PREFIX)gcc +OBJCOPY=$(TOOLCHAIN_PREFIX)objcopy %.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 - $(TOOLCHAIN_PREFIX)objcopy -O binary $< $@ + $(OBJCOPY) -O binary $< $@ %.hex: %.bin python3 makehex.py $< > $@