From: Ian Jackson Date: Wed, 1 Jan 2020 13:48:14 +0000 (+0000) Subject: Makefiles: Better workaround for make bug (Debian #4073) X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=8bcca247b7c167eea3bbf207d99c9d2b7b27f617;p=secnet.git Makefiles: Better workaround for make bug (Debian #4073) make likes to delete intermediate files. The result can be that it rebuilds things needlessly. In this case, eax-aes-test.o, eax-aes.trun etc. We worked around this by marking them .PRECIOUS with a pattern rule this is not ideal as it stops make deleting half-built broken files in case of error. A better workaround is to mention the files explicitly by name (ie, not with a pattern). This stops that effect and doesn't have side effects. For us it (empirically) doesn't actually matter whether it's the .o or the .trun that we mark intermediate. We can conveniently extend this to all test binaries. This will be relevant as we are going to introduce more of these that are partly builtt from auto-generated or auto-massaged inputs. Signed-off-by: Ian Jackson --- diff --git a/Dir.sd.mk b/Dir.sd.mk index 6d2aa41..cc4b67d 100644 --- a/Dir.sd.mk +++ b/Dir.sd.mk @@ -171,6 +171,9 @@ msgcode.tconfirm: msgcode.trun ./msgcode.trun touch $@ +$(TEST_OBJECTS): +# works aroud Debian #4073 + ipaddrset.tconfirm: ipaddrset-test.py ipaddrset.py ipaddrset-test.expected $(srcdir)/ipaddrset-test.py >ipaddrset-test.new diff -u $(srcdir)/ipaddrset-test.expected ipaddrset-test.new @@ -181,8 +184,6 @@ ipaddrset.tconfirm: ipaddrset-test.py ipaddrset.py ipaddrset-test.expected pubkeys.fl: ${srcdir}/pubkeys.fl.pl ${srcdir}/pubkeys.fl.pl >$@.tmp && mv -f $@.tmp $@ -.PRECIOUS: eax-%.trun - installdirs: $(INSTALL) -d $(prefix)/share/secnet $(sbindir) $(INSTALL) -d $(mandir)/man8