use submodules for dependant toolchain

This commit is contained in:
Wesley W. Terpstra 2016-07-08 17:58:13 -07:00
parent 22cd89cd80
commit 4c79962487
5 changed files with 16 additions and 13 deletions

1
.gitignore vendored
View File

@ -1,4 +1,3 @@
linux-*.tar.xz
work/
toolchain
riscv-tools/

3
.gitmodules vendored
View File

@ -7,3 +7,6 @@
[submodule "riscv-pk"]
path = riscv-pk
url = https://github.com/sifive/riscv-pk.git
[submodule "riscv-gnu-toolchain"]
path = riscv-gnu-toolchain
url = https://github.com/riscv/riscv-gnu-toolchain.git

View File

@ -6,6 +6,10 @@ srcdir := $(srcdir:/=)
confdir := $(srcdir)/conf
wrkdir := $(CURDIR)/work
toolchain_srcdir := $(srcdir)/riscv-gnu-toolchain
toolchain_wrkdir := $(wrkdir)/riscv-gnu-toolchain
toolchain_dest := $(CURDIR)/toolchain
buildroot_srcdir := $(srcdir)/buildroot
buildroot_wrkdir := $(wrkdir)/buildroot
buildroot_tar := $(buildroot_wrkdir)/images/rootfs.tar
@ -37,18 +41,14 @@ all: $(hex)
@echo Program it with: dd if=work/bbl.bin of=/dev/sd-your-card bs=1M
@echo
$(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
$(toolchain_dest)/bin/$(target)-gcc: $(toolchain_srcdir)
mkdir -p $(toolchain_wrkdir)
cd $(toolchain_wrkdir); $(toolchain_srcdir)/configure --prefix=$(toolchain_dest)
$(MAKE) -C $(toolchain_wrkdir) linux
$(buildroot_tar): $(buildroot_srcdir) $(RISCV)/bin/$(target)-gcc
$(MAKE) -C $< O=$(buildroot_wrkdir) riscv64_defconfig
$(MAKE) -C $< O=$(buildroot_wrkdir)
$(MAKE) -C $< RISCV=$(RISCV) PATH=$(PATH) O=$(buildroot_wrkdir) riscv64_defconfig
$(MAKE) -C $< RISCV=$(RISCV) PATH=$(PATH) O=$(buildroot_wrkdir)
.PHONY: buildroot-menuconfig
buildroot-menuconfig: $(buildroot_srcdir)
@ -104,4 +104,4 @@ bbl: $(bbl)
.PHONY: clean
clean:
rm -rf -- $(wrkdir)
rm -rf -- $(wrkdir) $(toolchain_dest)

1
riscv-gnu-toolchain Submodule

@ -0,0 +1 @@
Subproject commit 2ffda4e4653a5b8d55b86e26019deea5aaa1bb96

@ -1 +1 @@
Subproject commit f25234c1979f36ad25374f82b84a554e1fbc3158
Subproject commit 6eec87b472320eee37deafa88c1f9aebe7db749d