From b7a361aa1f9b5cbb0c38888bc651202ed1de7116 Mon Sep 17 00:00:00 2001 From: Jim Wilson Date: Sun, 4 Feb 2018 13:11:38 -0800 Subject: [PATCH] Give build error with RISCV environment variable defined wrong. --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) 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