NAME := clash-cli TARGET != rustc --version --verbose | sed --quiet "s/host: //p" ifeq ($(OS), Windows_NT) EXE := .exe else EXE := endif all: check docs check: cargo check cargo clippy clean: @ $(RM) --recursive --verbose dist cargo clean dist: dist/$(NAME)-$(TARGET)$(EXE) docs: docs/usage.md fmt: cargo fmt #################### # Auxiliar Targets # #################### dist/$(NAME)-$(TARGET)$(EXE): target/release/$(NAME)$(EXE) @ mkdir --parents --verbose $(@D) @ cp --archive --force --verbose $< $@ .PHONY: docs/usage.md docs/usage.md: @ mkdir --parents --verbose $(@D) cargo run docs markdown > $@ .PHONY: target/release/$(NAME)$(EXE) target/release/$(NAME)$(EXE): cargo build --release