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
61
62
63
64
65
66
# rustfetch developer helpers
# Usage: make install | make completions-install | make man-install
PREFIX ?= $(HOME)/.local
BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man/man1
CARGO_BIN ?= $(HOME)/.cargo/bin
BASH_COMPDIR ?= $(PREFIX)/share/bash-completion/completions
ZSH_COMPDIR ?= $(PREFIX)/share/zsh/site-functions
FISH_COMPDIR ?= $(PREFIX)/share/fish/vendor_completions.d
.PHONY: all build release test install uninstall completions-install man-install publish-dry-run clean help
all: release
build:
cargo build
release:
cargo build --release
test:
cargo test
# Install the release binary to BINDIR (default: ~/.local/bin).
# Falls back to cargo install --path when preferred.
install: release
mkdir -p "$(BINDIR)"
install -m755 target/release/rustfetch "$(BINDIR)/rustfetch"
@echo "Installed $(BINDIR)/rustfetch"
@echo "Tip: also run 'make completions-install' and 'make man-install'"
# Alternative: cargo-managed install into ~/.cargo/bin
install-cargo:
cargo install --path . --force --locked
uninstall:
rm -f "$(BINDIR)/rustfetch"
rm -f "$(CARGO_BIN)/rustfetch"
@echo "Removed rustfetch from $(BINDIR) (and $(CARGO_BIN) if present)"
completions-install: release
mkdir -p "$(BASH_COMPDIR)" "$(ZSH_COMPDIR)" "$(FISH_COMPDIR)"
./target/release/rustfetch --completions bash > "$(BASH_COMPDIR)/rustfetch"
./target/release/rustfetch --completions zsh > "$(ZSH_COMPDIR)/_rustfetch"
./target/release/rustfetch --completions fish > "$(FISH_COMPDIR)/rustfetch.fish"
@echo "Completions installed under $(PREFIX)/share/..."
man-install:
mkdir -p "$(MANDIR)"
install -m644 man/rustfetch.1 "$(MANDIR)/rustfetch.1"
@echo "Man page installed to $(MANDIR)/rustfetch.1"
@mandb "$(PREFIX)/share/man" 2>/dev/null || true
# Never uploads to crates.io — dry-run only.
publish-dry-run:
cargo publish --dry-run
clean:
cargo clean
help:
@echo "Targets: build release test install install-cargo uninstall"
@echo " completions-install man-install publish-dry-run clean"
@echo "PREFIX=$(PREFIX) BINDIR=$(BINDIR)"
@echo "crates.io: cargo install rustftechh --locked (binary: rustfetch)"