auto-build toolchain for those without one
This commit is contained in:
parent
b206c481fe
commit
22cd89cd80
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,2 +1,4 @@
|
|||||||
linux-*.tar.xz
|
linux-*.tar.xz
|
||||||
work/
|
work/
|
||||||
|
toolchain
|
||||||
|
riscv-tools/
|
||||||
|
17
Makefile
17
Makefile
@ -1,3 +1,5 @@
|
|||||||
|
RISCV ?= $(CURDIR)/toolchain
|
||||||
|
PATH := $(RISCV)/bin:$(PATH)
|
||||||
|
|
||||||
srcdir := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
|
srcdir := $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||||
srcdir := $(srcdir:/=)
|
srcdir := $(srcdir:/=)
|
||||||
@ -30,8 +32,21 @@ target := riscv64-unknown-linux-gnu
|
|||||||
|
|
||||||
.PHONY: all
|
.PHONY: all
|
||||||
all: $(hex)
|
all: $(hex)
|
||||||
|
@echo
|
||||||
|
@echo Find the SD-card image in work/bbl.bin
|
||||||
|
@echo Program it with: dd if=work/bbl.bin of=/dev/sd-your-card bs=1M
|
||||||
|
@echo
|
||||||
|
|
||||||
$(buildroot_tar): $(buildroot_srcdir)
|
$(CURDIR)/toolchain/bin/$(target)-gcc:
|
||||||
|
@echo
|
||||||
|
@echo WARNING: You have no RISC-V toolchain installed.
|
||||||
|
@echo A toolchain will be downloaded and built in 5 seconds...
|
||||||
|
@echo
|
||||||
|
@sleep 5
|
||||||
|
test -d riscv-tools || git clone -b freedom-unleashed-v0.1 --recursive https://github.com/ucb-bar/riscv-tools.git
|
||||||
|
cd riscv-tools; RISCV=$(RISCV) ./build.sh
|
||||||
|
|
||||||
|
$(buildroot_tar): $(buildroot_srcdir) $(RISCV)/bin/$(target)-gcc
|
||||||
$(MAKE) -C $< O=$(buildroot_wrkdir) riscv64_defconfig
|
$(MAKE) -C $< O=$(buildroot_wrkdir) riscv64_defconfig
|
||||||
$(MAKE) -C $< O=$(buildroot_wrkdir)
|
$(MAKE) -C $< O=$(buildroot_wrkdir)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user