1999-09-03 19:07:19 +02:00
|
|
|
#
|
2001-10-29 10:21:53 +01:00
|
|
|
# $FreeBSD$
|
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
|
2012-10-01 11:53:01 +02:00
|
|
|
# marked-up file, without the .xml suffix.
|
2016-01-15 02:59:38 +01:00
|
|
|
#
|
1999-09-03 19:07:19 +02:00
|
|
|
# It also determins the name of the output files -
|
|
|
|
# ${DOC}.html.
|
|
|
|
#
|
|
|
|
# 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:
|
|
|
|
#
|
|
|
|
# EXTRA_CATALOGS Additional catalog files that should be used by
|
2012-10-06 19:52:37 +02:00
|
|
|
# any XML processing applications.
|
1999-09-03 19:07:19 +02:00
|
|
|
#
|
2001-06-18 16:24:08 +02:00
|
|
|
# CSS_SHEET Full path to a CSS stylesheet suitable for DocBook.
|
|
|
|
# Default is ${DOC_PREFIX}/share/misc/docbook.css
|
|
|
|
#
|
2004-03-24 10:50:03 +01:00
|
|
|
# Package building options:
|
2016-01-15 02:59:38 +01:00
|
|
|
#
|
2004-03-24 10:50:03 +01:00
|
|
|
# BZIP2_PACKAGE Use bzip2(1) utility to compress package tarball
|
|
|
|
# instead of gzip(1). It results packages to have
|
|
|
|
# suffix .tbz instead of .tgz. Using bzip2(1)
|
|
|
|
# provides better compression, but requires longer
|
|
|
|
# time and utilizes more CPU resources than gzip(1).
|
2001-09-07 12:21:41 +02:00
|
|
|
|
2013-07-03 17:22:19 +02:00
|
|
|
# Either dblatex or fop
|
2013-11-07 13:44:37 +01:00
|
|
|
RENDERENGINE?= fop
|
2013-07-03 17:22:19 +02:00
|
|
|
|
2001-07-28 05:00:03 +02:00
|
|
|
#
|
1999-09-03 19:07:19 +02:00
|
|
|
# Documents should use the += format to access these.
|
|
|
|
#
|
|
|
|
|
2012-10-01 11:53:01 +02:00
|
|
|
MASTERDOC?= ${.CURDIR}/${DOC}.xml
|
1999-09-03 19:07:19 +02:00
|
|
|
|
2013-07-03 14:07:50 +02:00
|
|
|
DB5RNC?= ${DOC_PREFIX}/share/xml/freebsd50.rnc
|
|
|
|
|
2013-11-11 19:12:26 +01:00
|
|
|
XSLPROF?= http://docbook.sourceforge.net/release/xsl-ns/current/profiling/profile.xsl
|
2013-11-13 07:10:37 +01:00
|
|
|
XSLXHTML?= http://www.FreeBSD.org/XML/share/xml/freebsd-xhtml.xsl
|
|
|
|
XSLXHTMLCHUNK?= http://www.FreeBSD.org/XML/share/xml/freebsd-xhtml-chunk.xsl
|
|
|
|
XSLEPUB?= http://www.FreeBSD.org/XML/share/xml/freebsd-epub.xsl
|
|
|
|
XSLFO?= http://www.FreeBSD.org/XML/share/xml/freebsd-fo.xsl
|
2002-05-05 18:06:19 +02:00
|
|
|
|
2013-03-14 11:25:23 +01:00
|
|
|
XSLSCH?= /usr/local/share/xsl/iso-schematron/xslt1/iso_schematron_skeleton_for_xslt1.xsl
|
|
|
|
|
2000-10-29 03:39:10 +01:00
|
|
|
IMAGES_LIB?=
|
2000-07-16 18:32:27 +02:00
|
|
|
|
2013-03-14 11:25:23 +01:00
|
|
|
SCHEMATRONS?= ${DOC_PREFIX}/share/xml/freebsd.sch
|
2013-02-01 19:45:41 +01:00
|
|
|
XSLTPROCOPTS?= --nonet
|
1999-09-03 19:07:19 +02:00
|
|
|
|
2013-07-13 09:02:57 +02:00
|
|
|
IMGDIR?= ${IMAGES_EN_DIR}/${DOC}s/${.CURDIR:T}
|
|
|
|
CALLOUTDIR= ${.CURDIR}/imagelib/callouts
|
2013-11-13 07:10:37 +01:00
|
|
|
XSLDBLATEX= ${DOC_PREFIX}/share/xml/freebsd-dblatex.xsl
|
2016-01-25 22:22:06 +01:00
|
|
|
DBLATEXOPTS?= -I ${IMGDIR} -p ${XSLDBLATEX} -b xetex -d
|
2015-07-17 07:30:04 +02:00
|
|
|
FOPJAVAOPTS?= -Xss1024k -Xmx1431552k
|
2013-07-11 21:27:42 +02:00
|
|
|
FOPOPTS?= -c ${DOC_PREFIX}/share/misc/fop.xconf
|
2013-07-03 17:22:19 +02:00
|
|
|
|
2001-10-29 10:21:53 +01:00
|
|
|
KNOWN_FORMATS= html html.tar html-split html-split.tar \
|
2013-01-31 11:15:46 +01:00
|
|
|
epub txt rtf ps pdf tex dvi tar pdb
|
1999-09-03 19:07:19 +02:00
|
|
|
|
2001-06-18 16:24:08 +02:00
|
|
|
CSS_SHEET?= ${DOC_PREFIX}/share/misc/docbook.css
|
|
|
|
|
2004-03-24 00:53:27 +01:00
|
|
|
#
|
|
|
|
# Instruction for bsd.subdir.mk to not to process SUBDIR directive.
|
2011-05-15 22:41:31 +02:00
|
|
|
# It is not necessary since doc.docbook.mk do it too.
|
2004-03-24 00:53:27 +01:00
|
|
|
#
|
|
|
|
NO_SUBDIR= YES
|
|
|
|
|
2016-05-05 00:04:56 +02:00
|
|
|
#
|
|
|
|
# Determine latest revision
|
|
|
|
#
|
2016-06-14 16:02:59 +02:00
|
|
|
# This needs to contain all of:
|
2016-07-04 16:56:42 +02:00
|
|
|
# --stringparam latestrevision.timestamp "timestamp"
|
|
|
|
# --stringparam latestrevision.committer "committer"
|
|
|
|
# --stringparam latestrevision.number "revision id"
|
2016-06-14 16:02:59 +02:00
|
|
|
|
|
|
|
# If using git, use git log. The revision won't work with the generated links,
|
|
|
|
# because it is a hash, and git log doesn't know about git svn find-rev.
|
2016-07-04 16:56:42 +02:00
|
|
|
.if exists(${DOC_PREFIX}/.git) && exists(${GIT})
|
|
|
|
LATESTREVISION!=cd ${.CURDIR} && ${GIT} log -1 --pretty=format:'\
|
|
|
|
--stringparam latestrevision.timestamp "%ci" \
|
|
|
|
--stringparam latestrevision.committer "%cn" \
|
|
|
|
--stringparam latestrevision.number "%h"' ${SRCS}
|
2016-06-14 16:02:59 +02:00
|
|
|
.else
|
2017-05-05 15:50:57 +02:00
|
|
|
# if using Subversion, get information from metadata
|
|
|
|
# rather than embedded version strings
|
|
|
|
.if exists(${DOC_PREFIX}/.svn) && exists(${SVN})
|
|
|
|
LATESTREVISION!=cd ${.CURDIR} && ${SVN} info ${SRCS} 2>/dev/null | \
|
|
|
|
${AWK} 'BEGIN { genfmt="--stringparam latestrevision."; \
|
|
|
|
timefmt=genfmt"timestamp \"%s %s\""; \
|
|
|
|
comtfmt=genfmt"committer \"%s\""; \
|
|
|
|
revnfmt=genfmt"number \"%u\""; \
|
|
|
|
fmt=timefmt" "comtfmt"\t\t"revnfmt"\n"; } \
|
|
|
|
/^Last Changed Author:/ { committer=$$4 } \
|
|
|
|
/^Last Changed Rev:/ { number=$$4 } \
|
|
|
|
/^Last Changed Date:/ { date=$$4; time=$$5; \
|
|
|
|
printf(fmt, date, time, committer, number) }' \
|
|
|
|
| ${SORT} | ${TAIL} -n1
|
|
|
|
.endif
|
2016-06-14 16:02:59 +02:00
|
|
|
.endif
|
|
|
|
|
2016-07-04 16:56:42 +02:00
|
|
|
# if neither Subversion nor Git revision numbers are available, use
|
|
|
|
# the revision date from the timestamp of the most recent file and
|
|
|
|
# set the revision number to "filedate"
|
2016-06-14 16:02:59 +02:00
|
|
|
.if empty(LATESTREVISION)
|
2016-07-04 16:56:42 +02:00
|
|
|
LATESTREVISION!=${STAT} 2>/dev/null -t '%F %T %Z' -f '\
|
|
|
|
--stringparam latestrevision.timestamp "%Sc" \
|
|
|
|
--stringparam latestrevision.committer "%Su" \
|
|
|
|
--stringparam latestrevision.number "filedate"' \
|
|
|
|
${SRCS} | ${SORT} -r | ${TAIL} -n1
|
2016-06-14 16:02:59 +02:00
|
|
|
.endif
|
2016-05-05 00:04:56 +02:00
|
|
|
|
|
|
|
XSLTPROCOPTS+= ${LATESTREVISION}
|
|
|
|
|
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.
|
|
|
|
#
|
|
|
|
|
2001-10-29 10:21:53 +01:00
|
|
|
.if ${.OBJDIR} != ${.CURDIR}
|
|
|
|
LOCAL_CSS_SHEET= ${.OBJDIR}/${CSS_SHEET:T}
|
|
|
|
.else
|
|
|
|
LOCAL_CSS_SHEET= ${CSS_SHEET:T}
|
|
|
|
.endif
|
|
|
|
|
2013-05-07 16:33:38 +02:00
|
|
|
CLEANFILES+= ${DOC}.parsed.xml ${DOC}.parsed.print.xml
|
2013-02-01 12:04:50 +01:00
|
|
|
|
2013-11-13 08:07:52 +01:00
|
|
|
.if ${FORMATS:R:Mhtml-split} && ${FORMATS:R:Mhtml}
|
|
|
|
XSLTPROCOPTS+= --param docformatnav "'1'"
|
|
|
|
.endif
|
|
|
|
|
1999-09-03 19:07:19 +02:00
|
|
|
.for _curformat in ${FORMATS}
|
|
|
|
_cf=${_curformat}
|
2001-06-16 16:11:52 +02:00
|
|
|
|
1999-09-03 19:07:19 +02:00
|
|
|
.if ${_cf} == "html-split"
|
2001-02-22 16:42:41 +01:00
|
|
|
_docs+= index.html HTML.manifest ln*.html
|
2001-10-29 10:21:53 +01:00
|
|
|
CLEANFILES+= $$([ -f HTML.manifest ] && ${XARGS} < HTML.manifest) \
|
|
|
|
HTML.manifest ln*.html
|
|
|
|
CLEANFILES+= PLIST.${_curformat}
|
2001-06-16 16:11:52 +02:00
|
|
|
|
2001-10-29 10:21:53 +01:00
|
|
|
.else
|
|
|
|
_docs+= ${DOC}.${_curformat}
|
|
|
|
CLEANFILES+= ${DOC}.${_curformat}
|
|
|
|
CLEANFILES+= PLIST.${_curformat}
|
2001-06-16 16:11:52 +02:00
|
|
|
|
2001-10-29 10:21:53 +01:00
|
|
|
.if ${_cf} == "html-split.tar"
|
|
|
|
CLEANFILES+= $$([ -f HTML.manifest ] && ${XARGS} < HTML.manifest) \
|
|
|
|
HTML.manifest ln*.html
|
2001-06-16 16:11:52 +02:00
|
|
|
|
2013-01-30 17:36:59 +01:00
|
|
|
.elif ${_cf} == "epub"
|
|
|
|
CLEANFILES+= ${DOC}.epub mimetype
|
|
|
|
CLEANDIRS+= META-INF OEBPS
|
|
|
|
|
2000-07-16 18:32:27 +02:00
|
|
|
.elif ${_cf} == "html.tar"
|
2001-10-29 10:21:53 +01:00
|
|
|
CLEANFILES+= ${DOC}.html
|
2001-06-16 16:11:52 +02:00
|
|
|
|
1999-09-03 19:07:19 +02:00
|
|
|
.elif ${_cf} == "txt"
|
2001-10-29 10:21:53 +01:00
|
|
|
CLEANFILES+= ${DOC}.html-text
|
2001-06-16 16:11:52 +02:00
|
|
|
|
1999-09-03 19:07:19 +02:00
|
|
|
.elif ${_cf} == "dvi"
|
2006-04-07 16:34:34 +02:00
|
|
|
CLEANFILES+= ${DOC}.aux ${DOC}.log ${DOC}.out ${DOC}.tex ${DOC}.tex-tmp
|
2001-10-29 10:21:53 +01:00
|
|
|
|
2006-03-22 15:50:30 +01:00
|
|
|
.elif ${_cf} == "rtf"
|
|
|
|
CLEANFILES+= ${DOC}.rtf-nopng
|
|
|
|
|
2001-10-29 10:21:53 +01:00
|
|
|
.elif ${_cf} == "tex"
|
|
|
|
CLEANFILES+= ${DOC}.aux ${DOC}.log
|
2001-06-16 16:11:52 +02:00
|
|
|
|
1999-09-03 19:07:19 +02:00
|
|
|
.elif ${_cf} == "ps"
|
2013-01-31 11:27:59 +01:00
|
|
|
CLEANFILES+= ${DOC}.aux ${DOC}.dvi ${DOC}.log ${DOC}.out ${DOC}.tex-ps \
|
2013-02-01 12:04:50 +01:00
|
|
|
${DOC}.tex ${DOC}.tex-tmp ${DOC}.fo
|
2003-04-11 11:21:15 +02:00
|
|
|
.for _curimage in ${LOCAL_IMAGES_EPS:M*share*}
|
|
|
|
CLEANFILES+= ${_curimage:T} ${_curimage:H:T}/${_curimage:T}
|
|
|
|
.endfor
|
2001-06-16 16:11:52 +02:00
|
|
|
|
1999-09-03 19:07:19 +02:00
|
|
|
.elif ${_cf} == "pdf"
|
2006-04-07 16:34:34 +02:00
|
|
|
CLEANFILES+= ${DOC}.aux ${DOC}.dvi ${DOC}.log ${DOC}.out ${DOC}.tex-pdf ${DOC}.tex-pdf-tmp \
|
2013-02-01 12:04:50 +01:00
|
|
|
${DOC}.tex ${DOC}.fo
|
2013-07-13 09:02:57 +02:00
|
|
|
.if ${RENDERENGINE} == "fop"
|
|
|
|
XSLTPROCOPTS+= --param img.src.path "'${IMGDIR}/'"
|
|
|
|
XSLTPROCOPTS+= --param callout.graphics.path "'${CALLOUTDIR}/'"
|
2018-04-02 14:45:43 +02:00
|
|
|
XSLTPROCOPTS+= --maxdepth 12000
|
2013-07-13 09:02:57 +02:00
|
|
|
.endif
|
2003-04-11 11:21:15 +02:00
|
|
|
.for _curimage in ${LOCAL_IMAGES_EPS:M*share*}
|
|
|
|
CLEANFILES+= ${_curimage:T} ${_curimage:H:T}/${_curimage:T}
|
|
|
|
.endfor
|
2001-06-16 16:11:52 +02:00
|
|
|
|
1999-12-13 19:14:41 +01:00
|
|
|
.elif ${_cf} == "pdb"
|
2001-10-29 10:21:53 +01:00
|
|
|
_docs+= ${.CURDIR:T}.pdb
|
|
|
|
CLEANFILES+= ${.CURDIR:T}.pdb
|
|
|
|
|
|
|
|
.endif
|
|
|
|
.endif
|
2001-06-16 16:11:52 +02:00
|
|
|
|
2001-10-29 10:21:53 +01:00
|
|
|
.if (${LOCAL_CSS_SHEET} != ${CSS_SHEET}) && \
|
|
|
|
(${_cf} == "html-split" || ${_cf} == "html-split.tar" || \
|
|
|
|
${_cf} == "html" || ${_cf} == "html.tar" || ${_cf} == "txt")
|
|
|
|
CLEANFILES+= ${LOCAL_CSS_SHEET}
|
1999-09-03 19:07:19 +02:00
|
|
|
.endif
|
2001-10-29 10:21:53 +01:00
|
|
|
|
2003-10-02 21:46:49 +02:00
|
|
|
.if !defined(WITH_INLINE_LEGALNOTICE) || empty(WITH_INLINE_LEGALNOTICE) && \
|
|
|
|
(${_cf} == "html-split" || ${_cf} == "html-split.tar" || \
|
|
|
|
${_cf} == "html" || ${_cf} == "html.tar" || ${_cf} == "txt")
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.endfor # _curformat in ${FORMATS} #
|
1999-09-03 19:07:19 +02:00
|
|
|
|
2001-02-22 16:42:41 +01:00
|
|
|
|
1999-09-03 19:07:19 +02:00
|
|
|
#
|
|
|
|
# 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}
|
2001-10-29 10:21:53 +01:00
|
|
|
|
2013-01-30 17:36:59 +01:00
|
|
|
.if ${_cf} != "html-split" && ${_cf} != "html" && ${_cf} != "epub"
|
1999-09-03 19:07:19 +02:00
|
|
|
_curinst+= install-${_curformat}.${_curcomp}
|
|
|
|
_docs+= ${DOC}.${_curformat}.${_curcomp}
|
|
|
|
CLEANFILES+= ${DOC}.${_curformat}.${_curcomp}
|
2001-10-29 10:21:53 +01:00
|
|
|
|
|
|
|
.if ${_cf} == "pdb"
|
|
|
|
_docs+= ${.CURDIR:T}.${_curformat}.${_curcomp}
|
|
|
|
CLEANFILES+= ${.CURDIR:T}.${_curformat}.${_curcomp}
|
|
|
|
|
|
|
|
.endif
|
1999-09-03 19:07:19 +02:00
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.MAIN: all
|
|
|
|
|
2013-01-31 10:55:07 +01:00
|
|
|
all: ${SRCS} ${_docs}
|
1999-09-03 19:07:19 +02:00
|
|
|
|
2013-03-14 11:25:23 +01:00
|
|
|
.if defined(SCHEMATRONS)
|
|
|
|
.for sch in ${SCHEMATRONS}
|
2013-06-21 19:57:26 +02:00
|
|
|
schxslts+= ${sch:T}.xsl
|
|
|
|
CLEANFILES+= ${sch:T}.xsl
|
2013-03-14 11:25:23 +01:00
|
|
|
|
2013-06-21 19:57:26 +02:00
|
|
|
${sch:T}.xsl: ${sch}
|
2013-04-03 12:56:14 +02:00
|
|
|
${XSLTPROC} --param allow-foreign "true" ${XSLSCH} ${.ALLSRC} > ${.TARGET}
|
2013-03-14 11:25:23 +01:00
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
|
2013-02-01 12:04:50 +01:00
|
|
|
# Parsed XML -------------------------------------------------------
|
|
|
|
|
2013-11-13 08:07:52 +01:00
|
|
|
${DOC}.parsed.xml: ${SRCS} ${XML_INCLUDES}
|
2013-11-07 13:44:11 +01:00
|
|
|
${XMLLINT} --nonet --noent --valid --dropdtd --xinclude ${MASTERDOC} > ${.TARGET}.tmp
|
2013-03-15 11:26:27 +01:00
|
|
|
.if defined(PROFILING)
|
|
|
|
@${ECHO} "==> Profiling"
|
2013-11-07 19:20:08 +01:00
|
|
|
${XSLTPROC} ${PROFILING} ${XSLPROF} ${.TARGET}.tmp > ${.TARGET}
|
|
|
|
${RM} ${.TARGET}.tmp
|
2013-03-15 11:26:27 +01:00
|
|
|
.else
|
2013-11-07 19:20:08 +01:00
|
|
|
${MV} ${.TARGET}.tmp ${.TARGET}
|
2013-03-15 11:26:27 +01:00
|
|
|
.endif
|
2017-09-29 11:46:32 +02:00
|
|
|
${SED} 's|@@URL_RELPREFIX@@|https://www.FreeBSD.org|g' < ${.TARGET} > ${DOC}.parsed.print.xml
|
2013-11-07 19:20:08 +01:00
|
|
|
${SED} -i '' -e 's|@@URL_RELPREFIX@@|../../../..|g' ${.TARGET}
|
2013-02-01 12:04:50 +01:00
|
|
|
|
2015-08-24 17:54:10 +02:00
|
|
|
# translation -------------------------------------------------------
|
2017-10-12 16:13:48 +02:00
|
|
|
.include "${DOC_PREFIX}/share/mk/doc.translate.mk"
|
2015-08-24 17:54:10 +02:00
|
|
|
|
2013-01-30 17:19:08 +01:00
|
|
|
# XHTML -------------------------------------------------------------
|
2002-06-04 13:40:17 +02:00
|
|
|
|
2013-02-01 12:04:50 +01:00
|
|
|
index.html: ${DOC}.parsed.xml ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} \
|
2013-11-13 08:07:52 +01:00
|
|
|
${HTML_SPLIT_INDEX} ${LOCAL_CSS_SHEET} ${XML_INCLUDES}
|
2013-02-01 12:04:50 +01:00
|
|
|
${XSLTPROC} ${XSLTPROCOPTS} ${XSLXHTMLCHUNK} ${DOC}.parsed.xml
|
1999-09-03 19:07:19 +02:00
|
|
|
|
2013-02-01 12:04:50 +01:00
|
|
|
${DOC}.html: ${DOC}.parsed.xml ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} \
|
2013-11-13 08:07:52 +01:00
|
|
|
${LOCAL_CSS_SHEET} ${XML_INCLUDES}
|
2013-02-01 12:04:50 +01:00
|
|
|
${XSLTPROC} ${XSLTPROCOPTS} ${XSLXHTML} ${DOC}.parsed.xml > ${.TARGET}
|
2000-09-29 01:29:48 +02:00
|
|
|
|
2001-10-29 10:21:53 +01:00
|
|
|
${DOC}.html-split.tar: HTML.manifest ${LOCAL_IMAGES_LIB} \
|
|
|
|
${LOCAL_IMAGES_PNG} ${LOCAL_CSS_SHEET}
|
|
|
|
${TAR} cf ${.TARGET} $$(${XARGS} < HTML.manifest) \
|
2003-07-05 12:09:50 +02:00
|
|
|
${LOCAL_IMAGES_LIB} ${IMAGES_PNG:N*share*} ${CSS_SHEET:T}
|
|
|
|
.for _curimage in ${IMAGES_PNG:M*share*}
|
|
|
|
${TAR} rf ${.TARGET} -C ${IMAGES_EN_DIR}/${DOC}s/${.CURDIR:T} ${_curimage:S|${IMAGES_EN_DIR}/${DOC}s/${.CURDIR:T}/||}
|
|
|
|
.endfor
|
2000-07-16 18:32:27 +02:00
|
|
|
|
2001-10-29 10:21:53 +01:00
|
|
|
${DOC}.html.tar: ${DOC}.html ${LOCAL_IMAGES_LIB} \
|
|
|
|
${LOCAL_IMAGES_PNG} ${LOCAL_CSS_SHEET}
|
|
|
|
${TAR} cf ${.TARGET} ${DOC}.html \
|
2003-07-05 12:09:50 +02:00
|
|
|
${LOCAL_IMAGES_LIB} ${IMAGES_PNG:N*share*} ${CSS_SHEET:T}
|
|
|
|
.for _curimage in ${IMAGES_PNG:M*share*}
|
|
|
|
${TAR} rf ${.TARGET} -C ${IMAGES_EN_DIR}/${DOC}s/${.CURDIR:T} ${_curimage:S|${IMAGES_EN_DIR}/${DOC}s/${.CURDIR:T}/||}
|
|
|
|
.endfor
|
1999-09-03 19:07:19 +02:00
|
|
|
|
2013-01-30 17:36:59 +01:00
|
|
|
# EPUB -------------------------------------------------------------
|
|
|
|
|
2013-02-01 12:04:50 +01:00
|
|
|
${DOC}.epub: ${DOC}.parsed.xml ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} \
|
2013-11-13 08:07:52 +01:00
|
|
|
${CSS_SHEET} ${XML_INCLUDES}
|
2013-02-01 12:04:50 +01:00
|
|
|
${XSLTPROC} ${XSLTPROCOPTS} ${XSLEPUB} ${DOC}.parsed.xml
|
2016-05-04 23:35:12 +02:00
|
|
|
.if defined(LOCAL_IMAGES_LIB)
|
|
|
|
.for f in ${LOCAL_IMAGES_LIB}
|
|
|
|
[ -d "OEBPS/${f:H}" ] || ${MKDIR} -pv "OEBPS/${f:H}"
|
|
|
|
${CP} ${f} OEBPS/${f}
|
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
.if defined(LOCAL_IMAGES_PNG)
|
|
|
|
.for f in ${LOCAL_IMAGES_PNG}
|
|
|
|
[ -d "OEBPS/${f:H:T}" ] || ${MKDIR} -pv "OEBPS/${f:H:T}"
|
|
|
|
${CP} -v ${f} OEBPS/${f:H:T}/${f:T}
|
2013-08-15 00:29:07 +02:00
|
|
|
.endfor
|
2013-02-05 11:02:36 +01:00
|
|
|
.endif
|
2013-08-15 00:29:07 +02:00
|
|
|
${ZIP} ${ZIPOPTS} -r -X ${DOC}.epub mimetype OEBPS META-INF
|
2013-01-30 17:36:59 +01:00
|
|
|
|
2002-06-04 13:40:17 +02:00
|
|
|
# TXT --------------------------------------------------------------------
|
|
|
|
|
2005-12-10 15:02:03 +01:00
|
|
|
.if !target(${DOC}.txt)
|
2006-04-17 19:50:34 +02:00
|
|
|
.if !defined(NO_PLAINTEXT)
|
2013-01-30 17:19:08 +01:00
|
|
|
${DOC}.txt: ${DOC}.html
|
2001-11-05 11:33:38 +01:00
|
|
|
${HTML2TXT} ${HTML2TXTOPTS} ${.ALLSRC} > ${.TARGET}
|
2006-04-17 19:50:34 +02:00
|
|
|
.else
|
|
|
|
${DOC}.txt:
|
|
|
|
${TOUCH} ${.TARGET}
|
2016-01-15 02:59:38 +01:00
|
|
|
.endif
|
2006-04-17 19:50:34 +02:00
|
|
|
.endif
|
1999-12-24 02:25:27 +01:00
|
|
|
|
2002-06-04 13:40:17 +02:00
|
|
|
# PDB --------------------------------------------------------------------
|
|
|
|
|
2001-10-29 10:21:53 +01:00
|
|
|
${DOC}.pdb: ${DOC}.html ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG}
|
2001-11-05 11:33:38 +01:00
|
|
|
${HTML2PDB} ${HTML2PDBOPTS} ${DOC}.html ${.TARGET}
|
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
|
|
|
|
|
|
|
${.CURDIR:T}.pdb: ${DOC}.pdb
|
2001-10-29 10:21:53 +01:00
|
|
|
${LN} -f ${.ALLSRC} ${.TARGET}
|
1999-09-03 19:07:19 +02:00
|
|
|
|
2001-10-29 10:21:53 +01:00
|
|
|
.if defined(INSTALL_COMPRESSED) && !empty(INSTALL_COMPRESSED)
|
|
|
|
.for _curcomp in ${INSTALL_COMPRESSED}
|
|
|
|
${.CURDIR:T}.pdb.${_curcomp}: ${DOC}.pdb.${_curcomp}
|
|
|
|
${LN} -f ${.ALLSRC} ${.TARGET}
|
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
|
2013-05-29 21:26:44 +02:00
|
|
|
# PS/PDF/RTF -----------------------------------------------------------------
|
2001-10-29 10:21:53 +01:00
|
|
|
|
2013-11-13 08:07:52 +01:00
|
|
|
${DOC}.fo: ${DOC}.xml ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} ${DOC}.parsed.xml ${XML_INCLUDES}
|
2013-05-07 16:33:38 +02:00
|
|
|
${XSLTPROC} ${XSLTPROCOPTS} ${XSLFO} ${DOC}.parsed.print.xml > ${.TARGET}
|
2013-01-31 11:27:59 +01:00
|
|
|
|
2013-07-03 17:22:19 +02:00
|
|
|
.if ${RENDERENGINE} == "fop"
|
2013-01-31 11:27:59 +01:00
|
|
|
${DOC}.pdf: ${DOC}.fo ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG}
|
2016-05-01 19:19:54 +02:00
|
|
|
${SETENV} FOP_OPTS="${FOPJAVAOPTS}" ${FOP} ${FOPOPTS} ${DOC}.fo -pdf ${.TARGET}
|
2013-01-31 11:27:59 +01:00
|
|
|
|
|
|
|
${DOC}.ps: ${DOC}.fo ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG}
|
2016-05-01 19:19:54 +02:00
|
|
|
${SETENV} FOP_OPTS="${FOPJAVAOPTS}" ${FOP} ${FOPOPTS} ${DOC}.fo -ps ${.TARGET}
|
2013-02-01 12:04:50 +01:00
|
|
|
|
|
|
|
${DOC}.rtf: ${DOC}.fo ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG}
|
2016-05-01 19:19:54 +02:00
|
|
|
${SETENV} FOP_OPTS="${FOPJAVAOPTS}" ${FOP} ${FOPOPTS} ${DOC}.fo -rtf ${.TARGET}
|
2013-07-03 17:22:19 +02:00
|
|
|
.else
|
|
|
|
# Default is dblatex
|
|
|
|
${DOC}.pdf: ${DOC}.parsed.xml ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG}
|
2016-05-01 19:19:54 +02:00
|
|
|
${DBLATEX} ${DOC}.parsed.print.xml ${DBLATEXOPTS} -tpdf -o ${.TARGET}
|
2013-07-03 17:22:19 +02:00
|
|
|
|
|
|
|
${DOC}.ps: ${DOC}.parsed.xml ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG}
|
2016-05-01 19:19:54 +02:00
|
|
|
${DBLATEX} ${DOC}.parsed.print.xml ${DBLATEXOPTS} -tps -o ${.TARGET}
|
2013-07-03 17:22:19 +02:00
|
|
|
.endif
|
2016-01-15 02:59:38 +01:00
|
|
|
|
2013-02-01 12:04:50 +01:00
|
|
|
|
2001-10-29 10:21:53 +01:00
|
|
|
${DOC}.tar: ${SRCS} ${LOCAL_IMAGES} ${LOCAL_CSS_SHEET}
|
|
|
|
${TAR} cf ${.TARGET} -C ${.CURDIR} ${SRCS} \
|
|
|
|
-C ${.OBJDIR} ${IMAGES} ${CSS_SHEET:T}
|
|
|
|
|
|
|
|
#
|
|
|
|
# Build targets for any formats we've missed that we don't handle.
|
|
|
|
#
|
|
|
|
.for _curformat in ${ALL_FORMATS}
|
|
|
|
.if !target(${DOC}.${_curformat})
|
|
|
|
${DOC}.${_curformat}:
|
|
|
|
@${ECHO_CMD} \"${_curformat}\" is not a valid output format for this document.
|
|
|
|
.endif
|
|
|
|
.endfor
|
1999-09-03 19:07:19 +02:00
|
|
|
|
|
|
|
|
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Validation targets
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Lets you quickly check that the document conforms to the DTD without
|
|
|
|
# having to convert it to any other formats
|
|
|
|
#
|
|
|
|
|
2013-03-14 11:25:23 +01:00
|
|
|
#
|
|
|
|
# XXX: There is duplicated code below. In general, we want to see what
|
|
|
|
# is actually run but when validation is executed, it is better to
|
|
|
|
# silence the command invocation so that only error messages appear.
|
|
|
|
#
|
|
|
|
|
|
|
|
lint validate: ${SRCS} ${schxslts}
|
|
|
|
@${ECHO} "==> Basic validation"
|
2013-06-30 11:22:48 +02:00
|
|
|
@${XMLLINT} --nonet --noent --valid --dropdtd --xinclude ${MASTERDOC} > ${DOC}.parsed.xml
|
2013-03-14 11:25:23 +01:00
|
|
|
.if defined(schxslts)
|
|
|
|
@${ECHO} "==> Validating with Schematron constraints"
|
|
|
|
.for sch in ${schxslts}
|
2013-03-15 08:49:33 +01:00
|
|
|
@( out=`${XSLTPROC} ${sch} ${DOC}.parsed.xml`; \
|
|
|
|
if [ -n "$${out}" ]; then \
|
2013-03-15 09:40:03 +01:00
|
|
|
echo "$${out}" | ${GREP} -v '^<?xml'; \
|
2013-03-15 08:49:33 +01:00
|
|
|
false; \
|
|
|
|
fi )
|
2013-03-14 11:25:23 +01:00
|
|
|
.endfor
|
2013-07-03 14:07:50 +02:00
|
|
|
.endif
|
|
|
|
.if exists(${JING})
|
|
|
|
@${ECHO} "==> Validating with RELAX NG"
|
|
|
|
@${JING} -c ${DB5RNC} ${DOC}.parsed.xml
|
2013-03-14 11:25:23 +01:00
|
|
|
.endif
|
|
|
|
@${RM} -rf ${CLEANFILES} ${CLEANDIRS} ${DOC}.parsed.xml
|
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
|
2013-02-02 15:52:15 +01:00
|
|
|
${GZIP} ${GZIPOPTS} < ${.ALLSRC} > ${.TARGET}
|
1999-09-03 19:07:19 +02:00
|
|
|
|
|
|
|
_PROG_COMPRESS_bz2: .USE
|
2013-02-02 15:52:15 +01:00
|
|
|
${BZIP2} ${BZIP2OPTS} < ${.ALLSRC} > ${.TARGET}
|
1999-09-03 19:07:19 +02:00
|
|
|
|
|
|
|
_PROG_COMPRESS_zip: .USE
|
2013-02-02 15:52:15 +01:00
|
|
|
${ZIP} ${ZIPOPTS} ${.TARGET} ${.ALLSRC}
|
1999-09-03 19:07:19 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# 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"
|
2001-10-29 10:21:53 +01:00
|
|
|
${DOC}.${_cf}.tar.${_curcompress}: ${DOC}.${_cf}.tar \
|
|
|
|
_PROG_COMPRESS_${_curcompress}
|
1999-09-03 19:07:19 +02:00
|
|
|
.else
|
|
|
|
${DOC}.${_cf}.${_curcompress}: ${DOC}.${_cf} _PROG_COMPRESS_${_curcompress}
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
.endfor
|
|
|
|
|
2001-10-29 10:21:53 +01:00
|
|
|
#
|
|
|
|
# Build targets for any formats we've missed that we don't handle.
|
|
|
|
#
|
|
|
|
.for _curformat in ${ALL_FORMATS}
|
|
|
|
.for _curcompress in ${KNOWN_COMPRESS}
|
|
|
|
.if !target(${DOC}.${_curformat}.${_curcompress})
|
|
|
|
${DOC}.${_curformat}.${_curcompress}:
|
|
|
|
@${ECHO_CMD} \"${_curformat}.${_curcompress}\" is not a valid output format for this document.
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
|
1999-09-03 19:07:19 +02:00
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2003-05-21 13:23:45 +02:00
|
|
|
populate_html_docs:
|
|
|
|
.if exists(HTML.manifest)
|
|
|
|
_html_docs!=${CAT} HTML.manifest
|
|
|
|
.endif
|
|
|
|
|
|
|
|
spellcheck-html-split: populate_html_docs
|
|
|
|
.for _html_file in ${_html_docs}
|
|
|
|
@echo "Spellcheck ${_html_file}"
|
|
|
|
@${HTML2TXT} ${HTML2TXTOPTS} ${.CURDIR}/${_html_file} | ${ISPELL} ${ISPELLOPTS}
|
|
|
|
.endfor
|
|
|
|
spellcheck-html:
|
2003-05-04 06:51:09 +02:00
|
|
|
.for _entry in ${_docs}
|
|
|
|
@echo "Spellcheck ${_entry}"
|
|
|
|
@${HTML2TXT} ${HTML2TXTOPTS} ${.CURDIR}/${_entry} | ${ISPELL} ${ISPELLOPTS}
|
|
|
|
.endfor
|
2003-05-21 13:23:45 +02:00
|
|
|
spellcheck-txt:
|
|
|
|
.for _entry in ${_docs:M*.txt}
|
|
|
|
@echo "Spellcheck ${_entry}"
|
|
|
|
@ < ${.CURDIR}/${_entry} ${ISPELL} ${ISPELLOPTS}
|
|
|
|
.endfor
|
|
|
|
.for _curformat in ${FORMATS}
|
|
|
|
.if !target(spellcheck-${_curformat})
|
|
|
|
spellcheck-${_curformat}:
|
|
|
|
@echo "Spellcheck is not currently supported for the ${_curformat} format."
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
spellcheck: ${FORMATS:C/^/spellcheck-/}
|
2003-05-04 06:51:09 +02:00
|
|
|
|
1999-09-03 19:07:19 +02:00
|
|
|
#
|
|
|
|
# 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
|
|
|
|
|
2006-04-17 19:50:34 +02:00
|
|
|
.if defined(NO_TEX)
|
|
|
|
_curinst_filter+=N*dvi* N*tex* N*ps* N*pdf*
|
|
|
|
.endif
|
|
|
|
.if defined(NO_RTF)
|
|
|
|
_curinst_filter+=N*rtf*
|
|
|
|
.endif
|
|
|
|
.if defined(NO_PLAINTEXT)
|
|
|
|
_curinst_filter+=N*txt*
|
|
|
|
.endif
|
|
|
|
|
|
|
|
_cff!=${ECHO_CMD} "${_curinst_filter}" | ${SED} 's, ,:,g'
|
|
|
|
|
|
|
|
.if !defined(_cff) || empty(_cff)
|
1999-09-03 19:07:19 +02:00
|
|
|
realinstall: ${_curinst}
|
2006-04-17 19:50:34 +02:00
|
|
|
.else
|
|
|
|
.for i in ${_cff}
|
|
|
|
realinstall: ${_curinst:$i}
|
|
|
|
.endfor
|
|
|
|
.endif
|
1999-09-03 19:07:19 +02:00
|
|
|
|
|
|
|
.for _curformat in ${KNOWN_FORMATS}
|
|
|
|
_cf=${_curformat}
|
|
|
|
.if !target(install-${_cf})
|
|
|
|
.if ${_cf} == "html-split"
|
2001-10-29 10:21:53 +01:00
|
|
|
install-${_curformat}: index.html
|
|
|
|
.else
|
|
|
|
install-${_curformat}: ${DOC}.${_curformat}
|
|
|
|
.endif
|
|
|
|
@[ -d ${DESTDIR} ] || ${MKDIR} -p ${DESTDIR}
|
|
|
|
.if ${_cf} == "html-split"
|
2013-06-24 10:23:29 +02:00
|
|
|
${INSTALL_DOCS} $$(${XARGS} < HTML.manifest) ${DESTDIR}
|
2001-10-29 10:21:53 +01:00
|
|
|
.else
|
|
|
|
${INSTALL_DOCS} ${.ALLSRC} ${DESTDIR}
|
|
|
|
.endif
|
|
|
|
.if (${_cf} == "html-split" || ${_cf} == "html") && !empty(LOCAL_CSS_SHEET)
|
|
|
|
${INSTALL_DOCS} ${LOCAL_CSS_SHEET} ${DESTDIR}
|
|
|
|
.if ${_cf} == "html-split"
|
2001-02-22 16:42:41 +01:00
|
|
|
@if [ -f ln*.html ]; then \
|
|
|
|
${INSTALL_DOCS} ln*.html ${DESTDIR}; \
|
|
|
|
fi
|
2004-02-08 13:34:16 +01:00
|
|
|
@if [ -f LEGALNOTICE.html ]; then \
|
|
|
|
${INSTALL_DOCS} LEGALNOTICE.html ${DESTDIR}; \
|
|
|
|
fi
|
2012-09-16 20:26:39 +02:00
|
|
|
@if [ -f trademarks.html ]; then \
|
|
|
|
${INSTALL_DOCS} trademarks.html ${DESTDIR}; \
|
2004-02-08 13:34:16 +01:00
|
|
|
fi
|
1999-09-03 19:07:19 +02:00
|
|
|
@if [ -f ${.OBJDIR}/${DOC}.ln ]; then \
|
2001-10-29 10:21:53 +01:00
|
|
|
cd ${DESTDIR}; sh ${.OBJDIR}/${DOC}.ln; \
|
1999-09-03 19:07:19 +02:00
|
|
|
fi
|
2001-10-29 10:21:53 +01:00
|
|
|
.endif
|
2000-10-29 03:39:10 +01:00
|
|
|
.for _curimage in ${IMAGES_LIB}
|
2001-10-29 10:21:53 +01:00
|
|
|
@[ -d ${DESTDIR}/${LOCAL_IMAGES_LIB_DIR}/${_curimage:H} ] || \
|
|
|
|
${MKDIR} -p ${DESTDIR}/${LOCAL_IMAGES_LIB_DIR}/${_curimage:H}
|
|
|
|
${INSTALL_DOCS} ${LOCAL_IMAGES_LIB_DIR}/${_curimage} \
|
|
|
|
${DESTDIR}/${LOCAL_IMAGES_LIB_DIR}/${_curimage:H}
|
2000-10-29 03:39:10 +01:00
|
|
|
.endfor
|
2000-10-29 19:01:54 +01:00
|
|
|
# Install the images. First, loop over all the image names that contain a
|
2002-11-20 20:41:10 +01:00
|
|
|
# directory separator, make the subdirectories, and install. Then loop over
|
2000-10-29 19:01:54 +01:00
|
|
|
# the ones that don't contain a directory separator, and install them in the
|
|
|
|
# top level.
|
2003-04-11 11:21:15 +02:00
|
|
|
# Install at first images from /usr/share/images then localized ones
|
|
|
|
# cause of a different origin path.
|
|
|
|
.for _curimage in ${IMAGES_PNG:M*/*:M*share*}
|
|
|
|
${MKDIR} -p ${DESTDIR:H:H}/${_curimage:H:S|${IMAGES_EN_DIR}/||:S|${.CURDIR}||}
|
|
|
|
${INSTALL_DOCS} ${_curimage} ${DESTDIR:H:H}/${_curimage:H:S|${IMAGES_EN_DIR}/||:S|${.CURDIR}||}
|
|
|
|
.endfor
|
|
|
|
.for _curimage in ${IMAGES_PNG:M*/*:N*share*}
|
|
|
|
${MKDIR} -p ${DESTDIR}/${_curimage:H}
|
|
|
|
${INSTALL_DOCS} ${_curimage} ${DESTDIR}/${_curimage:H}
|
2000-10-29 19:01:54 +01:00
|
|
|
.endfor
|
|
|
|
.for _curimage in ${IMAGES_PNG:N*/*}
|
2003-04-11 11:21:15 +02:00
|
|
|
${INSTALL_DOCS} ${_curimage} ${DESTDIR}/${_curimage}
|
2000-07-16 18:32:27 +02:00
|
|
|
.endfor
|
2001-10-29 10:21:53 +01:00
|
|
|
.elif ${_cf} == "tex" || ${_cf} == "dvi"
|
|
|
|
.for _curimage in ${IMAGES_EPS:M*/*}
|
2003-04-11 11:21:15 +02:00
|
|
|
${MKDIR} -p ${DESTDIR}/${_curimage:H:S|${IMAGES_EN_DIR}/||:S|${.CURDIR:T}/||}
|
|
|
|
${INSTALL_DOCS} ${_curimage} ${DESTDIR}/${_curimage:H:S|${IMAGES_EN_DIR}/||:S|${.CURDIR:T}/||}
|
2000-10-29 19:01:54 +01:00
|
|
|
.endfor
|
2001-10-29 10:21:53 +01:00
|
|
|
.for _curimage in ${IMAGES_EPS:N*/*}
|
2000-10-29 03:39:10 +01:00
|
|
|
${INSTALL_DOCS} ${_curimage} ${DESTDIR}
|
2000-07-16 18:32:27 +02:00
|
|
|
.endfor
|
2001-10-29 10:21:53 +01:00
|
|
|
.elif ${_cf} == "pdb"
|
|
|
|
${LN} -f ${DESTDIR}/${.ALLSRC} ${DESTDIR}/${.CURDIR:T}.${_curformat}
|
|
|
|
.endif
|
1999-09-03 19:07:19 +02:00
|
|
|
|
2001-10-29 10:21:53 +01:00
|
|
|
.if ${_cf} == "html-split"
|
|
|
|
.for _compressext in ${KNOWN_COMPRESS}
|
|
|
|
install-${_curformat}.tar.${_compressext}: ${DOC}.${_curformat}.tar.${_compressext}
|
|
|
|
@[ -d ${DESTDIR} ] || ${MKDIR} -p ${DESTDIR}
|
|
|
|
${INSTALL_DOCS} ${.ALLSRC} ${DESTDIR}
|
|
|
|
.endfor
|
|
|
|
.else
|
1999-09-03 19:07:19 +02:00
|
|
|
.for _compressext in ${KNOWN_COMPRESS}
|
2003-05-21 23:16:10 +02:00
|
|
|
.if !target(install-${_curformat}.${_compressext})
|
2001-10-29 10:21:53 +01:00
|
|
|
install-${_curformat}.${_compressext}: ${DOC}.${_curformat}.${_compressext}
|
|
|
|
@[ -d ${DESTDIR} ] || ${MKDIR} -p ${DESTDIR}
|
1999-09-03 19:07:19 +02:00
|
|
|
${INSTALL_DOCS} ${.ALLSRC} ${DESTDIR}
|
2001-10-29 10:21:53 +01:00
|
|
|
.if ${_cf} == "pdb"
|
|
|
|
${LN} -f ${DESTDIR}/${.ALLSRC} \
|
|
|
|
${DESTDIR}/${.CURDIR:T}.${_curformat}.${_compressext}
|
|
|
|
.endif
|
2003-05-21 23:16:10 +02:00
|
|
|
.endif
|
1999-09-03 19:07:19 +02:00
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
2001-10-29 10:21:53 +01:00
|
|
|
#
|
|
|
|
# Build install- targets for any formats we've missed that we don't handle.
|
|
|
|
#
|
|
|
|
|
|
|
|
.for _curformat in ${ALL_FORMATS}
|
|
|
|
.if !target(install-${_curformat})
|
|
|
|
install-${_curformat}:
|
|
|
|
@${ECHO_CMD} \"${_curformat}\" is not a valid output format for this document.
|
|
|
|
|
|
|
|
.for _compressext in ${KNOWN_COMPRESS}
|
|
|
|
install-${_curformat}.${_compressext}:
|
|
|
|
@${ECHO_CMD} \"${_curformat}.${_compressext}\" is not a valid output format for this document.
|
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
|
|
|
|
|
1999-09-03 19:07:19 +02:00
|
|
|
# ------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# 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:
|
2001-10-29 10:21:53 +01:00
|
|
|
@${ECHO_CMD} ${FORMATS:S/^/package-/}
|
1999-09-03 19:07:19 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
# Build a list of package targets for each output target. Each package
|
|
|
|
# target depends on the corresponding install target running.
|
|
|
|
#
|
|
|
|
|
2004-03-24 10:50:03 +01:00
|
|
|
.if defined(BZIP2_PACKAGE)
|
|
|
|
PKG_SUFFIX= tbz
|
|
|
|
.else
|
|
|
|
PKG_SUFFIX= tgz
|
|
|
|
.endif
|
|
|
|
|
2004-03-24 10:45:31 +01:00
|
|
|
PKGDOCPFX!= realpath ${DOC_PREFIX}
|
|
|
|
|
1999-09-03 19:07:19 +02:00
|
|
|
.for _curformat in ${KNOWN_FORMATS}
|
2006-04-17 19:50:34 +02:00
|
|
|
__curformat=${_curformat}
|
2001-10-29 10:21:53 +01:00
|
|
|
|
2004-03-24 10:50:03 +01:00
|
|
|
${PACKAGES}/${.CURDIR:T}.${LANGCODE}.${_curformat}.${PKG_SUFFIX}:
|
2004-03-24 10:45:31 +01:00
|
|
|
${MKDIR} -p ${.OBJDIR}/pkg; \
|
|
|
|
(cd ${.CURDIR} && \
|
2004-05-12 14:58:12 +02:00
|
|
|
${MAKE} FORMATS=${_curformat} \
|
|
|
|
DOCDIR=${.OBJDIR}/pkg \
|
|
|
|
${PKGMAKEFLAGS} \
|
|
|
|
install); \
|
2004-03-24 10:45:31 +01:00
|
|
|
PKGSRCDIR=${.OBJDIR}/pkg/${.CURDIR:S/${PKGDOCPFX}\///}; \
|
|
|
|
/bin/ls -1 $$PKGSRCDIR > ${.OBJDIR}/PLIST.${_curformat}; \
|
|
|
|
${PKG_CREATE} -v -f ${.OBJDIR}/PLIST.${_curformat} \
|
|
|
|
-p ${DESTDIR} -s $$PKGSRCDIR \
|
2001-10-29 10:21:53 +01:00
|
|
|
-c -"FDP ${.CURDIR:T} ${_curformat} package" \
|
2004-03-24 10:45:31 +01:00
|
|
|
-d -"FDP ${.CURDIR:T} ${_curformat} package" ${.TARGET} || \
|
|
|
|
(${RM} -fr ${.TARGET} PLIST.${_curformat} && false); \
|
|
|
|
${RM} -rf ${.OBJDIR}/pkg
|
2001-10-29 10:21:53 +01:00
|
|
|
|
2006-04-17 19:50:34 +02:00
|
|
|
.if !defined(_cff) || empty(_cff)
|
|
|
|
package-${_curformat}: ${PACKAGES}/${.CURDIR:T}.${LANGCODE}.${_curformat}.${PKG_SUFFIX}
|
|
|
|
.else
|
|
|
|
.for i in ${_cff}
|
|
|
|
.if !empty(__curformat:$i)
|
2004-03-24 10:50:03 +01:00
|
|
|
package-${_curformat}: ${PACKAGES}/${.CURDIR:T}.${LANGCODE}.${_curformat}.${PKG_SUFFIX}
|
2006-04-17 19:50:34 +02:00
|
|
|
.else
|
|
|
|
package-${_curformat}:
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
|
1999-09-03 19:07:19 +02:00
|
|
|
.endfor
|
2001-06-18 16:24:08 +02:00
|
|
|
|
2001-10-29 10:21:53 +01:00
|
|
|
.if ${LOCAL_CSS_SHEET} != ${CSS_SHEET}
|
|
|
|
${LOCAL_CSS_SHEET}: ${CSS_SHEET}
|
2002-04-12 20:13:37 +02:00
|
|
|
${RM} -f ${.TARGET}
|
|
|
|
${CAT} ${.ALLSRC} > ${.TARGET}
|
2002-02-25 15:24:51 +01:00
|
|
|
.if defined(CSS_SHEET_ADDITIONS)
|
|
|
|
${CAT} ${.CURDIR}/${CSS_SHEET_ADDITIONS} >> ${.TARGET}
|
|
|
|
.endif
|
2001-10-29 10:21:53 +01:00
|
|
|
.endif
|
2017-09-19 11:50:17 +02:00
|
|
|
|
|
|
|
HTML.manifest: index.html
|
|
|
|
|