+eax-%-test: eax-%-test.o eax-test.o %.o
+ $(CC) $(LDFLAGS) $(ALL_CFLAGS) -o $@ $^
+
+eax-%-test.confirm: eax-%-test eax-%-test.vectors
+ ./$< <$(srcdir)/eax-$*-test.vectors >$@.new
+ mv -f $@.new $@
+
+msgcode-test: msgcode-test.o
+ $(CC) $(LDFLAGS) $(ALL_CFLAGS) -o $@ $^
+
+msgcode-test.confirm: msgcode-test
+ ./msgcode-test
+ touch $@
+
+XDH_FUNCS = x25519 x448
+x25519_FIELD = f25519
+x448_FIELD = fgoldi
+
+$(addsuffix -test, $(XDH_FUNCS)): %-test: %-test.o %.o
+ $(CC) $(LDFLAGS) $(ALL_CFLAGS) -o $@ $^
+x25519-test: f25519.o
+x448-test: fgoldi.o
+
+$(addsuffix -test.o, $(XDH_FUNCS)): %-test.o: xdh-test.c
+ $(CC) $(CPPFLAGS) $(ALL_CFLAGS) -c \
+ -DXDH=$* -DFIELD=$($*_FIELD) \
+ $< -o $@
+
+$(addsuffix -test.confirm, $(XDH_FUNCS)): %-test.confirm: %-test %-tests.in
+ ./$*-test <$(srcdir)/$*-tests.in
+ touch $@
+
+check-ipaddrset: ipaddrset-test.py ipaddrset.py ipaddrset-test.expected
+ $(srcdir)/ipaddrset-test.py >ipaddrset-test.new
+ diff -u $(srcdir)/ipaddrset-test.expected ipaddrset-test.new
+
+.PRECIOUS: eax-%-test
+
+installdirs:
+ $(INSTALL) -d $(prefix)/share/secnet $(sbindir)
+ $(INSTALL) -d $(mandir)/man8
+ $(INSTALL) -d $(datarootdir)/secnet
+
+install: installdirs
+ set -e; ok=true; for f in $(STALE_PYTHON_FILES); do \
+ if test -e $$f; then \
+ echo >&2 "ERROR: $$f still exists "\
+ "- try \`make install-force'"; \
+ ok=false; \
+ fi; \
+ done; \
+ $$ok
+ $(INSTALL_PROGRAM) secnet $(sbindir)/`echo secnet|sed '$(transform)'`
+ $(INSTALL_PROGRAM) ${srcdir}/make-secnet-sites $(sbindir)/`echo make-secnet-sites|sed '$(transform)'`
+ $(INSTALL_DATA) ${srcdir}/ipaddrset.py $(prefix)/share/secnet/ipaddrset.py
+ $(INSTALL_SCRIPT) ${srcdir}/polypath-interface-monitor-linux \
+ $(datarootdir)/secnet/.
+ $(INSTALL_DATA) ${srcdir}/secnet.8 $(mandir)/man8/secnet.8
+
+install-force:
+ rm -f $(STALE_PYTHON_FILES)
+ $(MAKE) install