From b93894488281ade0e7fa5bcdec634659cc48dbc7 Mon Sep 17 00:00:00 2001 From: Yifan Wu Date: Sat, 2 Jan 2021 10:04:07 +0800 Subject: [PATCH] Add env. --- os/Makefile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/os/Makefile b/os/Makefile index 1d13ccee..38b3c403 100644 --- a/os/Makefile +++ b/os/Makefile @@ -22,7 +22,13 @@ OBJCOPY := rust-objcopy --binary-architecture=riscv64 # Disassembly DISASM ?= -x -build: $(KERNEL_BIN) +build: env $(KERNEL_BIN) + +env: + rustup component add rust-src + rustup component add llvm-tools-preview + cargo install cargo-binutils + rustup target add riscv64gc-unknown-none-elf $(KERNEL_BIN): kernel @$(OBJCOPY) $(KERNEL_ELF) --strip-all -O binary $@ @@ -66,4 +72,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 kernel clean disasm disasm-vim run-inner +.PHONY: build env kernel clean disasm disasm-vim run-inner