Makefile 737 B

12345678910111213141516171819202122232425262728293031323334353637
  1. .POSIX:
  2. # Install prefix
  3. PREFIX = $(HOME)/.cargo
  4. # Cargo binary
  5. CARGO = cargo +nightly
  6. # Compile target
  7. RUST_TARGET = $(shell rustc -Vv | grep '^host: ' | cut -d' ' -f2)
  8. SRC = \
  9. Cargo.toml \
  10. ../../Cargo.toml \
  11. $(shell find src -type f -name '*.rs') \
  12. $(shell find ../../src -type f -name '*.rs') \
  13. BIN = ../../lilith
  14. all: $(BIN)
  15. $(BIN): $(SRC)
  16. RUSTFLAGS="$(RUSTFLAGS)" $(CARGO) build --target=$(RUST_TARGET) --release --package lilith
  17. cp -f ../../target/$(RUST_TARGET)/release/lilith $@
  18. clean:
  19. rm -f $(BIN)
  20. install: all
  21. mkdir -p $(DESTDIR)$(PREFIX)/bin
  22. cp -f $(BIN) $(DESTDIR)$(PREFIX)/bin
  23. chmod 755 $(DESTDIR)$(PREFIX)/bin/lilith
  24. uninstall:
  25. rm -f $(DESTDIR)$(PREFIX)/bin/lilith
  26. .PHONY: all clean install uninstall