]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] texi: tweak rules for HTML generation to spawn only one shell
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 15 Jun 2012 17:52:34 +0000 (19:52 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 17 Jun 2012 07:39:29 +0000 (09:39 +0200)
* lib/am/texibuild.am: Rewrite the recipe for .texi -> .html conversion
to use only one shell invocation, mostly for consistency with the other
recipes (e.g., .texi -> .pdf).  This also offers a micro-optimization.
And while we are at it, throw in few other micro-optimizations, and fix
botched indentation.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
lib/am/texibuild.am

index aef650a7fb0b63d0ac9354d697c0cdec214c931c..30575fdddfc74384cdfe81104fbfce7f9d26975d 100644 (file)
@@ -76,16 +76,17 @@ INFO_DEPS += %DEST_INFO_PREFIX%%DEST_SUFFIX%
        $(TEXI2PDF) %TEXIQUIET% --clean -o $@ $< %TEXIDEVNULL%
 
 %.html: %%SOURCE_SUFFIX%
-       %SILENT%$(am__ensure_target_dir_exists)
+       %AM_V_MAKEINFO%$(am__ensure_target_dir_exists) \
 ## When --split (the default) is used, makeinfo will output a
 ## directory.  However it will not update the time stamp of a
 ## previously existing directory, and when the names of the nodes
 ## in the manual change, it may leave unused pages.  Our fix
 ## is to build under a temporary name, and replace the target on
 ## success.
-       %AM_V_MAKEINFO%rm -rf $(@:.html=.htp)
-       %SILENT%if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) \
-                                  %MAKEINFOFLAGS% -o $(@:.html=.htp) $<; \
+         && { test ! -d $(@:.html=.htp) || rm -rf $(@:.html=.htp); } \
+         || exit 1; \
+       if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) \
+                          %MAKEINFOFLAGS% -o $(@:.html=.htp) $<; \
        then \
          rm -rf $@; \
 ## Work around a bug in Texinfo 4.1 (-o foo.html outputs files in foo/