-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (41 loc) · 1.18 KB
/
Copy pathMakefile
File metadata and controls
58 lines (41 loc) · 1.18 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
VERSION ?= 0.0.1-dev
PREFIX ?= /usr/local
ARCH := $(shell uname -m | sed -e s/x86_64/amd64/ -e s/aarch64/arm64/)
SHA256 := $(shell command -v sha256sum >/dev/null 2>&1 && echo "sha256sum" || echo "shasum -a 256")
.PHONY: build install uninstall dist test integration validation bench \
fmt fmt-check clippy preflight check run clean
build:
cargo build --release
install: build
install -d $(DESTDIR)$(PREFIX)/bin
install -m 0755 target/release/mars $(DESTDIR)$(PREFIX)/bin/mars
uninstall:
rm -f $(DESTDIR)$(PREFIX)/bin/mars
dist: build
rm -rf dist && mkdir -p dist
cp target/release/mars dist/mars
tar -czf dist/mars_$(VERSION)_linux_$(ARCH).tar.gz -C dist mars -C .. LICENSE README.md
rm dist/mars
cd dist && $(SHA256) *.tar.gz > SHA256SUMS
test:
cargo test --lib
integration: build
cargo build
sudo -E ./tests/run-integration.sh
validation: install
sudo -E ./scripts/run-validation.sh
bench: install
sudo -E ./scripts/hap-bench.sh
fmt:
cargo fmt
fmt-check:
cargo fmt --check
clippy:
cargo clippy --all-targets -- -D warnings
preflight:
./scripts/preflight.sh
check: fmt-check clippy test
run: build
sudo -E target/release/mars --help
clean:
rm -rf target dist