.DEFAULT_GOAL := all
CARGO := cargo
BINARY_NAME := pipeflow
.PHONY: all fmt lint lint-rust lint-md check test test-all doc build release clean update help
all: fmt lint check test doc build
fmt:
@echo "Formatting code..."
@$(CARGO) fmt --all
lint: lint-rust lint-md
lint-rust:
@echo "Linting Rust code..."
@$(CARGO) clippy --all-targets --all-features -- -D warnings
lint-md:
@echo "Linting Markdown files..."
@if command -v markdownlint >/dev/null 2>&1; then \
markdownlint .; \
else \
echo "markdownlint not found; skipping Markdown lint. Install it with 'npm i -g markdownlint-cli'."; \
fi
check:
@echo "Type-checking code..."
@$(CARGO) check --all-targets --all-features
test:
@echo "Running unit tests..."
@$(CARGO) test --lib --bins
test-all:
@echo "Running all tests..."
@$(CARGO) test --all-targets --all-features -- --include-ignored
doc:
@echo "Building documentation..."
@$(CARGO) doc --no-deps
build:
@echo "Building debug binary..."
@$(CARGO) build --all-features
release:
@echo "Building release binary..."
@$(CARGO) build --release --all-features
clean:
@echo "Cleaning build artifacts..."
@$(CARGO) clean
update:
@echo "Updating dependencies..."
@$(CARGO) update
help:
@echo "Pipeflow - Available targets:"
@echo ""
@awk 'BEGIN {FS = ":.*##"} /^[a-zA-Z_-]+:.*##/ { \
printf " \033[36m%-18s\033[0m %s\n", $$1, $$2 \
}' $(MAKEFILE_LIST)
@echo ""
@echo "Examples:"
@echo " make @echo " make test-all @echo " make release