Create manpage atomically.
[libguestfs.git] / rescue / Makefile.am
index a9a533c..1067c8d 100644 (file)
@@ -23,18 +23,18 @@ if HAVE_RESCUE
 
 man_MANS = virt-rescue.1
 
-noinst_DATA = @top_builddir@/html/virt-rescue.1.html
+noinst_DATA = $(top_builddir)/html/virt-rescue.1.html
 
 virt-rescue.1: virt-rescue.pl
        $(POD2MAN) \
          --section 1 \
          -c "Virtualization Support" \
          --release "$(PACKAGE_NAME)-$(PACKAGE_VERSION)" \
-         $< > $@
+         $< > $@-t && mv $@-t $@
 
-@top_builddir@/html/virt-rescue.1.html: virt-rescue.pl
-       mkdir -p @top_builddir@/html
-       cd @top_builddir@ && pod2html \
+$(top_builddir)/html/virt-rescue.1.html: virt-rescue.pl
+       mkdir -p $(top_builddir)/html
+       cd $(top_builddir) && pod2html \
          --css 'pod.css' \
          --title 'virt-rescue, run a rescue shell on a virtual machine' \
          --htmldir html \