1. Fix a subtle bug in the use of ${DOC}. If you ran make(1) and defined

${FORMATS} on the command line then it would assume that you wanted to
   build a document in the current directory, based on the setting of ${DOC}.
   If ${DOC} wasn't set, it defaulted to the name of the current directory.

   Any Makefile that includes this, and expects to have documentation built
   in the current directory must now explicitly define DOC.  All the current
   ones do anyway.  This should be a non-problem when docproj.docbook.mk is
   split out in to smaller, more modular files.

   Move the comments for DOC from the non-mandatory to the mandatory
   section.

2. Clarify the meaning of DESTDIR, it's changed a little bit since it was
   first documented.

3. Initial, tentative support for building pkg_* packages from the
   formatted documentation.  Needs work, but I've had the patch out for
   review for a couple of days, and no comments either way -- so if
   people hate it, this should at least spur them on to say so.

       # cd /path/to/doc/to/turn/into/a/package
       # touch COMMENT DESCR
       # make 'FORMATS=this that and the other' package

   to build 'n' packages, one per format.  "make install" is run as part
   of the package dependency, so this will overwrite documentation you
   have already got installed.

4. Remove DOC_INSTALL_PREFIX.  Should have been DOCDIR from the start.
This commit is contained in:
Nik Clayton 1999-08-26 19:37:13 +00:00
parent cba99c4bed
commit ee685fdd2c
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=5451

View file

@ -1,5 +1,5 @@
# #
# $Id: docproj.docbook.mk,v 1.9 1999-08-19 00:07:09 nik Exp $ # $Id: docproj.docbook.mk,v 1.10 1999-08-26 19:37:13 nik Exp $
# #
# This include file <docproj.docbook.mk> handles installing documentation # This include file <docproj.docbook.mk> handles installing documentation
# from the FreeBSD Documentation Project. # from the FreeBSD Documentation Project.
@ -18,27 +18,29 @@
# Valid values are in ${KNOWN_FORMATS} # Valid values are in ${KNOWN_FORMATS}
# #
# SRCS One or more files that comprise your documentation. # SRCS One or more files that comprise your documentation.
#
# DOC Controls several things
#
# 1. ${DOC}.sgml is assumed to be the name of the
# master source file (which will use entities
# to include any other .sgml files.
#
# 2. ${DOC}.<foo> will be the name of the output
# files (${DOC}.html, ${DOC}.tex, ${DOC}.ps, and
# so on. Ignored for the "html-split" format,
# where the output file(s) start with index.html.
#
# #
# Optional variable definitions # Optional variable definitions
# #
# DESTDIR Directory in which files will be installed. Defaults # DESTDIR Directory in which files will be installed. Note
# to /usr/local/share/doc/fdp/{articles,books}/<name>, # that this works on a per-document basis. If you
# but can be overridden. # try and install two docs with the same DESTDIR they
# # will most likely overwrite one another. If you
# DOC Controls several things # want to install more than one document in to a new
# # directory tree you probably want to set the DOCDIR
# 1. ${DOC}.sgml is assumed to be the name of the # variable.
# master source file (which will use entities
# to include any other .sgml files.
#
# 2. ${DOC}.<foo> will be the name of the output
# files (${DOC}.html, ${DOC}.tex, ${DOC}.ps, and
# so on. Ignored for the "html-split" format,
# where the output file(s) start with index.html.
#
# If not set, defaults to the name of the current
# directory.
# #
# JADEFLAGS Additional options to pass to Jade. Typically # JADEFLAGS Additional options to pass to Jade. Typically
# used to define "IGNORE" entities to "INCLUDE" # used to define "IGNORE" entities to "INCLUDE"
@ -59,9 +61,9 @@
# (such as share/sgml/catalog) are expected to # (such as share/sgml/catalog) are expected to
# be under this path. Defaults to /usr/doc. # be under this path. Defaults to /usr/doc.
# #
# DOC_INSTALL_PREFIX The root prefix under which all docs are expected # DOCDIR The root prefix under which all docs are expected
# to install themselves. Defaults to # to install themselves. Defaults to
# /usr/local/share/doc/fdp # /usr/share/doc
# #
# EXTRA_CATALOGS Additional catalog files that should be used by # EXTRA_CATALOGS Additional catalog files that should be used by
# any SGML processing applications. # any SGML processing applications.
@ -75,10 +77,6 @@
.include "${.CURDIR}/../Makefile.inc" .include "${.CURDIR}/../Makefile.inc"
.endif .endif
DOC?= ${.CURDIR:T}
DOC_INSTALL_PREFIX?= /usr/local/share/doc/fdp
JADE= /usr/local/bin/jade JADE= /usr/local/bin/jade
DSLHTML= ${DOC_PREFIX}/share/sgml/freebsd.dsl DSLHTML= ${DOC_PREFIX}/share/sgml/freebsd.dsl
DSLPRINT= ${DOC_PREFIX}/share/sgml/freebsd.dsl DSLPRINT= ${DOC_PREFIX}/share/sgml/freebsd.dsl
@ -90,7 +88,7 @@ DSSSLCATALOG= /usr/local/share/sgml/docbook/dsssl/modular/catalog
JADEOPTS= ${JADEFLAGS} -c ${FREEBSDCATALOG} -c ${DSSSLCATALOG} -c ${DOCBOOKCATALOG} -c ${JADECATALOG} ${EXTRA_CATALOGS:S/^/-c /g} JADEOPTS= ${JADEFLAGS} -c ${FREEBSDCATALOG} -c ${DSSSLCATALOG} -c ${DOCBOOKCATALOG} -c ${JADECATALOG} ${EXTRA_CATALOGS:S/^/-c /g}
KNOWN_FORMATS= html html-split html-split.tar txt rtf ps pdf tex dvi tar doc KNOWN_FORMATS= html html-split html-split.tar txt rtf ps pdf tex dvi tar
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# If DOC_PREFIX is not set then try and generate a sensible value for it. # If DOC_PREFIX is not set then try and generate a sensible value for it.
@ -153,6 +151,7 @@ DOC_PREFIX=/usr/doc
# and INSTALL_COMPRESSED variables are wrong. # and INSTALL_COMPRESSED variables are wrong.
# #
.if defined(DOC) && !empty(DOC)
.for _curformat in ${FORMATS} .for _curformat in ${FORMATS}
_cf=${_curformat} _cf=${_curformat}
.if ${_cf} == "html-split" .if ${_cf} == "html-split"
@ -188,6 +187,7 @@ _docs+= ${DOC}.doc
CLEANFILES+= ${DOC}.doc CLEANFILES+= ${DOC}.doc
.endif .endif
.endfor .endfor
.endif
# #
# Build a list of install-${format}.${compress_format} targets to be # Build a list of install-${format}.${compress_format} targets to be
@ -280,6 +280,36 @@ ${DOC}.tar:
validate: validate:
nsgmls -s -c ${FREEBSDCATALOG} -c ${DOCBOOKCATALOG} ${EXTRA_CATALOGS:S/^/-c /g} ${DOC}.sgml nsgmls -s -c ${FREEBSDCATALOG} -c ${DOCBOOKCATALOG} ${EXTRA_CATALOGS:S/^/-c /g} ${DOC}.sgml
# ------------------------------------------------------------------------
#
# Package building
#
#
# Build a list of package targets for each output format. Each package
# target depends on the corresponding install target running.
#
.for _curformat in ${KNOWN_FORMATS}
_cf=${_curformat}
package-${_curformat}: install-${_curformat}
rm PLIST
.if ${_cf} == "html-split"
cp HTML.manifest PLIST
.else
echo ${DOC}.${_curformat} > PLIST
.endif
pkg_create -v -c COMMENT -d DESCR -f PLIST -p ${DESTDIR} \
${DOC}.${_curformat}.tgz
.endfor
#
# Build one or more pkg_add(1)'able packages, based on all the current
# values of ${FORMATS}. Do this by listing all the appropriate
# package-* targets as dependencies.
#
package: ${FORMATS:S/^/package-/}
# ------------------------------------------------------------------------ # ------------------------------------------------------------------------
# #
# Compress targets # Compress targets
@ -348,12 +378,15 @@ install: beforeinstall realinstall afterinstall
# Build a list of install-format targets to be installed. These will be # Build a list of install-format targets to be installed. These will be
# dependencies for the "realinstall" target. # dependencies for the "realinstall" target.
# #
.if defined(DOC) && !empty(DOC)
.if !defined(INSTALL_ONLY_COMPRESSED) || empty(INSTALL_ONLY_COMPRESSED) .if !defined(INSTALL_ONLY_COMPRESSED) || empty(INSTALL_ONLY_COMPRESSED)
_curinst+= ${FORMATS:S/^/install-/g} _curinst+= ${FORMATS:S/^/install-/g}
.endif .endif
.endif
realinstall: ${_curinst} realinstall: ${_curinst}
.if defined(DOC) && !empty(DOC)
.for _curformat in ${KNOWN_FORMATS} .for _curformat in ${KNOWN_FORMATS}
_cf=${_curformat} _cf=${_curformat}
.if !target(install-${_cf}) .if !target(install-${_cf})
@ -396,6 +429,7 @@ install-${_cf}.${_compressext}: ${DOC}.${_cf}.${_compressext}
.endif .endif
.endif .endif
.endfor .endfor
.endif
.for __target in beforeinstall afterinstall depend _SUBDIR .for __target in beforeinstall afterinstall depend _SUBDIR
.if !target(${__target}) .if !target(${__target})