Rework our index support.

* Add a new document-specific variable, HAS_INDEX, to specify if a
    given document is marked up with <indexterm> entries.

  * Rework the index support so that both HAS_INDEX and GEN_INDEX are
    checked before trying to generate an index for a document.

  * Only create index.sgml if both HAS_INDEX and GEN_INDEX are set.

This allows us to recursively build the documentation tree with
GEN_INDEX=1 and have it only try to create an index (very time
consuming) for the few documents that are ready for this.  Previously,
running "make GEN_INDEX=1" from the top of the doc tree would look for
index terms in every single document.

With this, I hope we can start building our docs with GEN_INDEX set on
freefall so that users browsing the HTML docs will get the benefit of
the index we've been hiding in CVS for 6 months.
This commit is contained in:
Murray Stokely 2001-11-19 06:11:16 +00:00
parent 9913607760
commit 0361e0a8d3
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=11247
4 changed files with 15 additions and 14 deletions

View file

@ -10,11 +10,11 @@ DOC?= book
FORMATS?= html-split
HAS_INDEX= true
INSTALL_COMPRESSED?= gz
INSTALL_ONLY_COMPRESSED?=
GEN_INDEX?= yes
# Images
IMAGES= sockets/layers.eps sockets/sain.eps sockets/sainfill.eps sockets/sainlsb.eps sockets/sainmsb.eps sockets/sainserv.eps sockets/serv.eps sockets/serv2.eps sockets/slayers.eps

View file

@ -10,11 +10,11 @@ DOC?= book
FORMATS?= html-split
HAS_INDEX= true
INSTALL_COMPRESSED?= gz
INSTALL_ONLY_COMPRESSED?=
GEN_INDEX?= yes
# Images
IMAGES= sockets/layers.eps sockets/sain.eps sockets/sainfill.eps sockets/sainlsb.eps sockets/sainmsb.eps sockets/sainserv.eps sockets/serv.eps sockets/serv2.eps sockets/slayers.eps

View file

@ -30,6 +30,8 @@ DOC?= book
FORMATS?= html-split
HAS_INDEX= true
INSTALL_COMPRESSED?= gz
INSTALL_ONLY_COMPRESSED?=

View file

@ -25,6 +25,9 @@
# them need to be generated. Changing any file in
# SRCS causes the documents to be rebuilt.
#
# HAS_INDEX This document has index terms and so an index
# can be created if specified with GEN_INDEX.
#
# ------------------------------------------------------------------------
#
@ -47,9 +50,10 @@
#
# NO_TIDY If you do not want to use tidy, set this to "YES".
#
# GEN_INDEX If defined, index.sgml will be added to the list
# of dependencies for source files, and collateindex.pl
# will be run to generate index.sgml.
# GEN_INDEX If this document has an index (HAS_INDEX) and this
# variable is defined, then index.sgml will be added
# to the list of dependencies for source files, and
# collateindex.pl will be run to generate index.sgml.
#
# CSS_SHEET Full path to a CSS stylesheet suitable for DocBook.
# Default is ${DOC_PREFIX}/share/misc/docbook.css
@ -323,14 +327,14 @@ CLEANFILES+= ${.CURDIR:T}.${_curformat}.${_curcomp}
#
# Index generation
#
INDEX_SGML?= index.sgml
CLEANFILES+= ${INDEX_SGML}
.if defined(GEN_INDEX)
.if defined(GEN_INDEX) && defined(HAS_INDEX)
JADEFLAGS+= -i chap.index
HTML_SPLIT_INDEX?= html-split.index
HTML_INDEX?= html.index
PRINT_INDEX?= print.index
INDEX_SGML?= index.sgml
CLEANFILES+= ${HTML_SPLIT_INDEX} ${HTML_INDEX} ${PRINT_INDEX}
.endif
@ -471,13 +475,8 @@ lint validate:
# an empty index.sgml file so that we can reference index.sgml in book.sgml
#
.if defined(GEN_INDEX)
${INDEX_SGML}:
${PERL} ${COLLATEINDEX} -N -o ${.TARGET}
.else
${INDEX_SGML}:
${TOUCH} ${.TARGET}
.endif
${HTML_INDEX}:
${JADE} -V html-index -V nochunks ${HTMLOPTS} -ioutput.html.images \