.PHONY: help build test clean install lint fmt check release example docs all
help:
@echo "Scrollcast - Development Commands"
@echo "================================="
@echo ""
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
build:
cargo build
release:
cargo build --release
install:
cargo install --path .
test:
cargo test
check:
cargo check
lint:
cargo clippy -- -D warnings
fmt:
cargo fmt
fmt-check:
cargo fmt -- --check
all-checks: fmt-check lint test
clean:
cargo clean
rm -rf output/
rm -rf target/
example-pdf: build
./target/debug/scrollcast test-project/ -o output/example.pdf
example-epub: build
./target/debug/scrollcast test-project/ -o output/example.epub -f epub
example-html: build
./target/debug/scrollcast test-project/ -o output/example.html -f html
example-markdown: build
./target/debug/scrollcast test-project/ -o output/example.md -f markdown
example-all: example-pdf example-epub example-html example-markdown
docs-pdf: release
./target/release/scrollcast . -o output/scrollcast-source.pdf
docs-epub: release
./target/release/scrollcast . -o output/scrollcast-source.epub -f epub
docs-all: docs-pdf docs-epub
setup:
@echo "Setting up development environment..."
@command -v pandoc >/dev/null 2>&1 || { echo >&2 "Pandoc is required but not installed. Please install it first."; exit 1; }
@command -v xelatex >/dev/null 2>&1 || { echo >&2 "XeLaTeX is required for PDF generation. Please install texlive-xetex."; exit 1; }
@echo "✅ Pandoc found: $$(pandoc --version | head -n1)"
@echo "✅ XeLaTeX found: $$(xelatex --version | head -n1)"
@echo "✅ Development environment is ready!"
bench:
cargo bench
pre-release: all-checks example-all docs-all
@echo "🚀 Pre-release checks completed successfully!"
@echo "📦 Built examples and documentation in output/"
size: release
@ls -lh target/release/scrollcast | awk '{print "Binary size: " $$5}'
list-themes: build
./target/debug/scrollcast --list-themes
list-languages: build
./target/debug/scrollcast --list-languages
output-dir:
mkdir -p output
dev: fmt lint test
watch:
cargo watch -x test
watch-build:
cargo watch -x build
info:
@echo "Project: Scrollcast"
@echo "Version: $$(cargo metadata --format-version 1 --no-deps | jq -r '.packages[0].version')"
@echo "Rust version: $$(rustc --version)"
@echo "Cargo version: $$(cargo --version)"
@echo "Target directory: target/"
@echo "Output directory: output/"
all: build test