Makefile 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. DESTDIR?=
  2. PREFIX?=/usr/local
  3. EXEC_PREFIX?=$(PREFIX)
  4. BINDIR?=$(DESTDIR)$(EXEC_PREFIX)/bin
  5. DATAROOTDIR?=$(PREFIX)/share
  6. MANDIR?=$(DATAROOTDIR)/man
  7. BINS:=sshwot-export-known-hosts sshwot-filter sshwot-verify
  8. MAN1S:=sshwot-verify.1
  9. SSHWOT_EXPORT_KNOWN_HOSTS_MAIN:=src/main-export-known-hosts.py
  10. SSHWOT_EXPORT_KNOWN_HOSTS_DEPS:=src/entry.py src/hashing.py src/process_known_hosts.py src/write_file.py
  11. SSHWOT_FILTER_MAIN:=src/main-filter.py
  12. SSHWOT_FILTER_DEPS:=src/entry.py src/hashing.py src/default_files.py src/read_file.py src/write_file.py
  13. SSHWOT_VERIFY_MAIN:=src/main-verify.py
  14. SSHWOT_VERIFY_DEPS:=src/check_fingerprint.py src/default_files.py src/entry.py src/hashing.py src/read_file.py
  15. all: $(BINS)
  16. sshwot-export-known-hosts: $(SSHWOT_EXPORT_KNOWN_HOSTS_MAIN) $(SSHWOT_EXPORT_KNOWN_HOSTS_DEPS)
  17. mkdir -p build/$@
  18. cp $(SSHWOT_EXPORT_KNOWN_HOSTS_DEPS) build/$@/
  19. cp $(SSHWOT_EXPORT_KNOWN_HOSTS_MAIN) build/$@/__main__.py
  20. python3 -m zipapp -o $@ -p "/usr/bin/env python3" build/$@
  21. sshwot-filter: $(SSHWOT_FILTER_MAIN) $(SSHWOT_FILTER_DEPS)
  22. mkdir -p build/$@
  23. cp $(SSHWOT_FILTER_DEPS) build/$@/
  24. cp $(SSHWOT_FILTER_MAIN) build/$@/__main__.py
  25. python3 -m zipapp -o $@ -p "/usr/bin/env python3" build/$@
  26. sshwot-verify: $(SSHWOT_VERIFY_MAIN) $(SSHWOT_VERIFY_DEPS)
  27. mkdir -p build/$@
  28. cp $(SSHWOT_VERIFY_DEPS) build/$@/
  29. cp $(SSHWOT_VERIFY_MAIN) build/$@/__main__.py
  30. python3 -m zipapp -o $@ -p "/usr/bin/env python3" build/$@
  31. .PHONY: all install unininstall clean distclean buildclean
  32. install: $(BINS) $(MAN1S)
  33. mkdir -p $(DESTDIR)$(BINDIR)
  34. install $(BINS) $(DESTDIR)$(BINDIR)
  35. mkdir -p $(DESTDIR)$(MANDIR)/man1
  36. cp $(MAN1S) $(DESTDIR)$(MANDIR)/man1
  37. uninstall:
  38. rm $(DESTDIR)$(BINDIR)/sshwot-export-known-hosts $(DESTDIR)$(BINDIR)/sshwot-filter $(DESTDIR)$(BINDIR)/sshwot-verify
  39. rm $(DESTDIR)$(MANDIR)/man1/sshwot-verify.1
  40. clean:
  41. rm -rf build $(BINS)
  42. distclean: clean
  43. buildclean:
  44. rm -rf build