diff --git a/Makefile b/Makefile index 88b0f5c5b..5de1c3dcb 100644 --- a/Makefile +++ b/Makefile @@ -1,12 +1,21 @@ -.PHONY: all build clean docs fmt test +.PHONY: all build clean docs fmt run setup test all: build test +setup: + @rustup component add rust-src + @rustup component add llvm-tools-preview + @cargo install mdbook + build: - @cd src && cargo build + @cd src && cargo kbuild + @cd src && cargo kimage + +run: build + @cd src && cargo krun test: build - @cd src && cargo test + @#cd src && cargo test docs: @cd src && cargo doc # Build Rust docs @@ -20,4 +29,4 @@ check: clean: @cd src && cargo clean - @cd docs && mdbook clean \ No newline at end of file + @cd docs && mdbook clean diff --git a/README.md b/README.md index 57e071b8d..29a3ac627 100644 --- a/README.md +++ b/README.md @@ -34,6 +34,18 @@ While there is nothing revolutionary in KxOS, it does explore some new design po While most code is written in Rust, the project-scope build process is governed by Makefile. +After downloading the source code, run the following command once to make sure +all developmennt tools are installed. +```bash +make setup +``` + +Then, we can build and test the project. ```bash make -``` \ No newline at end of file +``` + +If everything goes well, then we can run the OS. +```bash +make run +``` diff --git a/src/rust-toolchain.toml b/rust-toolchain.toml similarity index 100% rename from src/rust-toolchain.toml rename to rust-toolchain.toml