Automate building QEMU

We need QEMU to run the test suite.  This patch automates the build so
I don't need to keep remembering how to do it by hand.
This commit is contained in:
Palmer Dabbelt 2017-08-20 13:49:57 -07:00
parent b40950d657
commit e62c25a779
3 changed files with 16 additions and 3 deletions

3
.gitmodules vendored
View File

@ -13,3 +13,6 @@
[submodule "riscv-newlib"]
path = riscv-newlib
url = ../riscv-newlib.git
[submodule "riscv-qemu"]
path = riscv-qemu
url = git://github.com/riscv/riscv-qemu.git

View File

@ -290,15 +290,24 @@ stamps/build-gcc-newlib-stage2: $(srcdir)/riscv-gcc stamps/build-newlib
$(MAKE) -C $(notdir $@) install
mkdir -p $(dir $@) && touch $@
.PHONY: check-gcc-newlib
check-gcc-newlib: stamps/build-gcc-newlib-stage2
stamps/build-qemu: $(srcdir)/riscv-qemu
rm -rf $@ $(notdir $@)
mkdir $(notdir $@)
cd $(notdir $@) && $</configure \
--prefix=$(INSTALL_DIR) \
--target-list=riscv64-linux-user,riscv32-linux-user
$(MAKE) -C $(notdir $@)
$(MAKE) -C $(notdir $@) install
date > $@
stamps/check-gcc-newlib: stamps/build-gcc-newlib-stage2 stamps/build-qemu
export PATH=$(srcdir)/scripts/wrapper/qemu:$(INSTALL_DIR)/bin:$(PATH) && \
export DEJAGNULIBS=$(srcdir)/riscv-dejagnu && \
export RISC_V_SYSROOT=$(SYSROOT) && \
cd build-gcc-newlib-stage2 && \
$(MAKE) check-gcc "RUNTESTFLAGS=--target_board=riscv-sim"
check-gcc-linux: stamps/build-gcc-linux-stage2
stamps/check-gcc-linux: stamps/build-gcc-linux-stage2 stamps/build-qemu
export PATH=$(srcdir)/scripts/wrapper/qemu:$(INSTALL_DIR)/bin:$(PATH) && \
export DEJAGNULIBS=$(srcdir)/riscv-dejagnu && \
export RISC_V_SYSROOT=$(SYSROOT) && \

1
riscv-qemu Submodule

@ -0,0 +1 @@
Subproject commit ff36f2f77ec3e6a6211c63bfe1707ec057b12f7d