diff --git a/Makefile b/Makefile index 7f528cb..03c058d 100644 --- a/Makefile +++ b/Makefile @@ -1,3 +1,5 @@ +# RISCV should either be unset, or set to point to a directory that contains +# a toolchain install tree that was built via other means. RISCV ?= $(CURDIR)/toolchain PATH := $(RISCV)/bin:$(PATH) ISA ?= rv64imafdc @@ -59,6 +61,11 @@ all: $(hex) @echo Program it with: dd if=work/bbl.bin of=/dev/sd-your-card bs=1M @echo +ifneq ($(RISCV),$(toolchain_dest)) +$(RISCV)/bin/$(target)-gcc: + $(error The RISCV environment variable was set, but is not pointing at a toolchain install tree) +endif + $(toolchain_dest)/bin/$(target)-gcc: $(toolchain_srcdir) mkdir -p $(toolchain_wrkdir) $(MAKE) -C $(linux_srcdir) O=$(dir $<) ARCH=riscv INSTALL_HDR_PATH=$(abspath $(toolchain_srcdir)/linux-headers) headers_install