X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=Dir.sd.mk;h=7671a38b11f5130b4a10429c877c2ba7ec5fbfd4;hb=9eba4abfe44617aa78f625d900fe6bc2c58bb4cb;hp=4111476a5b1bc9d0d5c2347b783235252509aa8b;hpb=16bce837ffe3527d4e8ed306f4436a86891d6e60;p=secnet.git diff --git a/Dir.sd.mk b/Dir.sd.mk index 4111476..7671a38 100644 --- a/Dir.sd.mk +++ b/Dir.sd.mk @@ -20,7 +20,7 @@ .PHONY: all clean realclean distclean dist install PACKAGE:=secnet -VERSION=0.5.1 +VERSION=0.6.0 VPATH:=@srcdir@ srcdir:=@srcdir@ @@ -50,14 +50,14 @@ TARGETS:=secnet OBJECTS:=secnet.o util.o conffile.yy.o conffile.tab.o conffile.o modules.o \ resolver.o random.o udp.o site.o transform-cbcmac.o transform-eax.o \ - comm-common.o polypath.o \ + comm-common.o polypath.o privcache.o pubkeys.o pubkeys.yy.o \ netlink.o rsa.o dh.o serpent.o serpentbe.o \ md5.o sha512.o tun.o slip.o sha1.o ipaddr.o log.o \ - process.o @LIBOBJS@ \ - hackypar.o + process.o osdep.o @LIBOBJS@ \ + hackypar.o base91s/base91.o # version.o is handled specially below and in the link rule for secnet. -PYMODULES := ipaddrset.py argparseactionnoyes.py +PYMODULES := ipaddrset.py argparseactionnoyes.py base91.py TEST_OBJECTS:=eax-aes-test.o eax-serpent-test.o eax-serpentbe-test.o \ eax-test.o aes.o @@ -75,17 +75,21 @@ STALE_PYTHON_FILES= $(foreach e, py pyc, \ $(DESTDIR)$p/share/secnet/$l.$e \ ))) -%.c: %.y - -%.yy.c: %.fl - flex --header=$*.yy.h -o$@ $< +%.yy.c %.yy.h: %.fl + flex --header=$*.yy.h -o$*.yy.c $< %.tab.c %.tab.h: %.y bison -d -o $@ $< -%.o: %.c conffile.yy.h +%.o: %.c $(CC) $(CPPFLAGS) $(ALL_CFLAGS) $(CDEPS_CFLAGS) -c $< -o $@ +$(OBJECTS): conffile.yy.h pubkeys.yy.h base91s/base91.h +# ^ we can't write this as a dependency on the %.o %.c rule +# because (say) conffile.yy.c isn't mentioned so doesn't "ought +# to exist" in make's mind. But specifying it explicitly like this +# works. + all:: $(TARGETS) ${srcdir}/config.h.in: configure.ac @@ -96,12 +100,11 @@ MAKEFILE_TEMPLATES += config.h.in CONFIG_STATUS_OUTPUTS += config.h # Manual dependencies section -conffile.yy.c: conffile.fl conffile.tab.c -conffile.yy.h: conffile.yy.c -conffile.tab.c: conffile.y +conffile.yy.c: conffile.tab.c +%.tab.c: %.y # End of manual dependencies section -conffile.yy.o: ALL_CFLAGS += -Wno-sign-compare +%.yy.o: ALL_CFLAGS += -Wno-sign-compare -Wno-unused-function secnet: $(OBJECTS) $(MAKE) -f main.mk version.o # *.o $(filter-out %.o, $^) @@ -125,10 +128,20 @@ TESTDIRS=stest mtest &TARGETS_fullcheck += $(&TARGETS_check) &TARGETS_fullcheck += msgcode-test.confirm -recheck: - rm -f $(&TARGETS_check) - rm -rf $(addsuffix /d-*, $(TESTDIRS)) - $(MAKE) -f main.mk check +RECHECK_RM += $(&TARGETS_check) +RECHECK_RM += $(addsuffix /d-*, $(TESTDIRS)); +# Really the eval below should come very late, so that subdirs can add +# their stuff to RECHECK_RM, but we do not have a way to do that with +# subdirmk yet. So we embed ad-hoc knowledge about TESTDIRS. + +# This contrives to delete things before make starts, if the user +# said "recheck". The alternative is having recheck be a target +# which contains the rm's and then runs $(MAKE) again but then +# we recursively re-enter make in parallel, which is Bad. +$(eval $(if $(filter recheck,$(MAKECMDGOALS)), \ + $(shell set -x; rm -rf $(RECHECK_RM) ))) + +recheck: check .PHONY: FORCE version.c: FORCE @@ -163,6 +176,11 @@ ipaddrset.confirm: ipaddrset-test.py ipaddrset.py ipaddrset-test.expected diff -u $(srcdir)/ipaddrset-test.expected ipaddrset-test.new touch $@ +&CLEAN += & pubkeys.fl + +pubkeys.fl: ${srcdir}/pubkeys.fl.pl + ${srcdir}/pubkeys.fl.pl >$@.tmp && mv -f $@.tmp $@ + .PRECIOUS: eax-%-test installdirs: