Skip to content

Commit e62c25a

Browse files
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.
1 parent b40950d commit e62c25a

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

.gitmodules

+3
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@
1313
[submodule "riscv-newlib"]
1414
path = riscv-newlib
1515
url = ../riscv-newlib.git
16+
[submodule "riscv-qemu"]
17+
path = riscv-qemu
18+
url = git://github.com/riscv/riscv-qemu.git

Makefile.in

+12-3
Original file line numberDiff line numberDiff line change
@@ -290,15 +290,24 @@ stamps/build-gcc-newlib-stage2: $(srcdir)/riscv-gcc stamps/build-newlib
290290
$(MAKE) -C $(notdir $@) install
291291
mkdir -p $(dir $@) && touch $@
292292

293-
.PHONY: check-gcc-newlib
294-
check-gcc-newlib: stamps/build-gcc-newlib-stage2
293+
stamps/build-qemu: $(srcdir)/riscv-qemu
294+
rm -rf $@ $(notdir $@)
295+
mkdir $(notdir $@)
296+
cd $(notdir $@) && $</configure \
297+
--prefix=$(INSTALL_DIR) \
298+
--target-list=riscv64-linux-user,riscv32-linux-user
299+
$(MAKE) -C $(notdir $@)
300+
$(MAKE) -C $(notdir $@) install
301+
date > $@
302+
303+
stamps/check-gcc-newlib: stamps/build-gcc-newlib-stage2 stamps/build-qemu
295304
export PATH=$(srcdir)/scripts/wrapper/qemu:$(INSTALL_DIR)/bin:$(PATH) && \
296305
export DEJAGNULIBS=$(srcdir)/riscv-dejagnu && \
297306
export RISC_V_SYSROOT=$(SYSROOT) && \
298307
cd build-gcc-newlib-stage2 && \
299308
$(MAKE) check-gcc "RUNTESTFLAGS=--target_board=riscv-sim"
300309

301-
check-gcc-linux: stamps/build-gcc-linux-stage2
310+
stamps/check-gcc-linux: stamps/build-gcc-linux-stage2 stamps/build-qemu
302311
export PATH=$(srcdir)/scripts/wrapper/qemu:$(INSTALL_DIR)/bin:$(PATH) && \
303312
export DEJAGNULIBS=$(srcdir)/riscv-dejagnu && \
304313
export RISC_V_SYSROOT=$(SYSROOT) && \

riscv-qemu

Submodule riscv-qemu added at ff36f2f

0 commit comments

Comments
 (0)