-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
126 lines (112 loc) · 4.56 KB
/
Makefile
File metadata and controls
126 lines (112 loc) · 4.56 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
121
122
123
124
125
126
.PHONY: all setup demo test bench docs pack clean list meta llm smoke qa metrics-smoke
all: demo
setup:
@echo "[setup] nothing to setup at top-level"
demo:
@echo "[demo] invoking package demos (if present)"
@for d in packages/*; do \
if [ -f "$$d/Makefile" ]; then \
echo "→ $$d"; \
$(MAKE) -C $$d demo || true; \
fi; \
done
test:
@echo "[test] invoking package tests (if present)"
@for d in packages/*; do \
if [ -f "$$d/Makefile" ]; then \
echo "→ $$d"; \
$(MAKE) -C $$d test || true; \
fi; \
done
bench:
@echo "[bench] invoking package benchmarks (if present)"
@for d in packages/*; do \
if [ -f "$$d/Makefile" ]; then \
echo "→ $$d"; \
$(MAKE) -C $$d bench || true; \
fi; \
done
docs:
@echo "[docs] collated specs in ./spec and docs in ./docs"
list:
@echo "Packages:"
@for d in packages/*; do \
if [ -d "$$d" ]; then \
echo " - $$(basename $$d)"; \
fi; \
done
@echo ""
@echo "Specs:"
@find spec -type f -name "*.md" 2>/dev/null | sed 's|^| - |' || true
@echo ""
@echo "Docs:"
@find docs -type f -name "*.md" 2>/dev/null | sed 's|^| - |' || true
meta:
@python3 -m json.tool sirp.meta.json 2>/dev/null || cat sirp.meta.json
llm:
@echo "[llm] running LLM integrator (dry-run)"
@if [ -f "scripts/sirp-llm-integrate.sh" ]; then \
echo "→ Found scripts/sirp-llm-integrate.sh"; \
echo "→ To integrate, run: bash scripts/sirp-llm-integrate.sh"; \
else \
echo "ERROR: scripts/sirp-llm-integrate.sh not found"; \
exit 1; \
fi
qa:
@echo "[qa] running quality assurance checks"
@echo "→ Formatting check..."
@cd packages/sirp-node-with-rfc/sirp-node && cargo fmt --all -- --check || (echo " ✗ Formatting issues found. Run: cargo fmt --all" && exit 1)
@echo " ✓ Formatting OK"
@echo "→ Clippy (all targets, deny warnings)..."
@cd packages/sirp-node-with-rfc/sirp-node && cargo clippy --all-targets --all-features -- -D warnings || (echo " ✗ Clippy found issues" && exit 1)
@echo " ✓ Clippy OK"
@echo "→ Running tests..."
@cd packages/sirp-node-with-rfc/sirp-node && cargo test --all || exit 1
@echo " ✓ Tests OK"
@echo "→ Security audit (non-blocking)..."
@cd packages/sirp-node-with-rfc/sirp-node && (cargo audit 2>/dev/null || echo " ⚠ cargo-audit not installed (optional)") || true
@echo "→ Dependency deny check (non-blocking)..."
@cd packages/sirp-node-with-rfc/sirp-node && (cargo deny check 2>/dev/null || echo " ⚠ cargo-deny not installed (optional)") || true
@echo "→ Bundle validation..."
@$(MAKE) smoke
@echo "→ QA checks passed"
smoke:
@echo "[smoke] running smoke tests"
@echo "→ Validating structure..."
@python3 scripts/sirp-validate.py || exit 1
@echo "→ Checking Makefile targets..."
@$(MAKE) list >/dev/null 2>&1 && echo " ✓ list" || echo " ✗ list"
@$(MAKE) meta >/dev/null 2>&1 && echo " ✓ meta" || echo " ✗ meta"
@$(MAKE) llm >/dev/null 2>&1 && echo " ✓ llm" || echo " ✗ llm"
@echo "→ Validating sirp.meta.json paths..."
@python3 -c "import json, os; \
meta = json.load(open('sirp.meta.json')); \
errors = []; \
[errors.append(f' ✗ spec not found: {p}') for p in meta.get('spec_index', []) if not os.path.exists(p)]; \
[errors.append(f' ✗ doc not found: {p}') for p in meta.get('docs_index', []) if not os.path.exists(p)]; \
[print(f' ✓ {p}') for p in meta.get('spec_index', []) if os.path.exists(p)]; \
[print(f' ✓ {p}') for p in meta.get('docs_index', []) if os.path.exists(p)]; \
[print(e) for e in errors]; \
exit(1 if errors else 0)" || exit 1
@echo "→ Checking scripts..."
@test -x scripts/sirp-validate.py && echo " ✓ sirp-validate.py (executable)" || echo " ✗ sirp-validate.py"
@test -x scripts/sirp-bundle.sh && echo " ✓ sirp-bundle.sh (executable)" || echo " ✗ sirp-bundle.sh"
@test -x scripts/sirp-llm-integrate.sh && echo " ✓ sirp-llm-integrate.sh (executable)" || echo " ✗ sirp-llm-integrate.sh"
@echo "→ Smoke test passed"
pack:
@echo "[pack] zipping monorepo"
@rm -f ../sirp-unified-*.zip
@cd .. && zip -qr sirp-unified-$(shell date +%Y-%m-%d).zip sirp-unified
metrics-smoke:
@echo "[metrics] checking /metrics endpoint (if available)"
@cd packages/sirp-node-with-rfc/sirp-node && \
if cargo build --bin sirp-node >/dev/null 2>&1; then \
echo " → sirp-node binary available"; \
echo " ⚠ /metrics endpoint not yet implemented (skeleton)"; \
echo " → When implemented, this will check: GET http://127.0.0.1:7001/metrics"; \
else \
echo " ⚠ sirp-node not built, skipping metrics check"; \
fi
@echo " ✓ Metrics smoke check (no-op for skeleton)"
clean:
rm -rf build dist