Merge pull request #31 from sifive/riscv-envvar

Fix build with RISCV environment variable defined.
This commit is contained in:
Jim Wilson 2018-02-05 17:48:05 -08:00 committed by GitHub
commit b9e1393579
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 RISCV ?= $(CURDIR)/toolchain
PATH := $(RISCV)/bin:$(PATH) PATH := $(RISCV)/bin:$(PATH)
ISA ?= rv64imafdc 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 Program it with: dd if=work/bbl.bin of=/dev/sd-your-card bs=1M
@echo @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) $(toolchain_dest)/bin/$(target)-gcc: $(toolchain_srcdir)
mkdir -p $(toolchain_wrkdir) mkdir -p $(toolchain_wrkdir)
$(MAKE) -C $(linux_srcdir) O=$(dir $<) ARCH=riscv INSTALL_HDR_PATH=$(abspath $(toolchain_srcdir)/linux-headers) headers_install $(MAKE) -C $(linux_srcdir) O=$(dir $<) ARCH=riscv INSTALL_HDR_PATH=$(abspath $(toolchain_srcdir)/linux-headers) headers_install