OXYGENHUB
# 5eb57578f4ef spectra / Makefile
1.3 KiB · Makefile · last changed The ledger: hash-chained events in the frozen envelope, signed checkpoints, admin verify, check and rebuild (#3) 2 days ago source blame history raw
1
.PHONY: build check test fmt clippy changelog run ts install deps-check
2
3
# Spectra's own packages. `--workspace` and `--all` also reach the pinned
4
# Oxygen in deps/ (a path dependency), whose tests and lints are its own.
5
PKGS = -p spectra -p spectra-core -p spectra-mcp -p spectra-api -p radar
6
7
build:
8
	cargo build --release
9
10
check: changelog fmt clippy test
11
12
# A code change needs a CHANGELOG.md line (scripts/changelog-check.sh).
13
changelog:
14
	scripts/changelog-check.sh
15
16
fmt:
17
	cargo fmt $(PKGS) -- --check
18
19
clippy:
20
	cargo clippy $(PKGS) --all-targets -- -D warnings
21
22
test:
23
	cargo test $(PKGS)
24
25
run:
26
	cargo run -- --data data serve
27
28
# TypeScript declarations of the API types, for the VS Code extensions.
29
ts:
30
	cargo run -q -p spectra-api --bin spectra-api-typescript > crates/spectra-api/ts/index.d.ts
31
32
# Build and install spectra with its build identity (oxy describe) in --version.
33
install:
34
	SPECTRA_BUILD="$$(oxy --plain describe 2>/dev/null)" CARGO_INCREMENTAL=0 cargo build --release
35
	ln -sf $${CARGO_TARGET_DIR:-$(CURDIR)/target}/release/spectra $(HOME)/.local/bin/spectra
36
	$(HOME)/.local/bin/spectra --version
37
38
# Every crate in Cargo.lock must be one the OxygenFlow build image vendors
39
# (oxygenflow images/rust: the crates of oxygen, oxygenhub and oxygenflow), or
40
# CI cannot build offline (spectra#2).
41
deps-check:
42
	scripts/deps-check.sh