OXYGENHUB
◆ v0.1.0 spectra / Makefile
1.6 KiB · Makefile · last changed Run the daemon on Earth: make install-server, a unit that waits for a Spectra (#25) 1 day ago source blame history raw
1
.PHONY: install-server 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 deps-check 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
	install -D -m 755 $${CARGO_TARGET_DIR:-$(CURDIR)/target}/release/spectra $(HOME)/.local/bin/spectra
36
	$(HOME)/.local/bin/spectra --version
37
38
# The daemon on another machine over SSH (spec §8.6): make install-server HOST=user@host
39
install-server:
40
	@test -n "$(HOST)" || { echo "make install-server HOST=[USER@]HOST" >&2; exit 2; }
41
	scripts/install-server.sh $(HOST)
42
43
# Every crate in Cargo.lock must be one the OxygenFlow build image vendors
44
# (oxygenflow images/rust: the crates of oxygen, oxygenhub and oxygenflow), or
45
# CI cannot build offline (spectra#2).
46
deps-check:
47
	scripts/deps-check.sh