docs: add rule to generate manuals for www.gnu.org
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sat, 8 Dec 2012 19:11:39 +0000 (20:11 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 9 Dec 2012 09:20:01 +0000 (10:20 +0100)
Less clerical work to do by hand.

* Makefile.am (web-manuals): New rule.
(clean_texinfo_clutter): New macro.
* clean-web-manuals, clean-texinfo-clutter: New cleaning
rules.
(clean-local): Depend on them.
* .gitignore: Update.
* HACKING: Adjust instructions for generation of manuals.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
.gitignore
HACKING
Makefile.am

index 9ead89c..3773d94 100644 (file)
@@ -33,6 +33,7 @@
 /doc/amhello/depcomp
 /doc/amhello/install-sh
 /doc/amhello/missing
+/doc/web-manuals
 /lib/Automake/Config.pm
 /test-suite.log
 /t/wrap/aclocal-1.*
diff --git a/HACKING b/HACKING
index 118a2e3..27eec31 100644 (file)
--- a/HACKING
+++ b/HACKING
   use "make GNUPLOADFLAGS='--user KEY' git-upload-release".
 
 * For stable releases, update the manuals at www.gnu.org:
-  - Generate manuals:
-    cd doc
-    export GENDOCS_TEMPLATE_DIR=../lib
-    sh ../lib/gendoc.sh --email bug-automake@gnu.org automake "GNU Automake"
-  - copy manuals recursively to web cvs,
-  - commit.
+  - Generate manuals, running "make web-manuals".
+  - Copy manuals recursively to web CVS.
+  - Commit in CVS.
   - Check for link errors, fix them, recheck until convergence:
     <http://validator.w3.org/checklink>
 
index 8c5fa71..870c6a9 100644 (file)
@@ -1001,6 +1001,39 @@ fetch:
        exit $$stat
 .PHONY: fetch
 
+## --------------------------------------------------------------------- ##
+##  Generate manuals in several formats, for upload on the GNU website.  ##
+## --------------------------------------------------------------------- ##
+
+# The gendocs.sh script sadly leaves TeX and Texinfo auxiliary files
+# in the directory where it's invoked.
+clean_texinfo_clutter_cmd = \
+  cd doc && rm -f *.ac *.aux *.cm *.cp *.cps *.fn *.fns *.ky \
+                  *.log *.op *.pg *.toc *.tp *.tr *.vr *.vrs
+
+clean-web-manuals:
+       $(AM_V_at)rm -rf doc/web-manuals
+clean-texinfo-clutter:
+       $(AM_V_at)$(clean_texinfo_clutter_cmd)
+clean-local: clean-web-manuals clean-texinfo-clutter
+.PHONY: clean-web-manuals clean-texinfo-clutter
+
+web-manuals:
+       $(AM_V_at)rm -rf doc/web-manuals
+       $(AM_V_GEN): \
+## The gendocs.sh script only works from the srcdir, sadly.
+         && cd $(srcdir)/doc \
+         && GENDOCS_TEMPLATE_DIR=../lib \
+         && export GENDOCS_TEMPLATE_DIR \
+## Try to respect silent rules.
+         && if $(AM_V_P); then :; else exec >/dev/null 2>&1; fi \
+## Finally generate the manual in several formats.
+         && $(SHELL) ../lib/gendocs.sh -o web-manuals \
+            --email $(PACKAGE_BUGREPORT) $(PACKAGE) '$(PACKAGE_NAME)'
+       $(AM_V_at)$(clean_texinfo_clutter_cmd)
+       $(AM_V_at)if $(AM_V_P); then ls -l doc/web-manuals; else :; fi
+.PHONY: web-manuals
+
 EXTRA_DIST += lib/gendocs.sh lib/gendocs_template
 
 ## ------------------------------------------------ ##