Skip to content

Commit e5764ff

Browse files
committed
Fix a bunch of issues with the Makefile
* `$BASHDIR` and `$FISHDIR` had incorrect paths * Fix `$FEATURES` to actually work * Add `-f` to `rm` invocations to quiet missing file errors * Just use `man` to preview the manpage * Fix (again) `make` not rebuilding * Add `make help` to view all of the commands and variables
1 parent d2b1499 commit e5764ff

File tree

1 file changed

+36
-15
lines changed

1 file changed

+36
-15
lines changed

Makefile

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
DESTDIR =
22
PREFIX = /usr/local
33

4-
BASHDIR = /etc/bash_completion.d
4+
BASHDIR = $(PREFIX)/etc/bash_completion.d
55
ZSHDIR = /usr/share/zsh/vendor-completions
6-
FISHDIR = /usr/share/fish/completions
6+
FISHDIR = $(PREFIX)/share/fish/vendor_completions.d
77

88
FEATURES ?= default
99

@@ -12,7 +12,7 @@ all: target/release/exa
1212
build: target/release/exa
1313

1414
target/release/exa:
15-
cargo build --release --features "${ENABLE_FEATURES}"
15+
cargo build --release --no-default-features --features "$(FEATURES)"
1616

1717
install: install-exa install-man
1818

@@ -32,22 +32,43 @@ install-zsh-completions:
3232
install-fish-completions:
3333
install -m644 -- contrib/completions.fish "$(FISHDIR)/exa.fish"
3434

35-
3635
uninstall:
37-
-rm -- "$(DESTDIR)$(PREFIX)/share/man/man1/exa.1"
38-
-rm -- "$(DESTDIR)$(PREFIX)/bin/exa"
39-
-rm -- "$(BASHDIR)/exa"
40-
-rm -- "$(ZSHDIR)/_exa"
41-
-rm -- "$(FISHDIR)/exa.fish"
36+
-rm -f -- "$(DESTDIR)$(PREFIX)/share/man/man1/exa.1"
37+
-rm -f -- "$(DESTDIR)$(PREFIX)/bin/exa"
38+
-rm -f -- "$(BASHDIR)/exa"
39+
-rm -f -- "$(ZSHDIR)/_exa"
40+
-rm -f -- "$(FISHDIR)/exa.fish"
4241

4342
clean:
4443
cargo clean
4544

46-
4745
preview-man:
48-
nroff -man contrib/man/exa.1 | less
49-
50-
51-
.PHONY: all build install-exa install-man preview-man \
46+
man contrib/man/exa.1
47+
48+
help:
49+
@echo 'Available make targets:'
50+
@echo ' all - build exa (default)'
51+
@echo ' build - build exa'
52+
@echo ' clean - run `cargo clean`'
53+
@echo ' install - build and install exa and manpage'
54+
@echo ' install-exa - build and install exa'
55+
@echo ' install-man - install the manpage'
56+
@echo ' uninstall - uninstall fish, manpage, and completions'
57+
@echo ' preview-man - preview the manpage without installing'
58+
@echo ' help - print this help'
59+
@echo
60+
@echo ' install-bash-completions - install bash completions into $$BASHDIR'
61+
@echo ' install-zsh-completions - install zsh completions into $$ZSHDIR'
62+
@echo ' install-fish-completions - install fish completions into $$FISHDIR'
63+
@echo
64+
@echo 'Variables:'
65+
@echo ' DESTDIR - A path that'\''s prepended to installation paths (default: "")'
66+
@echo ' PREFIX - The installation prefix for everything except zsh completions (default: /usr/local)'
67+
@echo ' BASHDIR - The directory to install bash completions in (default: $$PREFIX/etc/bash_completion.d)'
68+
@echo ' ZSHDIR - The directory to install zsh completions in (default: /usr/share/zsh/vendor-completions)'
69+
@echo ' FISHDIR - The directory to install fish completions in (default: $$PREFIX/share/fish/vendor_completions.d)'
70+
@echo ' FEATURES - The cargo feature flags to use. Set to an empty string to disable git support'
71+
72+
.PHONY: all build target/release/exa install-exa install-man preview-man \
5273
install-bash-completions install-zsh-completions install-fish-completions \
53-
clean uninstall
74+
clean uninstall help

0 commit comments

Comments
 (0)