chiark / gitweb /
python: Provide feature for argparse --[no-]foo options
[secnet.git] / Makefile.in
index 45b4866904206ead6dbe38c967b95cc5e0e250b7..0423cf44ebf5a87a13b618664c544f4e2bafa291 100644 (file)
 .PHONY:        all clean realclean distclean dist install
 
 PACKAGE:=secnet
-VERSION=0.4.5
+VERSION=0.5.0
 
 VPATH:=@srcdir@
-
+srcdir:=@srcdir@
 include common.make
 
 INSTALL:=@INSTALL@
@@ -55,6 +55,8 @@ OBJECTS:=secnet.o util.o conffile.yy.o conffile.tab.o conffile.o modules.o \
        hackypar.o
 # version.o is handled specially below and in the link rule for secnet.
 
+PYMODULES := ipaddrset.py argparseactionnoyes.py
+
 TEST_OBJECTS:=eax-aes-test.o eax-serpent-test.o eax-serpentbe-test.o \
                eax-test.o aes.o
 
@@ -87,13 +89,13 @@ ${srcdir}/configure: configure.in
        cd ${srcdir} && autoconf
 
 # autoheader might not change config.h.in, so touch a stamp file.
-${srcdir}/config.h.in: stamp-h.in
-${srcdir}/stamp-h.in: configure.in
+${srcdir}/config.h.in: config.stamp.in
+${srcdir}/config.stamp.in: configure.in
        cd ${srcdir} && autoheader
-       echo timestamp > ${srcdir}/stamp-h.in
+       echo timestamp > ${srcdir}/config.stamp.in
 
-config.h: stamp-h
-stamp-h: config.h.in config.status
+config.h: config.stamp
+config.stamp: config.h.in config.status
        ./config.status
 
 Makefile: Makefile.in config.status
@@ -131,9 +133,21 @@ secnet: Makefile .git/HEAD $(shell sed -n 's#^ref: #.git/#p' .git/HEAD)
 secnet: $(wildcard .git/packed-refs)
 endif
 
-check: eax-aes-test.confirm eax-serpent-test.confirm \
+TESTDIRS=stest mtest
+
+FAST_CHECKS= eax-aes-test.confirm eax-serpent-test.confirm \
        eax-serpentbe-test.confirm check-ipaddrset \
-       msgcode-test.confirm check-test
+       $(addprefix check-,$(TESTDIRS))
+
+CHECKS += $(FAST_CHECKS)
+CHECKS += msgcode-test.confirm
+
+check: $(CHECKS)
+
+recheck:
+       rm -f $(FAST_CHECKS)
+       rm -rf $(addsuffix /d-*, $(TESTDIRS))
+       $(MAKE) check
 
 version.c: Makefile
        echo "#include \"secnet.h\"" >$@.new
@@ -164,8 +178,11 @@ 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
 
-check-test: secnet test-example/sites.conf
-       $(MAKE) -C test check
+check-stest: secnet test-example/sites.conf
+       $(MAKE) -C stest check
+
+check-mtest: make-secnet-sites $(PYMODULES)
+       $(MAKE) -C mtest check
 
 test-example/sites.conf:
        $(MAKE) -C test-example
@@ -188,7 +205,9 @@ install: installdirs
        $$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
+       set -e; for m in $(PYMODULES); do \
+               $(INSTALL_DATA) ${srcdir}/$$m $(prefix)/share/secnet/$$m; \
+               done
        $(INSTALL_SCRIPT) ${srcdir}/polypath-interface-monitor-linux \
                $(datarootdir)/secnet/.
        $(INSTALL_DATA) ${srcdir}/secnet.8 $(mandir)/man8/secnet.8
@@ -197,15 +216,19 @@ install-force:
        rm -f $(STALE_PYTHON_FILES)
        $(MAKE) install
 
-clean:
+clean: $(addprefix clean-,$(TESTDIRS))
        $(RM) -f *.o *.yy.[ch] *.tab.[ch] $(TARGETS) core version.c
        $(RM) -f *.d *.pyc *~ eax-*-test.confirm eax-*-test
+       $(RM) -rf __pycache__
        $(RM) -f msgcode-test.confirm msgcode-test
 
+$(addprefix clean-,$(TESTDIRS)): clean-%:
+       $(MAKE) -C $* clean
+
 realclean:     clean
        $(RM) -f *~ Makefile config.h  *.d \
        config.log config.status config.cache \
-       stamp-h Makefile.bak
+       config.stamp Makefile.bak
 
 distclean:     realclean
 
@@ -223,7 +246,7 @@ distclean:  realclean
 #     finalise debian/changelog (removing ~ from version) and commit.
 #
 #  4. Build source and binaries:
-#       dgit -wgf sbuild -A -c stretch
+#       dgit -wgf sbuild -A -c stretch -j8
 #
 #  5. dpkg -i on zealot just to check
 #       dpkg -i ~ian/things/Fvpn/bpd/secnet_${VERSION}_amd64.deb