58 lines
1.9 KiB
Makefile
58 lines
1.9 KiB
Makefile
DESTDIR?=
|
|
PREFIX?=/usr/local
|
|
EXEC_PREFIX?=$(PREFIX)
|
|
BINDIR?=$(DESTDIR)$(EXEC_PREFIX)/bin
|
|
DATAROOTDIR?=$(PREFIX)/share
|
|
MANDIR?=$(DATAROOTDIR)/man
|
|
|
|
BINS:=sshwot-export-known-hosts sshwot-filter sshwot-verify
|
|
MAN1S:=sshwot-verify.1
|
|
|
|
SSHWOT_EXPORT_KNOWN_HOSTS_MAIN:=src/main-export-known-hosts.py
|
|
SSHWOT_EXPORT_KNOWN_HOSTS_DEPS:=src/entry.py src/hashing.py src/process_known_hosts.py src/write_file.py
|
|
|
|
SSHWOT_FILTER_MAIN:=src/main-filter.py
|
|
SSHWOT_FILTER_DEPS:=src/entry.py src/hashing.py src/default_files.py src/read_file.py src/write_file.py
|
|
|
|
SSHWOT_VERIFY_MAIN:=src/main-verify.py
|
|
SSHWOT_VERIFY_DEPS:=src/check_fingerprint.py src/default_files.py src/entry.py src/hashing.py src/read_file.py
|
|
|
|
all: $(BINS)
|
|
|
|
sshwot-export-known-hosts: $(SSHWOT_EXPORT_KNOWN_HOSTS_MAIN) $(SSHWOT_EXPORT_KNOWN_HOSTS_DEPS)
|
|
mkdir -p build/$@
|
|
cp $(SSHWOT_EXPORT_KNOWN_HOSTS_DEPS) build/$@/
|
|
cp $(SSHWOT_EXPORT_KNOWN_HOSTS_MAIN) build/$@/__main__.py
|
|
python3 -m zipapp -o $@ -p "/usr/bin/env python3" build/$@
|
|
|
|
sshwot-filter: $(SSHWOT_FILTER_MAIN) $(SSHWOT_FILTER_DEPS)
|
|
mkdir -p build/$@
|
|
cp $(SSHWOT_FILTER_DEPS) build/$@/
|
|
cp $(SSHWOT_FILTER_MAIN) build/$@/__main__.py
|
|
python3 -m zipapp -o $@ -p "/usr/bin/env python3" build/$@
|
|
|
|
sshwot-verify: $(SSHWOT_VERIFY_MAIN) $(SSHWOT_VERIFY_DEPS)
|
|
mkdir -p build/$@
|
|
cp $(SSHWOT_VERIFY_DEPS) build/$@/
|
|
cp $(SSHWOT_VERIFY_MAIN) build/$@/__main__.py
|
|
python3 -m zipapp -o $@ -p "/usr/bin/env python3" build/$@
|
|
|
|
.PHONY: all install unininstall clean distclean buildclean
|
|
|
|
install: $(BINS) $(MAN1S)
|
|
mkdir -p $(DESTDIR)$(BINDIR)
|
|
install $(BINS) $(DESTDIR)$(BINDIR)
|
|
mkdir -p $(DESTDIR)$(MANDIR)/man1
|
|
cp $(MAN1S) $(DESTDIR)$(MANDIR)/man1
|
|
|
|
uninstall:
|
|
rm $(DESTDIR)$(BINDIR)/sshwot-export-known-hosts $(DESTDIR)$(BINDIR)/sshwot-filter $(DESTDIR)$(BINDIR)/sshwot-verify
|
|
rm $(DESTDIR)$(MANDIR)/man1/sshwot-verify.1
|
|
|
|
clean:
|
|
rm -rf build $(BINS)
|
|
|
|
distclean: clean
|
|
|
|
buildclean:
|
|
rm -rf build
|