Makefile 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. PREFIX ?= /usr/local
  2. BUILD = target/release/exa
  3. $(BUILD):
  4. @which rustc > /dev/null || { echo "exa requires Rust to compile. For installation instructions, please visit http://rust-lang.org/"; exit 1; }
  5. if test -n "$$(echo "$$CC" | cut -d \ -f 1)"; then \
  6. env CC="$$(echo "$$CC" | cut -d \ -f 1)" cargo build --release; \
  7. else\
  8. env -u CC cargo build --release; \
  9. fi
  10. build: $(BUILD)
  11. build-no-git:
  12. @which rustc > /dev/null || { echo "exa requires Rust to compile. For installation instructions, please visit http://rust-lang.org/"; exit 1; }
  13. if test -n "$$(echo "$$CC" | cut -d \ -f 1)"; then \
  14. env CC="$$(echo "$$CC" | cut -d \ -f 1)" cargo build --release --no-default-features; \
  15. else\
  16. env -u CC cargo build --release --no-default-features; \
  17. fi
  18. INSTALL = $(PREFIX)/bin/exa
  19. $(INSTALL):
  20. # BSD and OSX don't have -D to create leading directories
  21. install -dm755 -- "$(PREFIX)/bin/" "$(DESTDIR)$(PREFIX)/share/man/man1/"
  22. install -sm755 -- target/release/exa "$(DESTDIR)$(PREFIX)/bin/"
  23. install -m644 -- contrib/man/*.1 "$(DESTDIR)$(PREFIX)/share/man/man1/"
  24. install: build $(INSTALL)
  25. .PHONY: install