Do not fetch tools when running on qemu.

This commit is contained in:
Yifan Wu 2021-03-06 03:32:24 +08:00
parent 26219e7c95
commit 62c7a420df

View file

@ -71,10 +71,9 @@ disasm-vim: kernel
@vim $(DISASM_TMP) @vim $(DISASM_TMP)
@rm $(DISASM_TMP) @rm $(DISASM_TMP)
run: tools run-inner run: run-inner
tools:
(which $(K210-BURNER)) || (cd .. && git clone https://github.com/sipeed/kflash.py.git && mv kflash.py tools)
run-inner: build run-inner: build
ifeq ($(BOARD),qemu) ifeq ($(BOARD),qemu)
@ -86,6 +85,7 @@ ifeq ($(BOARD),qemu)
-drive file=$(FS_IMG),if=none,format=raw,id=x0 \ -drive file=$(FS_IMG),if=none,format=raw,id=x0 \
-device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0 -device virtio-blk-device,drive=x0,bus=virtio-mmio-bus.0
else else
(which $(K210-BURNER)) || (cd .. && git clone https://github.com/sipeed/kflash.py.git && mv kflash.py tools)
@cp $(BOOTLOADER) $(BOOTLOADER).copy @cp $(BOOTLOADER) $(BOOTLOADER).copy
@dd if=$(KERNEL_BIN) of=$(BOOTLOADER).copy bs=$(K210_BOOTLOADER_SIZE) seek=1 @dd if=$(KERNEL_BIN) of=$(BOOTLOADER).copy bs=$(K210_BOOTLOADER_SIZE) seek=1
@mv $(BOOTLOADER).copy $(KERNEL_BIN) @mv $(BOOTLOADER).copy $(KERNEL_BIN)
@ -100,4 +100,4 @@ debug: build
tmux split-window -h "riscv64-unknown-elf-gdb -ex 'file $(KERNEL_ELF)' -ex 'set arch riscv:rv64' -ex 'target remote localhost:1234'" && \ tmux split-window -h "riscv64-unknown-elf-gdb -ex 'file $(KERNEL_ELF)' -ex 'set arch riscv:rv64' -ex 'target remote localhost:1234'" && \
tmux -2 attach-session -d tmux -2 attach-session -d
.PHONY: build env kernel clean disasm disasm-vim run-inner tools .PHONY: build env kernel clean disasm disasm-vim run-inner