Redo handling of the makedoc option.

* .gitignore: Add Makedoc
* Makedoc.am: New file.
* Makefile.am [IMPRIMATUR_COND_MAKEDOC]: Provide a set of shortcuts
for make -f Makedoc.
* imprimatur.m4 (IMPRIMATUR_INIT): Create Makedoc file if
`makedoc' option is given.
New option dist-info.
* imprimatur.texi: Update.
* README: Update.
This commit is contained in:
Sergey Poznyakoff 2011-09-19 12:35:01 +03:00
parent 999cefa29e
commit f32ef19839
6 changed files with 127 additions and 68 deletions

2
.gitignore vendored
View file

@ -2,6 +2,8 @@
*~
Makefile
Makefile.in
Makedoc
Makedoc.in
imprimatur.info*
imprimatur.pdf
imprimatur.dvi

65
Makedoc.am Normal file
View file

@ -0,0 +1,65 @@
# This file is part of Imprimatur.
# Copyright (C) 2011 Sergey Poznyakoff
#
# Imprimatur 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 3, or (at your option)
# any later version.
#
# Imprimatur 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 Imprimatur. If not, see <http://www.gnu.org/licenses/>.
info_TEXINFOS=imprimatur.texi
imprimatur_TEXINFOS=rendition.texi fdl.texi
TEXI2DVI=texi2dvi -t '@set $(RENDITION)' -E
clean-local:
@rm -rf manual
AM_MAKEINFOFLAGS = @IMPRIMATUR_MAKEINFOFLAGS@
imprimatur_INPUT=$(info_TEXINFOS) $(imprimatur_TEXINFOS)
include imprimatur.mk
CHECK_DOCS=$(top_srcdir)/@IMPRIMATUR_MODULE_DIR@/check-docs.sh
check-rules:
@$(CHECK_DOCS) "Makefile rules" \
'/^imprimatur-.*:/s/:.*//p' \
's/@deffn {Makefile Rule} *//p' \
imprimatur.mk -- \
$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -E - \
$(info_TEXINFOS)
check-macros:
@$(CHECK_DOCS) "Texinfo macros" \
'/@macro/s/@macro *\([-a-zA-Z][-a-zA-Z0-9]*\).*/\1/p' \
'/@defmac/s/@defmac *\([-a-zA-Z][-a-zA-Z0-9]*\).*/\1/p' \
rendition.texi -- \
$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -E - \
$(info_TEXINFOS)
check-docs-am: imprimatur-basic-checks check-rules check-macros
check-docs:
$(MAKE) -k check-docs-am
GENDOCS=gendocs.sh
.PHONY: manual
manual:
TEXINPUTS=$(srcdir):$(top_srcdir)/build-aux:$(TEXINPUTS) \
MAKEINFO="$(MAKEINFO) $(MAKEINFOFLAGS) $(AM_MAKEINFOFLAGS)" \
TEXI2DVI="$(TEXI2DVI)" \
TEXI2HTML="$(TEXI2HTML)" \
GENDOCS_TEMPLATE_DIR="$(GENDOCS_TEMPLATE_DIR)" \
$(GENDOCS) --texi2html imprimatur 'Imprimatur manual'
manual.tar.bz2: manual
tar cfj manual.tar.bz2 manual
man-tar: manual.tar.bz2

View file

@ -23,58 +23,18 @@ EXTRA_DIST=\
rendition.texi\
untabify.el
info_TEXINFOS=
TEXI2DVI=texi2dvi -t '@set $(RENDITION)' -E
if IMPRIMATUR_COND_MAKEDOC
EXTRA_DIST+=imprimatur.texi
# FIXME: How about gendocs_template?
info_TEXINFOS+=imprimatur.texi
imprimatur_TEXINFOS=rendition.texi fdl.texi
clean-local:
@rm -rf manual
AM_MAKEINFOFLAGS = @IMPRIMATUR_MAKEINFOFLAGS@
imprimatur_INPUT=$(info_TEXINFOS) $(imprimatur_TEXINFOS)
include imprimatur.mk
CHECK_DOCS=$(top_srcdir)/@IMPRIMATUR_MODULE_DIR@/check-docs.sh
check-rules:
@$(CHECK_DOCS) "Makefile rules" \
'/^imprimatur-.*:/s/:.*//p' \
's/@deffn {Makefile Rule} *//p' \
imprimatur.mk -- \
$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -E - \
$(info_TEXINFOS)
check-macros:
@$(CHECK_DOCS) "Texinfo macros" \
'/@macro/s/@macro *\([-a-zA-Z][-a-zA-Z0-9]*\).*/\1/p' \
'/@defmac/s/@defmac *\([-a-zA-Z][-a-zA-Z0-9]*\).*/\1/p' \
rendition.texi -- \
$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) -E - \
$(info_TEXINFOS)
check-docs-am: imprimatur-basic-checks check-rules check-macros
check-docs:
$(MAKE) -k check-docs-am
GENDOCS=gendocs.sh
.PHONY: manual
manual:
TEXINPUTS=$(srcdir):$(top_srcdir)/build-aux:$(TEXINPUTS) \
MAKEINFO="$(MAKEINFO) $(MAKEINFOFLAGS) $(AM_MAKEINFOFLAGS)" \
TEXI2DVI="$(TEXI2DVI)" \
TEXI2HTML="$(TEXI2HTML)" \
GENDOCS_TEMPLATE_DIR="$(GENDOCS_TEMPLATE_DIR)" \
$(GENDOCS) --texi2html imprimatur 'Imprimatur manual'
manual.tar.bz2: manual
tar cfj manual.tar.bz2 manual
man-tar: manual.tar.bz2
if IMPRIMATUR_COND_DIST_INFO
EXTRA_DIST += imprimatur.info
BUILT_SOURCES = imprimatur.info
endif
DISTCLEANFILES = Makedoc
MAKEDOC = $(MAKE) -f Makedoc
EXTRA_DIST += Makedoc.am Makedoc.in imprimatur.texi fdl.texi
imprimatur.info:; $(MAKEDOC)
info: imprimatur.info
pdf:; $(MAKEDOC) pdf
dvi:; $(MAKEDOC) dvi
ps:; $(MAKEDOC) ps
clean-local:; $(MAKEDOC) clean
endif

8
README
View file

@ -9,12 +9,10 @@ Imprimatur. It is *not* intended as a replacement for the
documentation, and is provided as a brief reference only.
The complete documentation in Texinfo format is included. To build
it, change to the imprimatur subdirectory and run `makeinfo
imprimatur'. Once the package is properly installed (see below), you
can use the `make' command to create documentation in various formats.
For example, `make' without arguments will create `imprimatur.info',
`make pdf' will create `imprimatur.pdf', etc.
imprimatur'.
Complete documentation is available online at the following URL:
Complete documentation in various formats is available online from the
following URL:
http://www.gnu.org.ua/software/imprimatur/manual

View file

@ -58,14 +58,14 @@ AC_DEFUN([_IMPRIMATUR_SET_OPTIONS],
# DIR - Directory in the source tree where imprimatur has been cloned.
# Default is "imptimatur".
# OPTIONS - A whitespace-separated list of options. Valid options are:
# any one of PROOF, DISTRIB or PUBLISH to set the default
# rendition, frenchspacing to declare that French sentence
# spacing should be assumed, and makedoc to enable rules for
# building imprimatur documentation.
# (1) any one of PROOF, DISTRIB or PUBLISH to set the default
# rendition, (2) frenchspacing to declare that French sentence
# spacing should be assumed, (3) makedoc to enable rules for
# building imprimatur documentation, and (4) dist-info to
# build and distribute imprimatur.info file (requires makedoc).
AC_DEFUN([IMPRIMATUR_INIT],[
m4_pushdef([imprimaturdir],[m4_if([$1],,[imprimatur],[$1])])
AC_SUBST([IMPRIMATUR_MODULE_DIR],imprimaturdir)
AC_CONFIG_FILES(imprimaturdir[/Makefile])
_IMPRIMATUR_SET_OPTIONS([$2])
AC_SUBST(RENDITION)
_IMPRIMATUR_OPTION_SWITCH([PROOF],[RENDITION=PROOF],
@ -94,5 +94,11 @@ AC_DEFUN([IMPRIMATUR_INIT],[
[_IMPRIMATUR_IF_OPTION_SET([makedoc],[true],[false])])
AM_CONDITIONAL([IMPRIMATUR_COND_FRENCHSPACING],
[_IMPRIMATUR_IF_OPTION_SET([frenchspacing],[true],[false])])
AM_CONDITIONAL([IMPRIMATUR_COND_DIST_INFO],
[_IMPRIMATUR_IF_OPTION_SET([dist-info],[true],[false])])
AC_CONFIG_FILES(imprimaturdir[/Makefile])
AM_COND_IF([IMPRIMATUR_COND_MAKEDOC],dnl
[AC_CONFIG_FILES(imprimaturdir[/Makedoc])])
m4_popdef([imprimaturdir])
])

View file

@ -7,7 +7,7 @@
@c The UPDATED date is updated automatically by the Emacs magic at the
@c end of this file.
@set UPDATED 18 September 2011
@set UPDATED 19 September 2011
@set VERSION 1.0
@c This document contains examples of all the rendition macros, so it
@ -538,10 +538,38 @@ document. @xref{imprimatur-check-sentence-spacing}.
@end defvr
@defvr {Option} makedoc
Enables Makefile rules for building @command{Imprimatur}
documentation. This is intended mostly for @command{Imprimatur}
maintainers, but you may use this option to build your own, perhaps
customized, copies of this manual.
@flindex Makedoc
Enables creation of a separate makefile for building
@command{Imprimatur} documentation. This file is called
@file{Makedoc} and contains rules for building this manual in various
output formats. With this option on, the @file{Makefile} in the
@file{imprimatur} subdirectory will also contain several additional
shortcut rules, namely:
@table @option
@item make info
@itemx make imprimatur.info
Creates the manual in info format (a shortcut for @command{make -f
Makedoc imprimatur.info}).
@item make pdf
Creates a PDF output (a shortcut for @command{make -f Makedoc pfd}).
@item make dvi
Creates a DVI output.
@item make ps
Creates a PostScript output.
@end table
This is intended mostly for @command{Imprimatur} maintainers, but you
may use this option to build your own, perhaps customized, copies of
this manual.
@end defvr
@defvr {Option} dist-info
Distribute the @file{imprimatur.info} file. This option is valid only
in conjunction with @option{makedoc}.
@end defvr
@end deffn