TARGETS := post01 TARGETS += post02 TARGETS += post03 TARGETS += post04 TARGETS += post05 TARGETS += post06 TARGETS += post07 TARGETS += post08 TARGETS += post09 TARGETS += post10 TARGETS += post11 TARGETS += post12
CARGO ?= cargo
CARGO += -q
.PHONY: init update fmt lint doc image test run clean
all: fmt lint $(TARGETS) doc image test
main:
@$(CARGO) xbuild --target x86_64-os.json
$(TARGETS):
@$(CARGO) xbuild --target x86_64-os.json --example $@
init:
@rustup update nightly
@rustup default nightly
@$(CARGO) install cargo-xbuild
@$(CARGO) install bootimage
@rustup component add rust-src
@rustup component add llvm-tools-preview
update: init
@$(CARGO) update
fmt:
@rustfmt --edition 2018 --check **/*.rs
lint:
@$(CARGO) clippy -- -D warnings
doc:
@$(CARGO) doc
image:
@$(CARGO) bootimage --target x86_64-os.json
test:
@$(CARGO) xtest --target x86_64-os.json
test-%:
@$(CARGO) xtest --target x86_64-os.json --test $*
run:
@$(CARGO) xrun --target x86_64-os.json
run-%:
@$(CARGO) xrun --target x86_64-os.json --example $*
clean:
@$(CARGO) clean