-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
52 lines (44 loc) · 1.24 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
PROJECTROOT := $(shell pwd)
KERNELDIR := $(PROJECTROOT)/kernel
# Make is verbose in Linux. Make it silent.
MAKEFLAGS += --silent
.PHONY: default
default: help
.ONESHELL: # Only applies to all target
## install: Install toolchain dependencies
install:
@rustup override set nightly-2021-12-07
@rustup component add rust-src
@rustup component add llvm-tools-preview
@rustup component add clippy
## fmt: Format codebase using cargo fmt
fmt:
@printf "🔧 Formatting\n"
cd $(KERNELDIR)
@cargo fmt --all
@printf "👍 Done\n"
## kernel_build: Build kernel image
kernel_build:
@printf "🔧 Building kernel binary\n"
cd $(KERNELDIR)
@cargo install bootimage
@cargo build
@printf "👍 Done\n"
## kernel_test: Run kernel tests
kernel_test:
@printf "🔧 Running kernel tests\n"
cd $(KERNELDIR)
@cargo test
@printf "👍 Done\n"
## kernel_run: Attach QEMU and run kernel
kernel_run:
@printf "🔧 Updating crates\n"
cd $(KERNELDIR)
@printf "⛓️ Attaching runner\n"
@printf "🔨 Running QEMU\n"
@cargo run
@printf "👍 Done\n"
help: Makefile
@printf "\nRusticOS, Lightweight OS implementation in Rust\n\n"
@sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /'
@printf "\nDo check out the code at https://github.com/sdslabs/rusticos\n\n"