2017-05-07 15:28:36 +00:00
|
|
|
DESTDIR =
|
|
|
|
PREFIX = /usr/local
|
|
|
|
|
2017-05-16 22:19:01 +00:00
|
|
|
override define compdir
|
|
|
|
ifndef $(1)
|
|
|
|
$(1) := $$(or $$(shell pkg-config --variable=completionsdir $(2) 2>/dev/null),$(3))
|
|
|
|
endif
|
|
|
|
endef
|
|
|
|
|
|
|
|
$(eval $(call compdir,BASHDIR,bash-completion,$(PREFIX)/etc/bash_completion.d))
|
2019-01-27 03:21:59 +00:00
|
|
|
$(eval $(call compdir,ZSHDIR,zsh,/usr/share/zsh/vendor_completions.d))
|
2017-05-16 22:19:01 +00:00
|
|
|
$(eval $(call compdir,FISHDIR,fish,$(PREFIX)/share/fish/vendor_completions.d))
|
2017-05-07 15:28:36 +00:00
|
|
|
|
|
|
|
FEATURES ?= default
|
2017-09-16 19:44:14 +00:00
|
|
|
CARGO_OPTS := --no-default-features --features "$(FEATURES)"
|
2015-02-24 15:48:39 +00:00
|
|
|
|
2016-07-04 11:55:56 +00:00
|
|
|
all: target/release/exa
|
2017-05-07 15:28:36 +00:00
|
|
|
build: target/release/exa
|
2015-02-24 15:48:39 +00:00
|
|
|
|
2017-05-07 15:28:36 +00:00
|
|
|
target/release/exa:
|
2017-09-16 19:44:14 +00:00
|
|
|
cargo build --release $(CARGO_OPTS)
|
2015-02-24 15:48:39 +00:00
|
|
|
|
2017-05-07 15:28:36 +00:00
|
|
|
install: install-exa install-man
|
2015-06-07 13:35:56 +00:00
|
|
|
|
2017-05-07 15:28:36 +00:00
|
|
|
install-exa: target/release/exa
|
2016-07-04 17:02:22 +00:00
|
|
|
install -m755 -- target/release/exa "$(DESTDIR)$(PREFIX)/bin/"
|
2017-05-07 15:28:36 +00:00
|
|
|
|
|
|
|
install-man:
|
|
|
|
install -dm755 -- "$(DESTDIR)$(PREFIX)/bin/" "$(DESTDIR)$(PREFIX)/share/man/man1/"
|
2016-07-04 11:48:07 +00:00
|
|
|
install -m644 -- contrib/man/exa.1 "$(DESTDIR)$(PREFIX)/share/man/man1/"
|
2015-02-24 15:48:39 +00:00
|
|
|
|
2017-05-07 15:28:36 +00:00
|
|
|
install-bash-completions:
|
2017-05-16 21:48:26 +00:00
|
|
|
install -m644 -- contrib/completions.bash "$(DESTDIR)$(BASHDIR)/exa"
|
2017-05-07 15:28:36 +00:00
|
|
|
|
|
|
|
install-zsh-completions:
|
2017-05-16 21:48:26 +00:00
|
|
|
install -m644 -- contrib/completions.zsh "$(DESTDIR)$(ZSHDIR)/_exa"
|
2017-05-07 15:28:36 +00:00
|
|
|
|
|
|
|
install-fish-completions:
|
2017-05-16 21:48:26 +00:00
|
|
|
install -m644 -- contrib/completions.fish "$(DESTDIR)$(FISHDIR)/exa.fish"
|
2017-05-07 15:28:36 +00:00
|
|
|
|
2017-09-16 19:44:14 +00:00
|
|
|
test: target/release/exa
|
|
|
|
cargo test --release $(CARGO_OPTS)
|
|
|
|
|
2017-10-10 18:46:44 +00:00
|
|
|
check: test
|
|
|
|
|
2016-07-04 11:48:07 +00:00
|
|
|
uninstall:
|
2017-05-09 03:52:23 +00:00
|
|
|
-rm -f -- "$(DESTDIR)$(PREFIX)/share/man/man1/exa.1"
|
|
|
|
-rm -f -- "$(DESTDIR)$(PREFIX)/bin/exa"
|
2017-05-16 21:48:26 +00:00
|
|
|
-rm -f -- "$(DESTDIR)$(BASHDIR)/exa"
|
|
|
|
-rm -f -- "$(DESTDIR)$(ZSHDIR)/_exa"
|
|
|
|
-rm -f -- "$(DESTDIR)$(FISHDIR)/exa.fish"
|
2015-02-24 15:48:39 +00:00
|
|
|
|
2016-07-04 11:50:08 +00:00
|
|
|
clean:
|
2017-05-07 15:28:36 +00:00
|
|
|
cargo clean
|
|
|
|
|
|
|
|
preview-man:
|
2017-05-09 03:52:23 +00:00
|
|
|
man contrib/man/exa.1
|
|
|
|
|
|
|
|
help:
|
|
|
|
@echo 'Available make targets:'
|
|
|
|
@echo ' all - build exa (default)'
|
|
|
|
@echo ' build - build exa'
|
|
|
|
@echo ' clean - run `cargo clean`'
|
|
|
|
@echo ' install - build and install exa and manpage'
|
|
|
|
@echo ' install-exa - build and install exa'
|
|
|
|
@echo ' install-man - install the manpage'
|
2017-09-16 19:44:14 +00:00
|
|
|
@echo ' test - run `cargo test`'
|
2017-05-09 03:52:23 +00:00
|
|
|
@echo ' uninstall - uninstall fish, manpage, and completions'
|
|
|
|
@echo ' preview-man - preview the manpage without installing'
|
|
|
|
@echo ' help - print this help'
|
|
|
|
@echo
|
|
|
|
@echo ' install-bash-completions - install bash completions into $$BASHDIR'
|
|
|
|
@echo ' install-zsh-completions - install zsh completions into $$ZSHDIR'
|
|
|
|
@echo ' install-fish-completions - install fish completions into $$FISHDIR'
|
|
|
|
@echo
|
|
|
|
@echo 'Variables:'
|
|
|
|
@echo ' DESTDIR - A path that'\''s prepended to installation paths (default: "")'
|
|
|
|
@echo ' PREFIX - The installation prefix for everything except zsh completions (default: /usr/local)'
|
|
|
|
@echo ' BASHDIR - The directory to install bash completions in (default: $$PREFIX/etc/bash_completion.d)'
|
|
|
|
@echo ' ZSHDIR - The directory to install zsh completions in (default: /usr/share/zsh/vendor-completions)'
|
|
|
|
@echo ' FISHDIR - The directory to install fish completions in (default: $$PREFIX/share/fish/vendor_completions.d)'
|
|
|
|
@echo ' FEATURES - The cargo feature flags to use. Set to an empty string to disable git support'
|
|
|
|
|
|
|
|
.PHONY: all build target/release/exa install-exa install-man preview-man \
|
2017-05-07 15:28:36 +00:00
|
|
|
install-bash-completions install-zsh-completions install-fish-completions \
|
2017-05-09 03:52:23 +00:00
|
|
|
clean uninstall help
|