sshwot/Makefile

38 lines
1.1 KiB
Makefile

BINS:=sshwot-export-known-hosts sshwot-filter
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/read_file.py src/write_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
zip --quiet --junk-paths build/$@.zip build/$@/*.py
echo '#!/usr/bin/env python3' > $@
cat build/$@.zip >> $@
chmod +x $@
sshwot-filter: $(SSHWOT_FILTER_MAIN) $(SSHWOT_FILTER_DEPS)
mkdir -p build/$@
cp $(SSHWOT_FILTER_DEPS) build/$@/
cp $(SSHWOT_FILTER_MAIN) build/$@/__main__.py
zip --quiet --junk-paths build/$@.zip build/$@/*.py
echo '#!/usr/bin/env python3' > $@
cat build/$@.zip >> $@
chmod +x $@
.PHONY: all clean distclean buildclean
clean:
rm -rf build $(BINS)
distclean: clean
buildclean:
rm -rf build