Makefile 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. PREFIX = /usr/local
  2. BUILD = target/release/exa
  3. $(BUILD):
  4. if test -n "$$(echo "$$CC" | cut -d \ -f 1)"; then \
  5. env CC="$$(echo "$$CC" | cut -d \ -f 1)" cargo build --release; \
  6. else\
  7. env -u CC cargo build --release; \
  8. fi
  9. build: $(BUILD)
  10. build-no-git:
  11. if test -n "$$(echo "$$CC" | cut -d \ -f 1)"; then \
  12. env CC="$$(echo "$$CC" | cut -d \ -f 1)" cargo build --release --no-default-features; \
  13. else\
  14. env -u CC cargo build --release --no-default-features; \
  15. fi
  16. install: target/release/exa
  17. # BSD and OSX don't have -D to create leading directories
  18. install -dm755 -- "$(PREFIX)/bin/" "$(DESTDIR)$(PREFIX)/share/man/man1/"
  19. install -sm755 -- target/release/exa "$(DESTDIR)$(PREFIX)/bin/"
  20. install -m644 -- contrib/man/exa.1 "$(DESTDIR)$(PREFIX)/share/man/man1/"
  21. uninstall:
  22. -rm -- "$(DESTDIR)$(PREFIX)/share/man/man1/exa.1"
  23. -rmdir -- "$(DESTDIR)$(PREFIX)/share/man/man1"
  24. -rm -- "$(DESTDIR)$(PREFIX)/bin/exa"
  25. -rmdir -- "$(DESTDIR)$(PREFIX)/bin"
  26. clean:
  27. -rm -rf target
  28. .PHONY: install uninstall clean