Makefile 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. DESTDIR =
  2. PREFIX = /usr/local
  3. BASHDIR = $(PREFIX)/etc/bash_completion.d
  4. ZSHDIR = /usr/share/zsh/vendor-completions
  5. FISHDIR = $(PREFIX)/share/fish/vendor_completions.d
  6. FEATURES ?= default
  7. all: target/release/exa
  8. build: target/release/exa
  9. target/release/exa:
  10. cargo build --release --no-default-features --features "$(FEATURES)"
  11. install: install-exa install-man
  12. install-exa: target/release/exa
  13. install -m755 -- target/release/exa "$(DESTDIR)$(PREFIX)/bin/"
  14. install-man:
  15. install -dm755 -- "$(DESTDIR)$(PREFIX)/bin/" "$(DESTDIR)$(PREFIX)/share/man/man1/"
  16. install -m644 -- contrib/man/exa.1 "$(DESTDIR)$(PREFIX)/share/man/man1/"
  17. install-bash-completions:
  18. install -m644 -- contrib/completions.bash "$(BASHDIR)/exa"
  19. install-zsh-completions:
  20. install -m644 -- contrib/completions.zsh "$(ZSHDIR)/_exa"
  21. install-fish-completions:
  22. install -m644 -- contrib/completions.fish "$(FISHDIR)/exa.fish"
  23. uninstall:
  24. -rm -f -- "$(DESTDIR)$(PREFIX)/share/man/man1/exa.1"
  25. -rm -f -- "$(DESTDIR)$(PREFIX)/bin/exa"
  26. -rm -f -- "$(BASHDIR)/exa"
  27. -rm -f -- "$(ZSHDIR)/_exa"
  28. -rm -f -- "$(FISHDIR)/exa.fish"
  29. clean:
  30. cargo clean
  31. preview-man:
  32. man contrib/man/exa.1
  33. help:
  34. @echo 'Available make targets:'
  35. @echo ' all - build exa (default)'
  36. @echo ' build - build exa'
  37. @echo ' clean - run `cargo clean`'
  38. @echo ' install - build and install exa and manpage'
  39. @echo ' install-exa - build and install exa'
  40. @echo ' install-man - install the manpage'
  41. @echo ' uninstall - uninstall fish, manpage, and completions'
  42. @echo ' preview-man - preview the manpage without installing'
  43. @echo ' help - print this help'
  44. @echo
  45. @echo ' install-bash-completions - install bash completions into $$BASHDIR'
  46. @echo ' install-zsh-completions - install zsh completions into $$ZSHDIR'
  47. @echo ' install-fish-completions - install fish completions into $$FISHDIR'
  48. @echo
  49. @echo 'Variables:'
  50. @echo ' DESTDIR - A path that'\''s prepended to installation paths (default: "")'
  51. @echo ' PREFIX - The installation prefix for everything except zsh completions (default: /usr/local)'
  52. @echo ' BASHDIR - The directory to install bash completions in (default: $$PREFIX/etc/bash_completion.d)'
  53. @echo ' ZSHDIR - The directory to install zsh completions in (default: /usr/share/zsh/vendor-completions)'
  54. @echo ' FISHDIR - The directory to install fish completions in (default: $$PREFIX/share/fish/vendor_completions.d)'
  55. @echo ' FEATURES - The cargo feature flags to use. Set to an empty string to disable git support'
  56. .PHONY: all build target/release/exa install-exa install-man preview-man \
  57. install-bash-completions install-zsh-completions install-fish-completions \
  58. clean uninstall help