Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
51
Makefile
Normal file
51
Makefile
Normal file
@@ -0,0 +1,51 @@
|
||||
.PHONY: build dev check check-all check-no-std check-portable targets test fmt run install clean
|
||||
|
||||
RELEASE_BIN := target/release/dvd-thing
|
||||
INSTALL_DIR := $(HOME)/.local/bin
|
||||
|
||||
NO_STD_TARGETS := x86_64-unknown-none riscv32imc-unknown-none-elf
|
||||
PORTABLE_TARGETS := wasm32-unknown-unknown x86_64-pc-windows-gnu aarch64-apple-darwin
|
||||
|
||||
build:
|
||||
cargo build --release
|
||||
|
||||
dev:
|
||||
RUST_LOG=debug cargo run
|
||||
|
||||
check:
|
||||
cargo fmt --all -- --check
|
||||
cargo clippy --workspace --all-targets -- -D warnings
|
||||
cargo test --workspace
|
||||
|
||||
check-all: check check-no-std check-portable
|
||||
|
||||
|
||||
check-no-std:
|
||||
@for target in $(NO_STD_TARGETS); do \
|
||||
echo " domain + application -> $$target"; \
|
||||
cargo check --quiet -p domain -p application --target $$target || exit 1; \
|
||||
done
|
||||
|
||||
check-portable:
|
||||
@for target in $(PORTABLE_TARGETS); do \
|
||||
echo " domain + application + assets -> $$target"; \
|
||||
cargo check --quiet -p domain -p application -p assets --target $$target || exit 1; \
|
||||
done
|
||||
|
||||
targets:
|
||||
rustup target add $(NO_STD_TARGETS) $(PORTABLE_TARGETS)
|
||||
|
||||
test:
|
||||
cargo test --workspace
|
||||
|
||||
fmt:
|
||||
cargo fmt --all
|
||||
|
||||
run:
|
||||
cargo run --release
|
||||
|
||||
install: build
|
||||
install -Dm755 $(RELEASE_BIN) $(INSTALL_DIR)/dvd-thing
|
||||
|
||||
clean:
|
||||
cargo clean
|
||||
Reference in New Issue
Block a user