automake-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: Add support for generating HTML docs a` la PDF, etc., revision4


From: Alexandre Duret-Lutz
Subject: FYI: Add support for generating HTML docs a` la PDF, etc., revision4
Date: Mon, 14 Apr 2003 21:57:05 +0200
User-agent: Gnus/5.090016 (Oort Gnus v0.16) Emacs/21.2 (gnu/linux)

I'm finally checking this in.

>From the last version I sent, I've just updated NEWS, and adjusted
texinfos.am to follow the ?GENERIC?/?!GENERIC? idiom now in use.

2003-03-14  Richard Dawe  <address@hidden>
            Alexandre Duret-Lutz  <address@hidden>

        * automake.in (output_texinfo_build_rules, handle_texinfo_helper,
        initialize_per_input):  Add infrastructure for generating HTML
        documentation from texinfo source.
        * lib/am/texinfos.am: Add rules for building HTML documentation
        from texinfo source.
        * lib/am/texibuild.am: Likewise.
        * automake.texi (Texinfo): Document rules for building
        HTML documentation from texinfo source.
        * tests/txinfo21.test: New file.
        * tests/Makefile.am (TESTS): Add txinfo21.test.
        * tests/defs.in: Handle required=makeinfo-html.

Index: NEWS
===================================================================
RCS file: /cvs/automake/automake/NEWS,v
retrieving revision 1.208
diff -u -r1.208 NEWS
--- NEWS        14 Apr 2003 19:13:14 -0000      1.208
+++ NEWS        14 Apr 2003 19:53:37 -0000
@@ -57,8 +57,6 @@
   versions of Automake, because AC_PROG_CC defines this variable since
   Autoconf 2.54.)
 
-* Texinfo rules back up and restore info files when makeinfo fails.
-
 * AR's `cru' flags are now set in a global ARFLAGS variable instead
   of being hard-coded in each $(AR) invocation, so they can be
   substituted from configure.ac.  This has been requested by people
@@ -66,6 +64,25 @@
 
 * New warning option: -Woverride.  This will warn about any user
   target or variable definitions which override Automake definitions.
+
+* Texinfo rules back up and restore info files when makeinfo fails.
+
+* Texinfo rules now support the `html' target.
+  Running this requires Texinfo 4.0 or greater.
+
+  `html' is a new recursive target, so if your package mixes
+  hand-crafted `Makefile.in's with Automake-generated `Makefile.in's,
+  you should adjust the former to support (or ignore) this target so
+  that `make html' recurses successfully.  If you had a custom `html'
+  rule in your `Makefile.am', it's better to rename it as `html-local',
+  otherwise your rule will override Automake's new rule (you can check
+  that by running `automake -Woverride') and that will stop the recursion
+  to subdirectories.
+
+  Last but not least, this `html' rule is declared PHONY, even when
+  overridden.  Fortunately, it appears that few packages use a
+  non-PHONY `html' rule.
+
 
 New in 1.7:
 * Autoconf 2.54 is required.
Index: automake.in
===================================================================
RCS file: /cvs/automake/automake/automake.in,v
retrieving revision 1.1445
diff -u -r1.1445 automake.in
--- automake.in 14 Apr 2003 19:13:14 -0000      1.1445
+++ automake.in 14 Apr 2003 19:53:54 -0000
@@ -780,6 +780,8 @@
        'ps-am'    => [],
        'info'     => [],
        'info-am'  => [],
+       'html'     => [],
+       'html-am'  => [],
 
        # Installing/uninstalling.
        'install-data-am'      => [],
@@ -3696,7 +3698,7 @@
                                    MAKEINFOFLAGS => $makeinfoflags,
                                    DEPS          => "@deps",
                                   DIRSTAMP      => $dirstamp);
-  return ($dirstamp, "$dpfx.dvi", "$dpfx.pdf", "$dpfx.ps");
+  return ($dirstamp, "$dpfx.dvi", "$dpfx.pdf", "$dpfx.ps", "$dpfx.html");
 }
 
 
@@ -3713,7 +3715,8 @@
 
     my @texis = &variable_value_as_list_recursive ('info_TEXINFOS', 'all');
 
-    my (@info_deps_list, @dvis_list, @pdfs_list, @pss_list, @texi_deps);
+    my (@info_deps_list, @texi_deps);
+    my (@dvis_list, @pdfs_list, @pss_list, @htmls_list);
     my %versions;
     my $done = 0;
     my @texi_cleans;
@@ -3766,6 +3769,7 @@
        push (@dvis_list, $infobase . '.dvi');
        push (@pdfs_list, $infobase . '.pdf');
        push (@pss_list, $infobase . '.ps');
+       push (@htmls_list, $infobase . '.html');
 
        # If a vers*.texi file is needed, emit the rule.
        if ($vtexi)
@@ -3859,6 +3863,7 @@
     &define_variable ("DVIS", "@dvis_list", INTERNAL);
     &define_variable ("PDFS", "@pdfs_list", INTERNAL);
     &define_variable ("PSS", "@pss_list", INTERNAL);
+    &define_variable ("HTMLS", "@htmls_list", INTERNAL);
     # This next isn't strictly needed now -- the places that look here
     # could easily be changed to look in info_TEXINFOS.  But this is
     # probably better, in case noinst_TEXINFOS is ever supported.
Index: automake.texi
===================================================================
RCS file: /cvs/automake/automake/automake.texi,v
retrieving revision 1.332
diff -u -r1.332 automake.texi
--- automake.texi       14 Apr 2003 19:13:14 -0000      1.332
+++ automake.texi       14 Apr 2003 19:54:03 -0000
@@ -4020,11 +4020,11 @@
 @vindex info_TEXINFOS
 
 Automake generates rules to build @file{.info}, @file{.dvi}, @file{.ps},
-and @file{.pdf} files from your Texinfo sources.  The @file{.info} files
-are built by @code{make all} and installed by @code{make install}
-(unless you use @code{no-installinfo}, see below).  The other files can
-be built on request by @code{make dvi}, @code{make ps}, and @code{make
-pdf}.
address@hidden and @file{.html} files from your Texinfo sources.
+The @file{.info} files are built by @code{make all} and installed
+by @code{make install} (unless you use @code{no-installinfo}, see below).
+The other files can be built on request by @code{make dvi}, @code{make ps},
address@hidden pdf} and @code{make html}.
 
 @cindex Texinfo flag, VERSION
 @cindex Texinfo flag, UPDATED
@@ -5291,6 +5291,8 @@
 @trindex  ps-local
 @trindex  pdf
 @trindex  pdf-local
address@hidden  html
address@hidden  html-local
 @trindex  check
 @trindex  check-local
 @trindex  install
@@ -5311,9 +5313,9 @@
 @trindex  installcheck-local
 
 The targets that support a local version are @code{all}, @code{info},
address@hidden, @code{ps}, @code{pdf}, @code{check}, @code{install-data},
address@hidden, @code{uninstall}, @code{installdirs},
address@hidden and the various @code{clean} targets
address@hidden, @code{ps}, @code{pdf}, @code{html}, @code{check},
address@hidden, @code{install-exec}, @code{uninstall},
address@hidden, @code{installcheck} and the various @code{clean} targets
 (@code{mostlyclean}, @code{clean}, @code{distclean}, and
 @code{maintainer-clean}).  Note that there are no
 @code{uninstall-exec-local} or @code{uninstall-data-local} targets; just
Index: lib/am/texibuild.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/texibuild.am,v
retrieving revision 1.16
diff -u -r1.16 texibuild.am
--- lib/am/texibuild.am 25 Feb 2003 20:07:33 -0000      1.16
+++ lib/am/texibuild.am 14 Apr 2003 19:54:07 -0000
@@ -73,6 +73,12 @@
 ?GENERIC?      $(TEXI2PDF) %SOURCE%
 ?!GENERIC?     $(TEXI2PDF) -o $@ `test -f '%SOURCE%' || echo 
'$(srcdir)/'`%SOURCE%
 
+?GENERIC?%SOURCE_SUFFIX%.html:
+?!GENERIC?%DEST_PREFIX%.html: %SOURCE% %DEPS% %DIRSTAMP%
+       $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) --html %MAKEINFOFLAGS% 
\
+?GENERIC?       -o $@ %SOURCE%
+?!GENERIC?      -o $@ `test -f '%SOURCE%' || echo '$(srcdir)/'`%SOURCE%
+
 ## If we are using the generic rules, we need separate dependencies.
 ## (Don't wonder about %DIRSTAMP% here, this is used only by non-generic
 ## rules.)
@@ -82,4 +88,5 @@
 if %?GENERIC%
 %DEST_PREFIX%.dvi: %SOURCE_REAL% %DEPS%
 %DEST_PREFIX%.pdf: %SOURCE_REAL% %DEPS%
+%DEST_PREFIX%.html: %SOURCE_REAL% %DEPS%
 endif %?GENERIC%
Index: lib/am/texinfos.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/texinfos.am,v
retrieving revision 1.102
diff -u -r1.102 texinfos.am
--- lib/am/texinfos.am  14 Apr 2003 19:13:15 -0000      1.102
+++ lib/am/texinfos.am  14 Apr 2003 19:54:07 -0000
@@ -58,18 +58,21 @@
        $(DVIPS) -o $@ $<
 endif %?LOCAL-TEXIS%
 
-.PHONY: info info-am dvi dvi-am pdf pdf-am
+.PHONY: info info-am dvi dvi-am pdf pdf-am html html-am
 if %?SUBDIRS%
 RECURSIVE_TARGETS += info-recursive dvi-recursive pdf-recursive ps-recursive
+RECURSIVE_TARGETS += html-recursive
 .PHONY info: info-recursive
 .PHONY dvi: dvi-recursive
 .PHONY pdf: pdf-recursive
 .PHONY ps: ps-recursive
+.PHONY html: html-recursive
 else !%?SUBDIRS%
 info: info-am
 dvi: dvi-am
 pdf: pdf-am
 ps: ps-am
+html: html-am
 endif !%?SUBDIRS%
 
 if %?LOCAL-TEXIS%
@@ -77,11 +80,13 @@
 dvi-am: $(DVIS)
 pdf-am: $(PDFS)
 ps-am: $(PSS)
+html-am: $(HTMLS)
 else ! %?LOCAL-TEXIS%
 info-am:
 dvi-am:
 pdf-am:
 ps-am:
+html-am:
 endif ! %?LOCAL-TEXIS%
 
 
@@ -241,7 +246,9 @@
 .PHONY: mostlyclean-aminfo
 mostlyclean-am: mostlyclean-aminfo
 mostlyclean-aminfo:
-       -rm -f %TEXICLEAN%
+## Use `-rf', not just `-f', because %TEXICLEAN% also contains
+## any directory created by `makeinfo --html'.
+       -rm -rf %TEXICLEAN%
 
 .PHONY: maintainer-clean-aminfo
 maintainer-clean-am: maintainer-clean-aminfo
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.480
diff -u -r1.480 Makefile.am
--- tests/Makefile.am   14 Apr 2003 19:13:15 -0000      1.480
+++ tests/Makefile.am   14 Apr 2003 19:54:07 -0000
@@ -430,6 +430,7 @@
 txinfo18.test \
 txinfo19.test \
 txinfo20.test \
+txinfo21.test \
 transform.test \
 unused.test \
 vars.test \
Index: tests/defs.in
===================================================================
RCS file: /cvs/automake/automake/tests/defs.in,v
retrieving revision 1.13
diff -u -r1.13 defs.in
--- tests/defs.in       10 Apr 2003 23:15:46 -0000      1.13
+++ tests/defs.in       14 Apr 2003 19:54:08 -0000
@@ -106,6 +106,11 @@
        echo "$me: running makedepend -f-"
        ( makedepend -f- ) || exit 77
        ;;
+      makeinfo-html)
+       # Make sure makeinfo understands --html.
+       echo "$me: running makeinfo --html --version"
+       ( makeinfo --html --version ) || exit 77
+       ;;
       non-root)
        # Skip this test case if the user is root.
        # We try to append to a read-only file to detect this.
Index: tests/txinfo21.test
===================================================================
RCS file: tests/txinfo21.test
diff -N tests/txinfo21.test
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ tests/txinfo21.test 14 Apr 2003 19:54:08 -0000
@@ -0,0 +1,82 @@
+#! /bin/sh
+# Copyright (C) 2003  Free Software Foundation, Inc.
+#
+# This file is part of GNU Automake.
+#
+# GNU Automake is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# GNU Automake is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with Automake; see the file COPYING.  If not, write to
+# the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+# Boston, MA 02111-1307, USA.
+
+# Test support for building HTML documentation.
+
+required='makeinfo-html tex'
+. ./defs || exit 1
+
+set -e
+
+cat >>configure.in <<EOF
+AC_CONFIG_FILES([rec/Makefile])
+AC_OUTPUT
+EOF
+
+cat > Makefile.am << 'END'
+SUBDIRS = rec
+info_TEXINFOS = main.texi sub/main.texi
+END
+
+cat > main.texi << 'END'
+\input texinfo
address@hidden main.info
address@hidden main
address@hidden Top
+Hello walls.
address@hidden
+END
+
+mkdir sub
+mkdir rec
+cp main.texi sub/main.texi
+cp main.texi rec/main.texi
+
+cat > rec/Makefile.am << 'END'
+info_TEXINFOS = main.texi
+END
+
+$ACLOCAL
+$AUTOMAKE --add-missing
+$AUTOCONF
+
+./configure
+
+$MAKE
+
+# Test production of split-per-node HTML.
+$MAKE html
+test -d main.html
+test -d sub/main.html
+test -d rec/main.html
+$MAKE clean
+test ! -d main.html
+test ! -d sub/main.html
+test ! -d rec/main.html
+
+# Test production of a single HTML file.
+MAKEINFOFLAGS=--no-split $MAKE -e html
+test -f main.html
+test -f sub/main.html
+test -f rec/main.html
+$MAKE clean
+test ! -f main.html
+test ! -f sub/main.html
+test ! -f rec/main.html

-- 
Alexandre Duret-Lutz





reply via email to

[Prev in Thread] Current Thread [Next in Thread]