File size: 3,729 Bytes
6afa130 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 | .PHONY: build test clean release demo check fmt clippy doc all help
CARGO ?= cargo
RUST_BACKTRACE ?= 1
PROFILE ?= release
# Color output
RED := \033[0;31m
GREEN := \033[0;32m
YELLOW := \033[0;33m
NC := \033[0m
help:
@echo "$(GREEN)SEB L6 Reasoning Protocol Build Targets$(NC)"
@echo ""
@echo "$(YELLOW)Building:$(NC)"
@echo " make build Build debug binary"
@echo " make release Build release binary"
@echo " make clean Clean build artifacts"
@echo ""
@echo "$(YELLOW)Testing:$(NC)"
@echo " make test Run all tests"
@echo " make test-unit Run unit tests only"
@echo " make test-doc Run doc tests"
@echo " make coverage Generate test coverage"
@echo ""
@echo "$(YELLOW)Code Quality:$(NC)"
@echo " make check Check code with clippy"
@echo " make fmt Format code with rustfmt"
@echo " make clippy Run clippy linter"
@echo ""
@echo "$(YELLOW)Examples:$(NC)"
@echo " make demo Run multi-agent demo"
@echo ""
@echo "$(YELLOW)Documentation:$(NC)"
@echo " make doc Generate documentation"
@echo " make doc-open Open documentation in browser"
@echo ""
@echo "$(YELLOW)Utilities:$(NC)"
@echo " make all Build, test, check"
@echo " make help Show this help message"
# Build targets
build:
@echo "$(GREEN)Building seb_reasoning (debug)...$(NC)"
@$(CARGO) build
release:
@echo "$(GREEN)Building seb_reasoning (release)...$(NC)"
@$(CARGO) build --release
@echo "$(GREEN)✓ Release build complete$(NC)"
@ls -lh target/release/libseb_reasoning*
# Testing
test:
@echo "$(GREEN)Running all tests...$(NC)"
@RUST_BACKTRACE=$(RUST_BACKTRACE) $(CARGO) test --all-targets --all-features
@echo "$(GREEN)✓ All tests passed$(NC)"
test-unit:
@echo "$(GREEN)Running unit tests...$(NC)"
@$(CARGO) test --lib
test-doc:
@echo "$(GREEN)Running doc tests...$(NC)"
@$(CARGO) test --doc
coverage:
@echo "$(YELLOW)Coverage report requires tarpaulin$(NC)"
@which cargo-tarpaulin > /dev/null || cargo install cargo-tarpaulin
@cargo tarpaulin --out Html --output-dir coverage
# Code quality
check:
@echo "$(GREEN)Running cargo check...$(NC)"
@$(CARGO) check --all-targets
@echo "$(GREEN)✓ Check passed$(NC)"
fmt:
@echo "$(GREEN)Formatting code with rustfmt...$(NC)"
@$(CARGO) fmt --all
fmt-check:
@echo "$(GREEN)Checking code format...$(NC)"
@$(CARGO) fmt --all -- --check
clippy:
@echo "$(GREEN)Running clippy linter...$(NC)"
@$(CARGO) clippy --all-targets --all-features -- -D warnings
@echo "$(GREEN)✓ Clippy passed$(NC)"
# Examples
demo:
@echo "$(GREEN)Running multi-agent reasoning demo...$(NC)"
@$(CARGO) run --example demo --release
# Documentation
doc:
@echo "$(GREEN)Generating documentation...$(NC)"
@$(CARGO) doc --no-deps --open
doc-open:
@$(CARGO) doc --no-deps --open
# Composite targets
all: check fmt test
@echo "$(GREEN)✓ All checks passed$(NC)"
verify: fmt-check check test
@echo "$(GREEN)✓ Verification complete$(NC)"
# Cleaning
clean:
@echo "$(YELLOW)Cleaning build artifacts...$(NC)"
@$(CARGO) clean
@rm -rf coverage/
@echo "$(GREEN)✓ Clean complete$(NC)"
# CI/CD target
ci: verify release
@echo "$(GREEN)✓ CI pipeline complete$(NC)"
# Development watch (requires cargo-watch)
watch:
@which cargo-watch > /dev/null || (echo "$(YELLOW)Installing cargo-watch...$(NC)" && cargo install cargo-watch)
@cargo watch -x test
# Bench target (future)
bench:
@echo "$(YELLOW)Benchmarks not yet configured$(NC)"
@$(CARGO) bench 2>/dev/null || echo "Use --bench to run"
.DEFAULT_GOAL := help
|