-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (33 loc) · 1.1 KB
/
Makefile
File metadata and controls
46 lines (33 loc) · 1.1 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
IMAGE ?= ghcr.io/alviner/tty-web
VERSION ?= $(shell cargo metadata --format-version=1 --no-deps | jq -r '.packages[0].version')
TARGET ?= $(shell rustc -vV | awk '/host/{print $$2}' | sed 's/gnu/musl/')
.PHONY: build run release clean fmt lint check
.PHONY: docker docker-minimal upload docs docs-serve
build:
cargo build
run:
cargo run
release:
cargo build --release --target $(TARGET)
clean:
cargo clean
fmt:
cargo fmt
lint:
cargo clippy -- -D warnings
check:
cargo check
DOCKER_TARGET ?= $(shell uname -m | sed 's/arm64/aarch64/' | sed 's/x86_64/x86_64/')-unknown-linux-musl
docker:
cargo zigbuild --release --target $(DOCKER_TARGET)
docker build --target playground --build-arg BINARY=target/$(DOCKER_TARGET)/release/tty-web -t $(IMAGE):$(VERSION)-playground .
docker-minimal:
cargo zigbuild --release --target $(DOCKER_TARGET)
docker build --target minimal --build-arg BINARY=target/$(DOCKER_TARGET)/release/tty-web -t $(IMAGE):$(VERSION) .
docs:
mdbook build docs
cargo doc --no-deps --document-private-items
rm -rf docs/book/api
cp -r target/doc docs/book/api
docs-serve: docs
mdbook serve docs