chiark / gitweb /
Makefiles: Better workaround for make bug (Debian #4073)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 1 Jan 2020 13:48:14 +0000 (13:48 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 2 Jan 2020 00:42:03 +0000 (00:42 +0000)
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 <ijackson@chiark.greenend.org.uk>
Dir.sd.mk

index 6d2aa412fa83ed71746abdcbaec77b281b2b2682..cc4b67d2922145c6ac4b10dbca8a7bb2fec392a0 100644 (file)
--- 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