1999-09-03 19:07:19 +02:00
|
|
|
#
|
2000-10-10 08:16:56 +02:00
|
|
|
# $FreeBSD: doc/share/mk/doc.docbook.mk,v 1.21 2000/10/08 19:19:09 nik Exp $
|
1999-09-03 19:07:19 +02:00
|
|
|
#
|
|
|
|
# This include file <doc.docbook.mk> handles building and installing of
|
|
|
|
# DocBook documentation in the FreeBSD Documentation Project.
|
|
|
|
#
|
|
|
|
# Documentation using DOCFORMAT=docbook is expected to be marked up
|
|
|
|
# according to the DocBook DTD
|
|
|
|
#
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Document-specific variables
|
|
|
|
#
|
|
|
|
# DOC This should be set to the name of the DocBook
|
|
|
|
# marked-up file, without the .sgml or .docb suffix.
|
|
|
|
#
|
|
|
|
# It also determins the name of the output files -
|
|
|
|
# ${DOC}.html.
|
|
|
|
#
|
|
|
|
# DOCBOOKSUFFIX The suffix of your document, defaulting to .sgml
|
|
|
|
#
|
|
|
|
# SRCS The names of all the files that are needed to
|
|
|
|
# build this document - This is useful if any of
|
|
|
|
# them need to be generated. Changing any file in
|
|
|
|
# SRCS causes the documents to be rebuilt.
|
|
|
|
#
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Variables used by both users and documents:
|
|
|
|
#
|
|
|
|
# JADEFLAGS Additional options to pass to Jade. Typically
|
|
|
|
# used to define "IGNORE" entities to "INCLUDE"
|
|
|
|
# with "-i<entity-name>"
|
|
|
|
#
|
|
|
|
# TIDYFLAGS Additional flags to pass to Tidy. Typically
|
|
|
|
# used to set "-raw" flag to handle 8bit characters.
|
|
|
|
#
|
|
|
|
# EXTRA_CATALOGS Additional catalog files that should be used by
|
|
|
|
# any SGML processing applications.
|
|
|
|
#
|
2000-02-03 04:10:43 +01:00
|
|
|
# NO_TIDY If you do not want to use tidy, set this to "YES".
|
|
|
|
#
|
1999-09-03 19:07:19 +02:00
|
|
|
# Documents should use the += format to access these.
|
|
|
|
#
|
|
|
|
|
|
|
|
MASTERDOC?= ${.CURDIR}/${DOC}.sgml
|
|
|
|
|
2000-09-29 01:34:49 +02:00
|
|
|
.if !defined(OPENJADE)
|
|
|
|
JADE?= ${PREFIX}/bin/jade
|
|
|
|
JADECATALOG?= ${PREFIX}/share/sgml/jade/catalog
|
2000-10-07 18:31:04 +02:00
|
|
|
NSGMLS?= ${PREFIX}/bin/nsgmls
|
2000-09-29 01:34:49 +02:00
|
|
|
.else
|
|
|
|
JADE?= ${PREFIX}/bin/openjade
|
|
|
|
JADECATALOG?= ${PREFIX}/share/sgml/openjade/catalog
|
2000-10-07 18:31:04 +02:00
|
|
|
NSGMLS?= ${PREFIX}/bin/onsgmls
|
2000-09-29 01:34:49 +02:00
|
|
|
.endif
|
1999-09-03 19:07:19 +02:00
|
|
|
|
2000-09-29 01:29:48 +02:00
|
|
|
DSLHTML?= ${DOC_PREFIX}/share/sgml/default.dsl
|
|
|
|
DSLPRINT?= ${DOC_PREFIX}/share/sgml/default.dsl
|
1999-09-03 19:07:19 +02:00
|
|
|
FREEBSDCATALOG= ${DOC_PREFIX}/share/sgml/catalog
|
2000-09-29 01:29:48 +02:00
|
|
|
LANGUAGECATALOG=${DOC_PREFIX}/${LANGCODE}/share/sgml/catalog
|
1999-09-03 19:07:19 +02:00
|
|
|
|
|
|
|
DOCBOOKCATALOG= ${PREFIX}/share/sgml/docbook/catalog
|
|
|
|
DSSSLCATALOG= ${PREFIX}/share/sgml/docbook/dsssl/modular/catalog
|
|
|
|
|
2000-07-16 18:32:27 +02:00
|
|
|
LIB_IMAGES?=
|
|
|
|
|
2000-09-29 01:29:48 +02:00
|
|
|
JADEOPTS= ${JADEFLAGS} -c ${LANGUAGECATALOG} -c ${FREEBSDCATALOG} -c ${DSSSLCATALOG} -c ${DOCBOOKCATALOG} -c ${JADECATALOG} ${EXTRA_CATALOGS:S/^/-c /g}
|
1999-09-03 19:07:19 +02:00
|
|
|
|
2000-07-16 18:32:27 +02:00
|
|
|
KNOWN_FORMATS= html html.tar html-split html-split.tar txt rtf ps pdf tex dvi tar pdb
|
1999-09-03 19:07:19 +02:00
|
|
|
|
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Look at ${FORMATS} and work out which documents need to be generated.
|
|
|
|
# It is assumed that the HTML transformation will always create a file
|
|
|
|
# called index.html, and that for every other transformation the name
|
|
|
|
# of the generated file is ${DOC}.format.
|
|
|
|
#
|
|
|
|
# ${_docs} will be set to a list of all documents that must be made
|
|
|
|
# up to date.
|
|
|
|
#
|
|
|
|
# ${CLEANFILES} is a list of files that should be removed by the "clean"
|
|
|
|
# target. ${COMPRESS_EXT:S/^/${DOC}.${_cf}.&/ takes the COMPRESS_EXT
|
|
|
|
# var, and prepends the filename to each listed extension, building a
|
|
|
|
# second list of files with the compressed extensions added.
|
|
|
|
#
|
|
|
|
|
|
|
|
# Note: ".for _curformat in ${KNOWN_FORMATS}" is used several times in
|
|
|
|
# this file. I know they could have been rolled together in to one, much
|
|
|
|
# larger, loop. However, that would have made things more complicated
|
|
|
|
# for a newcomer to this file to unravel and understand, and a syntax
|
|
|
|
# error in the loop would have affected the entire
|
|
|
|
# build/compress/install process, instead of just one of them, making it
|
|
|
|
# more difficult to debug.
|
|
|
|
#
|
|
|
|
|
|
|
|
# Note: It is the aim of this file that *all* the targets be available,
|
|
|
|
# not just those appropriate to the current ${FORMATS} and
|
|
|
|
# ${INSTALL_COMPRESSED} values.
|
|
|
|
#
|
|
|
|
# For example, if FORMATS=html and INSTALL_COMPRESSED=gz you could still
|
|
|
|
# type
|
|
|
|
#
|
|
|
|
# make book.rtf.bz2
|
|
|
|
#
|
|
|
|
# and it will do the right thing. Or
|
|
|
|
#
|
|
|
|
# make install-rtf.bz2
|
|
|
|
#
|
|
|
|
# for that matter. But don't expect "make clean" to work if the FORMATS
|
|
|
|
# and INSTALL_COMPRESSED variables are wrong.
|
|
|
|
#
|
|
|
|
|
|
|
|
.for _curformat in ${FORMATS}
|
|
|
|
_cf=${_curformat}
|
|
|
|
.if ${_cf} == "html-split"
|
|
|
|
_docs+= index.html HTML.manifest
|
2000-04-29 09:46:15 +02:00
|
|
|
CLEANFILES+= `[ -f HTML.manifest ] && xargs < HTML.manifest` HTML.manifest
|
1999-09-03 19:07:19 +02:00
|
|
|
.elif ${_cf} == "html-split.tar"
|
|
|
|
_docs+= ${DOC}.html-split.tar
|
2000-04-29 09:46:15 +02:00
|
|
|
CLEANFILES+= `[ -f HTML.manifest ] && xargs < HTML.manifest` HTML.manifest
|
1999-09-03 19:07:19 +02:00
|
|
|
CLEANFILES+= ${DOC}.html-split.tar
|
|
|
|
.elif ${_cf} == "html"
|
|
|
|
_docs+= ${DOC}.html
|
|
|
|
CLEANFILES+= ${DOC}.html
|
2000-07-16 18:32:27 +02:00
|
|
|
.elif ${_cf} == "html.tar"
|
|
|
|
_docs+= ${DOC}.html.tar
|
|
|
|
CLEANFILES+= ${DOC}.html ${DOC}.html.tar
|
1999-09-03 19:07:19 +02:00
|
|
|
.elif ${_cf} == "txt"
|
|
|
|
_docs+= ${DOC}.txt
|
2000-10-08 21:19:09 +02:00
|
|
|
CLEANFILES+= ${DOC}.html ${DOC}.txt ${DOC}.html-text
|
1999-09-03 19:07:19 +02:00
|
|
|
.elif ${_cf} == "dvi"
|
|
|
|
_docs+= ${DOC}.dvi
|
|
|
|
CLEANFILES+= ${DOC}.aux ${DOC}.dvi ${DOC}.log ${DOC}.tex
|
|
|
|
.elif ${_cf} == "ps"
|
|
|
|
_docs+= ${DOC}.ps
|
2000-10-08 21:19:09 +02:00
|
|
|
CLEANFILES+= ${DOC}.aux ${DOC}.dvi ${DOC}.log ${DOC}.tex-ps ${DOC}.ps
|
1999-09-03 19:07:19 +02:00
|
|
|
.elif ${_cf} == "pdf"
|
|
|
|
_docs+= ${DOC}.pdf
|
2000-10-08 21:19:09 +02:00
|
|
|
CLEANFILES+= ${DOC}.aux ${DOC}.dvi ${DOC}.log ${DOC}.out ${DOC}.tex-pdf ${DOC}.pdf
|
1999-09-03 19:07:19 +02:00
|
|
|
.elif ${_cf} == "rtf"
|
|
|
|
_docs+= ${DOC}.rtf
|
|
|
|
CLEANFILES+= ${DOC}.rtf
|
|
|
|
.elif ${_cf} == "tar"
|
|
|
|
_docs+= ${DOC}.tar
|
|
|
|
CLEANFILES+= ${DOC}.tar
|
1999-12-13 19:14:41 +01:00
|
|
|
.elif ${_cf} == "pdb"
|
Give each language and encoding it's own freebsd.dsl, to contain style
sheet definitions for that language only. Each file reads in the defaults
from the master share/sgml/freebsd.dsl file, and adds overrides, or new
definitions, as necessary.
Move the per-language hacks from share/sgml/freebsd.dsl in to
<lang>/share/sgml/freebsd.dsl as necessary.
Add links to the -questions and -doc mailing lists to the bottom of the
generated HTML output for some languages. The -questions link will
become a link to Greg's "Getting the most from questions" document when
I bring that in, but I haven't done that yet, and I didn't want these
patches hanging around my local tree.
This was the real reason for making freebsd.dsl language local, as it
makes it much easier to translate generated text, such as the text of
the links, without polluting share/sgml/freebsd.dsl.
Update doc.docbook.mk to use the new, per-language freebsd.dsl file when
building the docs. While I'm here, update .pdb generation so that it
creates a symlink to ${CURDIR:T}.pdb as well (e.g., the Handbook generates
"book.pdb" and "handbook.pdb"). This makes it easier to install more than
one document on a Palm, because two docs called "book.pdb" or "article.pdb"
can not co-exist.
2000-03-23 10:00:17 +01:00
|
|
|
_docs+= ${DOC}.pdb ${.CURDIR:T}.pdb
|
|
|
|
+CLEANFILES+= ${DOC}.pdb ${.CURDIR:T}.pdb
|
1999-09-03 19:07:19 +02:00
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build a list of install-${format}.${compress_format} targets to be
|
|
|
|
# by "make install". Also, add ${DOC}.${format}.${compress_format} to
|
|
|
|
# ${_docs} and ${CLEANFILES} so they get built/cleaned by "all" and
|
|
|
|
# "clean".
|
|
|
|
#
|
|
|
|
|
|
|
|
.if defined(INSTALL_COMPRESSED) && !empty(INSTALL_COMPRESSED)
|
|
|
|
.for _curformat in ${FORMATS}
|
|
|
|
_cf=${_curformat}
|
|
|
|
.for _curcomp in ${INSTALL_COMPRESSED}
|
2000-07-18 00:30:03 +02:00
|
|
|
.if ${_cf} != "html-split" && ${_cf} != "html"
|
1999-09-03 19:07:19 +02:00
|
|
|
_curinst+= install-${_curformat}.${_curcomp}
|
|
|
|
_docs+= ${DOC}.${_curformat}.${_curcomp}
|
|
|
|
CLEANFILES+= ${DOC}.${_curformat}.${_curcomp}
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
|
2000-10-10 08:16:56 +02:00
|
|
|
.for _curimage in ${LIB_IMAGES}
|
|
|
|
LOCAL_LIB_IMAGES += ${LOCAL_LIB_IMAGES_DIR}/${_curimage}
|
|
|
|
.endfor
|
|
|
|
|
1999-09-03 19:07:19 +02:00
|
|
|
.MAIN: all
|
|
|
|
|
|
|
|
all: ${_docs}
|
|
|
|
|
2000-10-10 08:16:56 +02:00
|
|
|
index.html HTML.manifest: ${SRCS} ${LOCAL_LIB_IMAGES} ${IMAGES_PNG}
|
2000-10-08 21:19:09 +02:00
|
|
|
${JADE} -V html-manifest -ioutput.html -ioutput.html.images ${JADEOPTS} -d ${DSLHTML} -t sgml ${MASTERDOC}
|
2000-02-03 04:10:43 +01:00
|
|
|
.if !defined(NO_TIDY)
|
1999-11-01 20:41:02 +01:00
|
|
|
-tidy -i -m -f /dev/null ${TIDYFLAGS} `xargs < HTML.manifest`
|
2000-02-03 04:10:43 +01:00
|
|
|
.endif
|
1999-09-03 19:07:19 +02:00
|
|
|
|
2000-10-10 08:16:56 +02:00
|
|
|
${DOC}.html: ${SRCS} ${LOCAL_LIB_IMAGES} ${IMAGES_PNG}
|
2000-10-08 21:19:09 +02:00
|
|
|
${JADE} -ioutput.html -ioutput.html.images -V nochunks ${JADEOPTS} -d ${DSLHTML} -t sgml ${MASTERDOC} > ${.TARGET}
|
2000-02-03 04:10:43 +01:00
|
|
|
.if !defined(NO_TIDY)
|
1999-09-03 19:07:19 +02:00
|
|
|
-tidy -i -m -f /dev/null ${TIDYFLAGS} ${.TARGET}
|
2000-02-03 04:10:43 +01:00
|
|
|
.endif
|
1999-09-03 19:07:19 +02:00
|
|
|
|
2000-10-08 21:19:09 +02:00
|
|
|
# Special target to produce HTML with no images in it.
|
|
|
|
${DOC}.html-text: ${SRCS}
|
|
|
|
${JADE} -ioutput.html -V nochunks ${JADEOPTS} -d ${DSLHTML} -t sgml ${MASTERDOC} > ${.TARGET}
|
2000-09-29 01:29:48 +02:00
|
|
|
|
1999-09-03 19:07:19 +02:00
|
|
|
${DOC}.html-split.tar: HTML.manifest
|
|
|
|
tar cf ${.TARGET} `xargs < HTML.manifest`
|
2000-07-16 18:32:27 +02:00
|
|
|
tar uf ${.TARGET} ${LIB_IMAGES}
|
2000-10-08 21:19:09 +02:00
|
|
|
tar uf ${.TARGET} ${IMAGES_PNG}
|
2000-07-16 18:32:27 +02:00
|
|
|
|
|
|
|
${DOC}.html.tar: ${DOC}.html
|
|
|
|
tar cf ${.TARGET} ${DOC}.html
|
|
|
|
tar uf ${.TARGET} ${LIB_IMAGES}
|
2000-10-08 21:19:09 +02:00
|
|
|
tar uf ${.TARGET} ${IMAGES_PNG}
|
1999-09-03 19:07:19 +02:00
|
|
|
|
2000-10-08 21:19:09 +02:00
|
|
|
${DOC}.txt: ${DOC}.html-text
|
|
|
|
w3m -T text/html -S -dump ${.ALLSRC} > ${.TARGET}
|
1999-12-24 02:25:27 +01:00
|
|
|
|
|
|
|
${DOC}.pdb: ${DOC}.html
|
Give each language and encoding it's own freebsd.dsl, to contain style
sheet definitions for that language only. Each file reads in the defaults
from the master share/sgml/freebsd.dsl file, and adds overrides, or new
definitions, as necessary.
Move the per-language hacks from share/sgml/freebsd.dsl in to
<lang>/share/sgml/freebsd.dsl as necessary.
Add links to the -questions and -doc mailing lists to the bottom of the
generated HTML output for some languages. The -questions link will
become a link to Greg's "Getting the most from questions" document when
I bring that in, but I haven't done that yet, and I didn't want these
patches hanging around my local tree.
This was the real reason for making freebsd.dsl language local, as it
makes it much easier to translate generated text, such as the text of
the links, without polluting share/sgml/freebsd.dsl.
Update doc.docbook.mk to use the new, per-language freebsd.dsl file when
building the docs. While I'm here, update .pdb generation so that it
creates a symlink to ${CURDIR:T}.pdb as well (e.g., the Handbook generates
"book.pdb" and "handbook.pdb"). This makes it easier to install more than
one document on a Palm, because two docs called "book.pdb" or "article.pdb"
can not co-exist.
2000-03-23 10:00:17 +01:00
|
|
|
iSiloBSD -y -d0 -Idef ${DOC}.html ${DOC}.pdb
|
|
|
|
|
|
|
|
${.CURDIR:T}.pdb: ${DOC}.pdb
|
|
|
|
ln -f ${DOC}.pdb ${.CURDIR}.pdb
|
1999-09-03 19:07:19 +02:00
|
|
|
|
|
|
|
${DOC}.rtf: ${SRCS}
|
|
|
|
${JADE} -Vrtf-backend -ioutput.print ${JADEOPTS} -d ${DSLPRINT} -t rtf -o ${.TARGET} ${MASTERDOC}
|
|
|
|
|
2000-10-08 21:19:09 +02:00
|
|
|
#
|
|
|
|
# This sucks, but there's no way round it. The PS and PDF formats need
|
|
|
|
# to use different image formats, which are chosen at the .tex stage. So,
|
|
|
|
# we need to create a different .tex file depending on our eventual output
|
|
|
|
# format, which will then lead on to a different .dvi file as well.
|
|
|
|
#
|
|
|
|
${DOC}.tex-ps: ${SRCS} ${IMAGES_EPS}
|
1999-09-03 19:07:19 +02:00
|
|
|
${JADE} -Vtex-backend -ioutput.print ${JADEOPTS} -d ${DSLPRINT} -t tex -o ${.TARGET} ${MASTERDOC}
|
|
|
|
|
2000-10-08 21:19:09 +02:00
|
|
|
${DOC}.tex-pdf: ${SRCS} ${IMAGES_PNG}
|
|
|
|
${JADE} -Vtex-backend -ioutput.print -ioutput.print.pdf ${JADEOPTS} -d ${DSLPRINT} -t tex -o ${.TARGET} ${MASTERDOC}
|
|
|
|
|
|
|
|
${DOC}.dvi: ${DOC}.tex-ps
|
1999-09-03 19:07:19 +02:00
|
|
|
@echo "==> TeX pass 1/3"
|
|
|
|
-tex "&jadetex" ${.ALLSRC}
|
|
|
|
@echo "==> TeX pass 2/3"
|
|
|
|
-tex "&jadetex" ${.ALLSRC}
|
|
|
|
@echo "==> TeX pass 3/3"
|
|
|
|
-tex "&jadetex" ${.ALLSRC}
|
|
|
|
|
2000-10-08 21:19:09 +02:00
|
|
|
${DOC}.pdf: ${DOC}.tex-pdf
|
1999-09-03 19:07:19 +02:00
|
|
|
@echo "==> PDFTeX pass 1/3"
|
|
|
|
-pdftex "&pdfjadetex" ${.ALLSRC}
|
|
|
|
@echo "==> PDFTeX pass 2/3"
|
|
|
|
-pdftex "&pdfjadetex" ${.ALLSRC}
|
|
|
|
@echo "==> PDFTeX pass 3/3"
|
|
|
|
pdftex "&pdfjadetex" ${.ALLSRC}
|
|
|
|
|
|
|
|
${DOC}.ps: ${DOC}.dvi
|
|
|
|
dvips -o ${.TARGET} ${.ALLSRC}
|
|
|
|
|
|
|
|
${DOC}.tar: ${SRCS}
|
|
|
|
tar cf ${.TARGET} ${.ALLSRC}
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Validation targets
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Lets you quickly check that the document conforms to the DTD without
|
|
|
|
# having to convert it to any other formats
|
|
|
|
#
|
|
|
|
|
|
|
|
lint validate:
|
2000-09-29 01:34:49 +02:00
|
|
|
${NSGMLS} -s -c ${FREEBSDCATALOG} -c ${DSSSLCATALOG} -c ${DOCBOOKCATALOG} -c ${JADECATALOG} ${EXTRA_CATALOGS:S/^/-c /g} ${MASTERDOC}
|
1999-09-03 19:07:19 +02:00
|
|
|
|
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Compress targets
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# The list of compression extensions this Makefile knows about. If you
|
|
|
|
# add new compression schemes, add to this list (which is a list of
|
|
|
|
# extensions, hence bz2, *not* bzip2) and extend the _PROG_COMPRESS_*
|
|
|
|
# targets.
|
|
|
|
#
|
|
|
|
|
|
|
|
KNOWN_COMPRESS= gz bz2 zip
|
|
|
|
|
|
|
|
#
|
|
|
|
# You can't build suffix rules to do compression, since you can't
|
|
|
|
# wildcard the source suffix. So these are defined .USE, to be tacked on
|
|
|
|
# as dependencies of the compress-* targets.
|
|
|
|
#
|
|
|
|
|
|
|
|
_PROG_COMPRESS_gz: .USE
|
|
|
|
gzip -9 -c ${.ALLSRC} > ${.TARGET}
|
|
|
|
|
|
|
|
_PROG_COMPRESS_bz2: .USE
|
|
|
|
bzip2 -9 -c ${.ALLSRC} > ${.TARGET}
|
|
|
|
|
|
|
|
_PROG_COMPRESS_zip: .USE
|
|
|
|
zip -j -9 ${.TARGET} ${.ALLSRC}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build a list of targets for each compression scheme and output format.
|
2000-07-18 00:30:03 +02:00
|
|
|
# Don't compress the html-split or html output format (because they need
|
|
|
|
# to be rolled in to tar files first).
|
1999-09-03 19:07:19 +02:00
|
|
|
#
|
|
|
|
.for _curformat in ${KNOWN_FORMATS}
|
|
|
|
_cf=${_curformat}
|
|
|
|
.for _curcompress in ${KNOWN_COMPRESS}
|
2000-07-16 18:32:27 +02:00
|
|
|
.if ${_cf} == "html-split" || ${_cf} == "html"
|
1999-09-03 19:07:19 +02:00
|
|
|
${DOC}.${_cf}.tar.${_curcompress}: ${DOC}.${_cf}.tar _PROG_COMPRESS_${_curcompress}
|
|
|
|
.else
|
|
|
|
${DOC}.${_cf}.${_curcompress}: ${DOC}.${_cf} _PROG_COMPRESS_${_curcompress}
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Install targets
|
|
|
|
#
|
|
|
|
# Build install-* targets, one per allowed value in FORMATS. Need to
|
2000-07-16 18:32:27 +02:00
|
|
|
# build two specific targets;
|
1999-09-03 19:07:19 +02:00
|
|
|
#
|
|
|
|
# install-html-split - Handles multiple .html files being generated
|
|
|
|
# from one source. Uses the HTML.manifest file
|
|
|
|
# created by the stylesheets, which should list
|
|
|
|
# each .html file that's been created.
|
|
|
|
#
|
|
|
|
# install-* - Every other format. The wildcard expands to
|
|
|
|
# the other allowed formats, all of which should
|
|
|
|
# generate just one file.
|
|
|
|
#
|
|
|
|
# "beforeinstall" and "afterinstall" are hooks in to this process.
|
|
|
|
# Redefine them to do things before and after the files are installed,
|
|
|
|
# respectively.
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build a list of install-format targets to be installed. These will be
|
|
|
|
# dependencies for the "realinstall" target.
|
|
|
|
#
|
|
|
|
|
|
|
|
.if !defined(INSTALL_ONLY_COMPRESSED) || empty(INSTALL_ONLY_COMPRESSED)
|
|
|
|
_curinst+= ${FORMATS:S/^/install-/g}
|
|
|
|
.endif
|
|
|
|
|
|
|
|
realinstall: ${_curinst}
|
|
|
|
|
|
|
|
.for _curformat in ${KNOWN_FORMATS}
|
|
|
|
_cf=${_curformat}
|
|
|
|
.if !target(install-${_cf})
|
|
|
|
.if ${_cf} == "html-split"
|
|
|
|
install-${_cf}: index.html
|
|
|
|
@[ -d ${DESTDIR} ] || mkdir -p ${DESTDIR}
|
|
|
|
${INSTALL_DOCS} `xargs < HTML.manifest` ${DESTDIR}
|
|
|
|
@if [ -f ${.OBJDIR}/${DOC}.ln ]; then \
|
|
|
|
(cd ${DESTDIR}; sh ${.OBJDIR}/${DOC}.ln); \
|
|
|
|
fi
|
2000-07-16 18:32:27 +02:00
|
|
|
.for _curimage in ${LIB_IMAGES}
|
2000-07-18 18:30:45 +02:00
|
|
|
@[ -d ${DESTDIR}/${LOCAL_LIB_IMAGES_DIR}/${_curimage:H} ] || mkdir -p ${DESTDIR}/${LOCAL_LIB_IMAGES_DIR}/${_curimage:H}
|
|
|
|
${INSTALL_DOCS} ${LOCAL_LIB_IMAGES_DIR}/${_curimage} ${DESTDIR}/${LOCAL_LIB_IMAGES_DIR}/${_curimage:H}
|
2000-07-16 18:32:27 +02:00
|
|
|
.endfor
|
1999-09-03 19:07:19 +02:00
|
|
|
.for _compressext in ${KNOWN_COMPRESS}
|
|
|
|
install-${_cf}.tar.${_compressext}: ${DOC}.${_cf}.tar.${_compressext}
|
|
|
|
@[ -d ${DESTDIR} ] || mkdir -p ${DESTDIR}
|
|
|
|
${INSTALL_DOCS} ${.ALLSRC} ${DESTDIR}
|
|
|
|
.endfor
|
2000-07-16 18:32:27 +02:00
|
|
|
.elif ${_cf} == "html"
|
|
|
|
install-${_cf}: ${DOC}.${_cf}
|
|
|
|
@[ -d ${DESTDIR} ] || mkdir -p ${DESTDIR}
|
|
|
|
${INSTALL_DOCS} ${.ALLSRC} ${DESTDIR}
|
|
|
|
.for _curimage in ${LIB_IMAGES}
|
2000-07-18 18:30:45 +02:00
|
|
|
@[ -d ${DESTDIR}/${LOCAL_LIB_IMAGES_DIR}/${_curimage:H} ] || mkdir -p ${DESTDIR}/${LOCAL_LIB_IMAGES_DIR}/${_curimage:H}
|
|
|
|
${INSTALL_DOCS} ${LOCAL_LIB_IMAGES_DIR}/${_curimage} ${DESTDIR}/${LOCAL_LIB_IMAGES_DIR}/${_curimage:H}
|
2000-07-16 18:32:27 +02:00
|
|
|
.endfor
|
1999-09-03 19:07:19 +02:00
|
|
|
.else
|
|
|
|
install-${_cf}: ${DOC}.${_cf}
|
|
|
|
@[ -d ${DESTDIR} ] || mkdir -p ${DESTDIR}
|
|
|
|
${INSTALL_DOCS} ${.ALLSRC} ${DESTDIR}
|
|
|
|
|
|
|
|
.for _compressext in ${KNOWN_COMPRESS}
|
|
|
|
install-${_cf}.${_compressext}: ${DOC}.${_cf}.${_compressext}
|
|
|
|
@[ -d ${DESTDIR} ] || mkdir -p ${DESTDIR}
|
|
|
|
${INSTALL_DOCS} ${.ALLSRC} ${DESTDIR}
|
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Package building
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# realpackage is what is called in each subdirectory when a package
|
|
|
|
# target is called, or, rather, package calls realpackage in each
|
|
|
|
# subdirectory as it goes.
|
|
|
|
#
|
|
|
|
# packagelist returns the list of targets that would be called during
|
|
|
|
# package building.
|
|
|
|
#
|
|
|
|
|
|
|
|
realpackage: ${FORMATS:S/^/package-/}
|
|
|
|
packagelist:
|
|
|
|
@echo ${FORMATS:S/^/package-/}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build a list of package targets for each output target. Each package
|
|
|
|
# target depends on the corresponding install target running.
|
|
|
|
#
|
|
|
|
|
|
|
|
.for _curformat in ${KNOWN_FORMATS}
|
|
|
|
_cf=${_curformat}
|
|
|
|
package-${_curformat}: install-${_curformat}
|
|
|
|
.if ${_cf} == "html-split"
|
|
|
|
@cp HTML.manifest PLIST
|
|
|
|
.else
|
|
|
|
@echo ${DOC}.${_curformat} > PLIST
|
2000-07-16 18:32:27 +02:00
|
|
|
@for lib_images in ${LIB_IMAGES}; do \
|
|
|
|
echo $$lib_images >> PLIST; \
|
|
|
|
done
|
1999-09-03 19:07:19 +02:00
|
|
|
.endif
|
|
|
|
@pkg_create -v -c -"FDP ${.CURDIR:T} ${_curformat} package" \
|
|
|
|
-d -"FDP ${.CURDIR:T} ${_curformat} package" -f PLIST \
|
|
|
|
-p ${DESTDIR} ${PACKAGES}/${.CURDIR:T}.${LANGCODE}.${_curformat}.tgz
|
|
|
|
.endfor
|