X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=Subdir.sd.mk;h=e0096df0dc9296776d6c46eb16141e86efefc5d5;hb=3a2c5e1f10dc6b3cc86f74c287d8c14be14d7e80;hp=2841cb1ba3eb267abd64eb33359d6e2f5b7796e0;hpb=70f479a7d7c90682562a82d3300a066f9cc92b19;p=secnet.git diff --git a/Subdir.sd.mk b/Subdir.sd.mk index 2841cb1..e0096df 100644 --- a/Subdir.sd.mk +++ b/Subdir.sd.mk @@ -20,7 +20,7 @@ .PHONY: all clean realclean distclean dist install PACKAGE:=secnet -VERSION=0.5.0 +VERSION=0.5.1 VPATH:=@srcdir@ srcdir:=@srcdir@ @@ -61,10 +61,12 @@ TEST_OBJECTS:=eax-aes-test.o eax-serpent-test.o eax-serpentbe-test.o \ eax-test.o aes.o ifeq (version.o,$(MAKECMDGOALS)) -OBJECTS:=version.o +OBJECTS:= TEST_OBJECTS:= endif +&OBJECTS += $(OBJECTS) $(TEST_OBJECTS) + STALE_PYTHON_FILES= $(foreach e, py pyc, \ $(foreach p, /usr /usr/local, \ $(foreach l, ipaddr, \ @@ -80,9 +82,9 @@ STALE_PYTHON_FILES= $(foreach e, py pyc, \ bison -d -o $@ $< %.o: %.c conffile.yy.h - $(CC) $(CPPFLAGS) $(ALL_CFLAGS) -c $< -o $@ + $(CC) $(CPPFLAGS) $(ALL_CFLAGS) $(CDEPS_CFLAGS) -c $< -o $@ -all:: $(TARGETS) check +all:: $(TARGETS) ${srcdir}/config.h.in: configure.ac cd ${srcdir} && autoheader @@ -91,12 +93,6 @@ ${srcdir}/config.h.in: configure.ac MAKEFILE_TEMPLATES += config.h.in CONFIG_STATUS_OUTPUTS += config.h -# C and header file dependency rules -SOURCES:=$(OBJECTS:.o=.c) $(TEST_OBJECTS:.o=.c) -DEPENDS:=$(OBJECTS:.o=.d) $(TEST_OBJECTS:.o=.d) - --include *.d - # Manual dependencies section conffile.yy.c: conffile.fl conffile.tab.c conffile.yy.h: conffile.yy.c @@ -106,7 +102,7 @@ conffile.tab.c: conffile.y conffile.yy.o: ALL_CFLAGS += -Wno-sign-compare secnet: $(OBJECTS) - $(MAKE) version.o # *.o $(filter-out %.o, $^) + $(MAKE) -f main.mk version.o # *.o $(filter-out %.o, $^) $(CC) $(LDFLAGS) $(ALL_CFLAGS) -o $@ $(OBJECTS) version.o $(LDLIBS) # We (always) regenerate the version, but only if we regenerate the # binary. (This is necessary as the version string is can depend on @@ -115,27 +111,25 @@ secnet: $(OBJECTS) ifneq (,$(wildcard .git/HEAD)) # If we have (eg) committed, relink and thus regenerate the version # with the new info from git describe. -secnet: Makefile .git/HEAD $(shell sed -n 's#^ref: #.git/#p' .git/HEAD) +secnet: Makefile .git/HEAD $(wildcard $(shell sed -n 's#^ref: #.git/#p' .git/HEAD)) secnet: $(wildcard .git/packed-refs) endif TESTDIRS=stest mtest -FAST_CHECKS= eax-aes-test.confirm eax-serpent-test.confirm \ - eax-serpentbe-test.confirm check-ipaddrset \ - $(addprefix check-,$(TESTDIRS)) +&TARGETS_check = eax-aes-test.confirm eax-serpent-test.confirm \ + eax-serpentbe-test.confirm ipaddrset.confirm -CHECKS += $(FAST_CHECKS) -CHECKS += msgcode-test.confirm - -check: $(CHECKS) +&TARGETS_fullcheck += $(&TARGETS_check) +&TARGETS_fullcheck += msgcode-test.confirm recheck: - rm -f $(FAST_CHECKS) + rm -f $(&TARGETS_check) rm -rf $(addsuffix /d-*, $(TESTDIRS)) - $(MAKE) check + $(MAKE) -f main.mk check -version.c: Makefile +.PHONY: FORCE +version.c: FORCE echo "#include \"secnet.h\"" >$@.new @set -ex; if test -e .git && type -p git >/dev/null; then \ v=$$(git describe --match 'v*'); v=$${v#v}; \ @@ -153,6 +147,8 @@ eax-%-test.confirm: eax-%-test eax-%-test.vectors ./$< <$(srcdir)/eax-$*-test.vectors >$@.new mv -f $@.new $@ +&CDEPS_OBJECTS += msgcode-test.o + msgcode-test: msgcode-test.o $(CC) $(LDFLAGS) $(ALL_CFLAGS) -o $@ $^ @@ -160,18 +156,10 @@ msgcode-test.confirm: msgcode-test ./msgcode-test touch $@ -check-ipaddrset: ipaddrset-test.py ipaddrset.py ipaddrset-test.expected +ipaddrset.confirm: 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-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 + touch $@ .PRECIOUS: eax-%-test @@ -200,19 +188,19 @@ install: installdirs install-force: rm -f $(STALE_PYTHON_FILES) - $(MAKE) install + $(MAKE) -f main.mk install -clean:: $(addprefix clean-,$(TESTDIRS)) - $(RM) -f *.o *.yy.[ch] *.tab.[ch] $(TARGETS) core version.c - $(RM) -f *.d *.pyc *~ eax-*-test.confirm eax-*-test +&CLEAN += .version.d +&CLEAN += $(TARGETS) $(&TARGETS_check) $(&TARGETS_fullcheck) + +clean:: + $(RM) -f *.o *.yy.[ch] *.tab.[ch] core version.c + $(RM) -f *.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 \ + $(RM) -f *~ Makefile config.h \ config.log config.status config.cache \ config.stamp Makefile.bak @@ -222,7 +210,7 @@ include subdirmk/regen.mk # Release checklist: # -# 0. Use this checklist from Makefile.in +# 0. Use this checklist from Subdir.sd.mk # # 1. Check that the tree has what you want #