-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
34 lines (27 loc) · 1.15 KB
/
Makefile
File metadata and controls
34 lines (27 loc) · 1.15 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
# terminal-relay — local dev
PREFIX ?= $(HOME)/.local/bin
.PHONY: build test race install dev
build:
cd go && go build -o ../bin/mir-signal ./cmd/mir-signal
cd go && go build -o ../bin/mir-agent ./cmd/mir-agent
cd go && go build -o ../bin/mir ./cmd/mir
test:
cd go && go test ./...
race:
cd go && go test -race -count=1 ./...
# install the CLIs onto your PATH (default ~/.local/bin; override with PREFIX=...)
install: build
mkdir -p "$(PREFIX)"
install -m 0755 bin/mir bin/mir-agent bin/mir-signal "$(PREFIX)/"
@echo "installed mir, mir-agent, mir-signal -> $(PREFIX)"
# dev: run the signaling server + an agent locally.
# 1) `make build`
# 2) `make dev` (starts mir-signal, enrolls an agent against it)
# Pair an owner with: bin/mir pair-dev --owner-pub <hex>
dev: build
@echo "starting mir-signal on :8443 ..."
@./bin/mir-signal --addr :8443 & echo $$! > /tmp/mir-signal.pid
@sleep 1
@./bin/mir enroll --dir /tmp/mir-agent-dev --signal http://localhost:8443 || true
@echo "agent enrolled. Pair an owner, then: ./bin/mir up --dir /tmp/mir-agent-dev --shell sh"
@echo "client: ./bin/mir attach <machine> | stop signal: kill \`cat /tmp/mir-signal.pid\`"