-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (44 loc) · 1.6 KB
/
Copy pathMakefile
File metadata and controls
57 lines (44 loc) · 1.6 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
.PHONY: all build release install uninstall clean test lint help
PREFIX ?= /usr/local
BINDIR ?= $(PREFIX)/bin
all: build
build:
cargo build
release:
cargo build --release
install: release
install -d $(DESTDIR)$(BINDIR)
install -m 755 target/release/torot $(DESTDIR)$(BINDIR)/torot
install -d $(DESTDIR)$(PREFIX)/share/bash-completion/completions
install -m 644 completions/torot.bash $(DESTDIR)$(PREFIX)/share/bash-completion/completions/torot
install -d $(DESTDIR)$(PREFIX)/share/zsh/site-functions
install -m 644 completions/torot.zsh $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_torot
install -d $(DESTDIR)$(PREFIX)/share/fish/vendor_completions.d
install -m 644 completions/torot.fish $(DESTDIR)$(PREFIX)/share/fish/vendor_completions.d/torot.fish
@echo "Installed torot and completions to $(DESTDIR)$(PREFIX)"
uninstall:
rm -f $(DESTDIR)$(BINDIR)/torot
rm -f $(DESTDIR)$(PREFIX)/share/bash-completion/completions/torot
rm -f $(DESTDIR)$(PREFIX)/share/zsh/site-functions/_torot
rm -f $(DESTDIR)$(PREFIX)/share/fish/vendor_completions.d/torot.fish
clean:
cargo clean
test:
cargo test
lint:
cargo clippy -- -D warnings
fmt:
cargo fmt
check: lint test build
release-check: lint test release
help:
@echo "Targets:"
@echo " build - Build in debug mode"
@echo " release - Build in release mode"
@echo " install - Install release binary"
@echo " uninstall - Remove installed binary"
@echo " clean - Clean build artifacts"
@echo " test - Run tests"
@echo " lint - Run clippy"
@echo " fmt - Format code"
@echo " check - Lint + test + build"