[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 33/46: Build texinfo doc, add optional targets to build html, p
From: |
Bertrand Garrigues |
Subject: |
[groff] 33/46: Build texinfo doc, add optional targets to build html, pdf, txt, and dvi doc |
Date: |
Sun, 05 Oct 2014 22:31:05 +0000 |
bgarrigues pushed a commit to branch automake3
in repository groff.
commit ab52fbe2b2d00758b21095c52ad69d050a2322ff
Author: Bertrand Garrigues <address@hidden>
Date: Mon Sep 8 00:37:19 2014 +0200
Build texinfo doc, add optional targets to build html, pdf, txt, and dvi doc
---
TESTS | 18 +++++++++++-
doc/doc.am | 84 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
doc/fixinfo.sh | 4 ++-
m4/groff.m4 | 4 +-
4 files changed, 106 insertions(+), 4 deletions(-)
diff --git a/TESTS b/TESTS
index b1948f4..5c2571f 100644
--- a/TESTS
+++ b/TESTS
@@ -21,7 +21,7 @@ Current status
- man files from 'man' directory installed
- tmac files from 'tmac' directory installed
- Build and installation of contrib
- - Build and installation of doc, except texinfo doc
+ - Build and installation of doc, including texinfo doc
Tests
-----
@@ -183,6 +183,21 @@ from doc
- gnu.eps
- html and doc files
+from doc, texinfo files:
+
+ - By default, only doc/groff.info is built, as GNU standards require
+ to install only info doc.
+
+ - Additional optional targets are available to build the doc in various
formats:
+ -- make doc_txt
+ -- make doc_dvi
+ -- make doc_pdf
+ -- make doc_html (this will build the html in 2 directories: all
+ in 1 .html file, and 1 file per node). Note also that if
+ texinfo version is < 5.0, the resulting (mono) file will be
+ patched by fixinfo.sh
+ -- make doc_all will build all the 4 previous formats
+
In order to check and improve the dependencies, the following targets
were built from a clean environment:
- make lib/libgnu.a
@@ -377,6 +392,7 @@ Differences with former build system:
-- webpageXX.html files
-- picXX.html files
+ -- info file from groff.texinfo
Diff with previous build system:
- devcp1047 fonts are installed $(DESTDIR)/usr/local/groff/1.22.2/font
diff --git a/doc/doc.am b/doc/doc.am
index 596535b..52c3d1a 100644
--- a/doc/doc.am
+++ b/doc/doc.am
@@ -233,6 +233,71 @@ uninstall_doc_htmldoc:
-rmdir $(DESTDIR)$(htmldocdir)/$(imagedir)
-rmdir $(DESTDIR)$(htmldocdir)
+# Texinfo doc
+#
+# We can't use automake's facilities because the make dist target attempts to
+# generate a pdf version of groff.texi by invoking texi2dvi without the -e
+# option, which is needed to build this file.
+# info_TEXINFOS = doc/groff.texi
+# doc_groff_TEXINFOS = doc/fdl.texi
+#
+# Note that GNU standards require to install only info doc.
+all: doc/groff.info
+groffinfodir = $(infodir)
+groffpdfdir = $(infodir)
+MOSTLYCLEANFILES += doc/groff.info doc/groff.info-2 doc/groff.info-2
+EXTRA_DIST += doc/groff.texi doc/fdl.texi
+doc/groff.info: $(doc_srcdir)/groff.texi
+ @$(MKDIR_P) $(doc_builddir)
+ $(MAKEINFO) -o doc/groff.info --enable-encoding -I$(doc_srcdir)
$(doc_srcdir)/groff.texi
+
+# Rules to generate various doc files from .texi files.
+.texi.txt:
+ @$(MKDIR_P) $(doc_builddir)
+ LANG= $(MAKEINFO) --enable-encoding -I$(doc_srcdir) --plaintext -o $@ $<
+
+.texi.dvi:
+ @$(MKDIR_P) $(doc_builddir)
+ TEXINPUTS="$(top_srcdir)/build-aux:$(TEXINPUTS)" \
+ MAKEINFO='$(MAKEINFO) -I $(doc_srcdir)' \
+ $(TEXI2DVI) -e --batch --build-dir=doc/`basename address@hidden -o $@ $<
+
+.texi.pdf:
+ @$(MKDIR_P) $(doc_builddir)
+ TEXINPUTS="$(top_srcdir)/build-aux:$(TEXINPUTS)" \
+ MAKEINFO='$(MAKEINFO) -I $(doc_srcdir)' \
+ $(TEXI2DVI) -e --batch --pdf --build-dir=doc/`basename address@hidden
-o $@ $<
+
+# This will generate both html split into several files and html doc
+# in a single file. If texinfo version < 5.0, we process the resulting
+# (mono) .html file with fixinfo.sh du to a problem with blockquote
+# closing (for example 5.6.1 Setting Registers, the 'Request'
+# blockquote is not properly closed, see fixinfo.sh for more details
+.texi.html:
+ @$(MKDIR_P) $(doc_builddir)/
+ @$(MKDIR_P) $(doc_builddir)/`basename address@hidden/
+ $(MAKEINFO) --html -I $(doc_srcdir) \
+ -o doc/`basename address@hidden $<
+ $(MAKEINFO) --html -I $(doc_srcdir) --no-split \
+ -o doc/`basename address@hidden/`basename address@hidden $<
+ if test "$(makeinfo_version_numeric)" -lt 5000; then \
+ echo "patching $@ with fixinfo.sh"; \
+ $(SHELL) $(doc_srcdir)/fixinfo.sh \
+ doc/`basename address@hidden/`basename address@hidden; \
+ fi
+
+# Targets to make all the doc in all formats. These doc are not built
+# by default.
+doc: doc_all
+doc_all: doc_txt dvi pdf html
+doc_txt: doc/groff.txt
+dvi: doc_dvi
+doc_dvi: doc/groff.dvi
+pdf: doc_pdf
+doc_pdf: doc/groff.pdf
+html: doc_html
+doc_html: doc/groff.html
+
distclean-local: clean_infodoc clean_otherdoc
maintainer-clean-local: clean_infodoc clean_otherdoc
clean_infodoc:
@@ -241,6 +306,25 @@ clean_otherdoc:
-cd $(doc_builddir) && \
rm -rf *.pdf *.html *.txt *.dvi *.html.mono *.t2p *.t2d
+install-data-local: install_infodoc
+install_infodoc: doc/groff.info
+ -test -d $(DESTDIR)$(infodir) || $(mkinstalldirs) $(DESTDIR)$(infodir)
+ for p in doc/groff.info `ls doc/groff.info*`; do \
+ f=`basename $$p`; \
+ rm -f $(DESTDIR)$(infodir)/$$f; \
+ $(INSTALL_DATA) $$p $(DESTDIR)$(infodir)/$$f; \
+ done
+ $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) \
+ $(DESTDIR)$(infodir)/groff.info
+
+uninstall-local: uninstall_infodoc
+uninstall_infodoc:
+ -$(INSTALL_INFO) --remove --info-dir=$(DESTDIR)$(infodir) \
+ $(DESTDIR)$(infodir)/groff.info
+ -for f in `ls $(DESTDIR)$(infodir)/groff.info*`; do \
+ rm -f $$f; \
+ done
+
# File used by contrib/hdtbl and contrib/pdfmark. It is distributed in
# doc.eps. We try in priority to use the file in 'doc'.
EXTRA_DIST += doc/gnu.xpm
diff --git a/doc/fixinfo.sh b/doc/fixinfo.sh
index 2c853f8..1c48d99 100644
--- a/doc/fixinfo.sh
+++ b/doc/fixinfo.sh
@@ -21,7 +21,9 @@
# Note that this script is a quick hack and tightly bound to the current
# groff.texinfo macro code. Hopefully, a new texinfo version makes it
# unnecessary.
-
+#
+# 09-2014: no more problem with texinfo 5.0 or higher
+#
t=${TMPDIR-.}/gro$$.tmp
cat $1 | sed '
diff --git a/m4/groff.m4 b/m4/groff.m4
index 8f129e6..9ad044f 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -184,8 +184,8 @@ AC_DEFUN([GROFF_MAKEINFO],
AC_SUBST([MAKEINFO])
AC_SUBST([make_infodoc])
AC_SUBST([make_install_infodoc])
- AC_SUBST([make_uninstall_infodoc])])
-
+ AC_SUBST([make_uninstall_infodoc])
+ AC_SUBST([makeinfo_version_numeric])])
# The following programs are needed for grohtml.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 33/46: Build texinfo doc, add optional targets to build html, pdf, txt, and dvi doc,
Bertrand Garrigues <=