-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
120 lines (96 loc) · 3.39 KB
/
Copy pathMakefile
File metadata and controls
120 lines (96 loc) · 3.39 KB
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
# edaptor Makefile
# Build software and documentation
export PATH := $(HOME)/.cargo/bin:$(PATH)
.PHONY: all build release debug run watch clean docs docs-dev check fmt lint test \
coverage coverage-ci coverage-text help
# Default target
all: release
# =============================================================================
# Software Build
# =============================================================================
# Build release binary (runs fmt and clippy first)
release: fmt lint
cargo build --release
# Build debug binary (runs fmt and clippy first)
debug: fmt lint
cargo build
# Alias for debug build
build: debug
# Run the TUI against the podman demo server (debug mode)
run: fmt lint
cargo run -- --config examples/demo-config.toml
# Run with auto-reload (requires cargo-watch)
watch:
cargo watch -x 'run -- --config examples/demo-config.toml'
# Format code
fmt:
cargo fmt
# Run clippy linter
lint:
cargo clippy --all-targets -- -D warnings
# Run tests
test:
cargo test
# Coverage configuration for Homebrew Rust (set LLVM paths)
# For rustup users, these variables are not needed
LLVM_PREFIX ?= $(shell brew --prefix llvm 2>/dev/null || echo "")
ifneq ($(LLVM_PREFIX),)
export LLVM_COV := $(LLVM_PREFIX)/bin/llvm-cov
export LLVM_PROFDATA := $(LLVM_PREFIX)/bin/llvm-profdata
endif
# Run tests with coverage (requires cargo-llvm-cov)
coverage:
cargo llvm-cov --html --open
# Generate coverage report for CI (lcov format)
coverage-ci:
cargo llvm-cov --lcov --output-path lcov.info
# Generate coverage report (text summary)
coverage-text:
cargo llvm-cov --summary-only
# Clean build artifacts
clean:
cargo clean
rm -rf docs/book
rm -f lcov.info
# =============================================================================
# Documentation (mdBook)
# =============================================================================
# Build documentation
docs:
cd docs && mdbook build
# Start documentation dev server
docs-dev:
cd docs && mdbook serve
# =============================================================================
# Development Helpers
# =============================================================================
# Check everything before commit
check: fmt lint test
@echo "All checks passed!"
# =============================================================================
# Help
# =============================================================================
help:
@echo "edaptor Makefile"
@echo ""
@echo "Software:"
@echo " make build Build debug binary (runs fmt + clippy)"
@echo " make release Build release binary (runs fmt + clippy)"
@echo " make run Run the TUI against examples/demo-config.toml"
@echo " make watch Run with auto-reload (needs cargo-watch)"
@echo " make fmt Format code"
@echo " make lint Run clippy"
@echo " make test Run tests"
@echo " make check Format, lint, and test"
@echo " make clean Clean all build artifacts"
@echo ""
@echo "Coverage (requires cargo-llvm-cov):"
@echo " make coverage Generate HTML coverage report and open in browser"
@echo " make coverage-ci Generate lcov.info for CI integration"
@echo " make coverage-text Print coverage summary to terminal"
@echo ""
@echo "Documentation:"
@echo " make docs Build documentation"
@echo " make docs-dev Start docs dev server"
@echo ""
@echo " make help Show this help"