diff --git a/.gitignore b/.gitignore index 4b5497cf..614368ae 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ os/target/* os/.idea/* os/Cargo.lock os/src/link_app.S +os/last-* user/target/* user/.idea/* user/Cargo.lock diff --git a/os/Makefile b/os/Makefile index a171fec4..c79d3a61 100644 --- a/os/Makefile +++ b/os/Makefile @@ -29,7 +29,14 @@ OBJCOPY := rust-objcopy --binary-architecture=riscv64 # Disassembly DISASM ?= -x -build: env $(KERNEL_BIN) +build: env switch-check $(KERNEL_BIN) + +switch-check: +ifeq ($(BOARD), qemu) + (which last-qemu) || (rm last-k210 -f && touch last-qemu && make clean) +else ifeq ($(BOARD), k210) + (which last-k210) || (rm last-qemu -f && touch last-k210 && make clean) +endif env: (rustup target list | grep "riscv64gc-unknown-none-elf (installed)") || rustup target add $(TARGET) @@ -86,4 +93,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 -2 attach-session -d -.PHONY: build env kernel clean disasm disasm-vim run-inner +.PHONY: build env kernel clean disasm disasm-vim run-inner switch-check diff --git a/rust-toolchain b/rust-toolchain index a08f00d1..a14eedce 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -nightly-2021-01-30 +nightly-2021-07-01