From 19ab22abec86e2167b8169bc7123fd5d1bd496f9 Mon Sep 17 00:00:00 2001 From: Julio Merino Date: Mon, 8 Feb 2016 11:37:02 -0500 Subject: Improve sshfs.1 manpage generation * Fix dependencies of the sshfs.1 target to actually specify sshfs.1.in as a source. * Ensure that failures during the generation of sshfs.1 do not result in a potentially bogus manpage by first outputting the contents to a temporary file unknown to the Makefile rule and then replacing the target file once all is known to be OK. * Use $(AM_V_GEN) in the command to respect automake's silent rules. --- Makefile.am | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile.am b/Makefile.am index c5b92f0..ed3090e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,13 +14,15 @@ sshfs_LDADD = $(SSHFS_LIBS) sshfs_CFLAGS = $(SSHFS_CFLAGS) sshfs_CPPFLAGS = -D_REENTRANT -DFUSE_USE_VERSION=26 -DLIBDIR=\"$(libdir)\" -EXTRA_DIST = sshnodelay.c -CLEANFILES = sshnodelay.so sshfs.1 +EXTRA_DIST = sshnodelay.c sshfs.1.in +CLEANFILES = sshnodelay.so sshfs.1 sshfs.1.tmp dist_man_MANS = sshfs.1 -sshfs.1: - $(CPP) $(CPPFLAGS) -P -xassembler-with-cpp sshfs.1.in | sed -e '/^$$/d' > sshfs.1 +sshfs.1: sshfs.1.in + $(AM_V_GEN)$(CPP) $(CPPFLAGS) -P -xassembler-with-cpp sshfs.1.in \ + | sed -e '/^$$/d' >sshfs.1.tmp || exit 1; \ + mv sshfs.1.tmp sshfs.1 if SSH_NODELAY_SO all-local: sshnodelay.so -- cgit v1.2.3