.PHONY: all flywheel bootstrap check test clean help metrics
PROJECT_ROOT := $(shell pwd)
BOOTSTRAP_DIR := $(PROJECT_ROOT)/target/bootstrap
BOOTSTRAP_SRC := $(BOOTSTRAP_DIR)/src
DOL_DIR := $(PROJECT_ROOT)/dol
MODULES := types token ast lexer
all: flywheel
flywheel:
@./scripts/flywheel.sh
flywheel-quick:
@./scripts/flywheel.sh --quick
flywheel-verbose:
@./scripts/flywheel.sh --verbose
metrics:
@./scripts/metrics.sh
metrics-csv:
@./scripts/metrics.sh --csv
bootstrap: regen fix verify
@echo "✓ Bootstrap complete"
regen:
@echo "Regenerating Rust files from DOL source..."
@mkdir -p $(BOOTSTRAP_SRC)
@for module in $(MODULES); do \
echo " Generating $${module}.rs..."; \
cargo run --release --features cli --bin dol-codegen -- \
--target rust "$(DOL_DIR)/$${module}.dol" 2>/dev/null \
> "$(BOOTSTRAP_SRC)/$${module}.rs"; \
done
fix:
@./scripts/bootstrap-fix.sh
verify:
@cd $(BOOTSTRAP_DIR) && cargo build --release 2>&1 | tail -3
check:
@echo "Checking DOL source files..."
@cargo run --features cli --bin dol-check -- $(DOL_DIR)/*.dol
check-bootstrap:
@cd $(BOOTSTRAP_DIR) && cargo check 2>&1 | grep "^error\[" | wc -l | \
xargs -I {} sh -c 'if [ {} -eq 0 ]; then echo "✓ Bootstrap OK"; else echo "✗ {} errors"; fi'
errors:
@cd $(BOOTSTRAP_DIR) && cargo check 2>&1 | grep "^error\[" | sort | uniq -c | sort -rn
errors-raw:
@$(MAKE) regen --quiet
@cd $(BOOTSTRAP_DIR) && cargo check 2>&1 | grep "^error\[" | wc -l
test:
@cargo test --lib
test-verbose:
@cargo test --lib -- --nocapture
test-one:
@cargo test $(TEST) -- --nocapture
clean:
@cargo clean
@rm -rf $(BOOTSTRAP_DIR)/target
clean-bootstrap:
@rm -rf $(BOOTSTRAP_DIR)/target
@rm -f $(BOOTSTRAP_SRC)/*.rs
clean-metrics:
@rm -rf .metrics
release:
@cargo build --release
tag:
@echo "Current tags:"
@git tag -l "v*" | tail -5
@echo ""
@read -p "New version (e.g., 0.3.2): " ver; \
git tag -a "v$$ver" -m "DOL v$$ver"
@echo "Created tag. Push with: git push origin --tags"
help:
@echo ""
@echo "DOL Makefile - Flywheel Edition"
@echo "═══════════════════════════════════════════════════════════════"
@echo ""
@echo "Flywheel (recommended):"
@echo " make flywheel Run complete pipeline"
@echo " make flywheel-quick Skip tests"
@echo " make metrics Show progress dashboard"
@echo ""
@echo "Bootstrap:"
@echo " make bootstrap Regenerate + fix + build"
@echo " make regen Regenerate Rust from DOL"
@echo " make fix Apply codegen fixes"
@echo ""
@echo "Check:"
@echo " make check Parse DOL source"
@echo " make errors Show bootstrap error breakdown"
@echo " make errors-raw Count errors before fixes"
@echo ""
@echo "Test:"
@echo " make test Run all tests"
@echo " make test-verbose Tests with output"
@echo ""
@echo "Other:"
@echo " make clean Clean all"
@echo " make release Build release"
@echo " make tag Create version tag"
@echo ""