-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
60 lines (49 loc) · 1.47 KB
/
Makefile
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
59
60
BIN := hyprland-autoname-workspaces
VERSION := $$(git tag | tail -1)
PREFIX ?= /usr
LIB_DIR = $(DESTDIR)$(PREFIX)/lib
BIN_DIR = $(DESTDIR)$(PREFIX)/bin
SHARE_DIR = $(DESTDIR)$(PREFIX)/share
.PHONY: build-dev
build-dev:
cargo update
cargo build --features dev
.PHONY: build
build:
cargo build --locked --release
.PHONY: release
release:
cargo bump --git-tag
git push origin --follow-tags --signed=yes
.PHONY: test
test:
cargo test --locked
.PHONY: lint
lint:
cargo fmt -- --check
cargo clippy -- -Dwarnings
.PHONY: coverage
coverage:
cargo install tarpaulin
cargo tarpaulin --out html; xdg-open tarpaulin-report.html
.PHONY: run
run:
cargo run
.PHONY: clean
clean:
rm -rf dist
.PHONY: install
install:
install -Dm755 -t "$(BIN_DIR)/" "target/release/$(BIN)"
install -Dm644 -t "$(LIB_DIR)/systemd/user" "$(BIN).service"
install -Dm644 -t "$(SHARE_DIR)/licenses/$(BIN)/" LICENSE.md
install -Dm644 -t "$(SHARE_DIR)/$(BIN)/examples/" config.toml.example
install -Dm755 -t "$(SHARE_DIR)/$(BIN)/examples/" contrib/generate_icons.py
.PHONY: dist
dist: clean build
mkdir -p dist
cp "target/release/$(BIN)" .
tar -czvf "dist/$(BIN)-$(VERSION)-linux-x86_64.tar.gz" "$(BIN)" "$(BIN).service" config.toml.example LICENSE.md README.md Makefile contrib/generate_icons.py
git archive -o "dist/$(BIN)-$(VERSION).tar.gz" --format tar.gz --prefix "$(BIN)-$(VERSION)/" "$(VERSION)"
for f in dist/*.tar.gz; do gpg --detach-sign --armor "$$f"; done
rm -f "dist/$(BIN)-$(VERSION).tar.gz" "$(BIN)"