- Remove doc.html.mk, which is not used any more
- Factor out command macros for better readability and consistency and less duplication - Make some macros more consistent with the rest
This commit is contained in:
parent
81a8fff0b6
commit
4cb9e266b6
Notes:
svn2git
2020-12-08 03:00:23 +00:00
svn path=/projects/xml-tools/; revision=40871
7 changed files with 157 additions and 568 deletions
149
share/mk/doc.commands.mk
Normal file
149
share/mk/doc.commands.mk
Normal file
|
@ -0,0 +1,149 @@
|
|||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
|
||||
CP?= /bin/cp
|
||||
CAT?= /bin/cat
|
||||
ECHO_CMD?= echo
|
||||
LN?= /bin/ln
|
||||
MKDIR?= /bin/mkdir
|
||||
RM?= /bin/rm
|
||||
MV?= /bin/mv
|
||||
HTML2TXT?= ${PREFIX}/bin/w3m
|
||||
HTML2TXTOPTS?= -dump ${HTML2TXTFLAGS}
|
||||
ISPELL?= ispell
|
||||
ISPELLOPTS?= -l -p /usr/share/dict/freebsd ${ISPELLFLAGS}
|
||||
.if exists(/usr/bin/perl)
|
||||
PERL?= /usr/bin/perl
|
||||
.elif exists(/usr/local/bin/perl)
|
||||
PERL?= /usr/local/bin/perl
|
||||
.else
|
||||
PERL?= perl
|
||||
.endif
|
||||
REALPATH?= /bin/realpath
|
||||
SETENV?= /usr/bin/env
|
||||
XSLTPROC?= ${PREFIX}/bin/xsltproc
|
||||
XMLLINT?= ${PREFIX}/bin/xmllint
|
||||
|
||||
BUNZIP2?= /usr/bin/bunzip2
|
||||
FETCH?= /usr/bin/fetch
|
||||
FIND?= /usr/bin/find
|
||||
LN?= /bin/ln
|
||||
SH?= /bin/sh
|
||||
SORT?= /usr/bin/sort
|
||||
TRUE?= /usr/bin/true
|
||||
|
||||
AWK?= /usr/bin/awk
|
||||
GREP?= /usr/bin/grep
|
||||
SED?= /usr/bin/sed
|
||||
|
||||
PKG_CREATE?= /usr/sbin/pkg_create
|
||||
TAR?= /usr/bin/tar
|
||||
TOUCH?= /usr/bin/touch
|
||||
XARGS?= /usr/bin/xargs
|
||||
|
||||
BZIP2?= bzip2
|
||||
BZIPOPTS?= -qf9
|
||||
GZIP?= gzip
|
||||
GZIPOPTS?= -qf9
|
||||
ZIP?= ${PREFIX}/bin/zip
|
||||
ZIPOPTS?= -j9
|
||||
|
||||
.if exists(${PREFIX}/bin/jade) && !defined(OPENJADE)
|
||||
JADE?= ${PREFIX}/bin/jade
|
||||
.else
|
||||
JADE?= ${PREFIX}/bin/openjade
|
||||
JADEFLAGS+= -V openjade
|
||||
.endif
|
||||
|
||||
FOP?= ${PREFIX}/bin/fop
|
||||
FOPOPTS?=
|
||||
|
||||
GROFF?= groff
|
||||
HTML2PDB?= ${PREFIX}/bin/iSiloBSD
|
||||
HTML2PDBOPTS?= -y -d0 -Idef ${HTML2PDBFLAGS}
|
||||
DVIPS?= ${PREFIX}/bin/dvips
|
||||
.if defined(PAPERSIZE)
|
||||
DVIPSOPTS?= -t ${PAPERSIZE:L}
|
||||
.endif
|
||||
DVIPSOPTS+= ${DVIPSFLAGS}
|
||||
|
||||
#
|
||||
# In teTeX 3.0 and later, pdfetex(1) is used as the default TeX
|
||||
# engine for JadeTeX and tex(1) cannot be used as ${TEX_CMD} anymore
|
||||
# due to incompatibility of the format file. Since the teTeX 3.0
|
||||
# distribution has "${PREFIX}/share/texmf-dist/LICENSE.texmf,"
|
||||
# it is checked here to determine which TeX engine should be used.
|
||||
.if exists(${PREFIX}/share/texmf-dist/LICENSE.texmf)
|
||||
TEX_CMD?= ${PREFIX}/bin/etex
|
||||
PDFTEX_CMD?= ${PREFIX}/bin/pdfetex
|
||||
.else
|
||||
TEX_CMD?= ${PREFIX}/bin/tex
|
||||
PDFTEX_CMD?= ${PREFIX}/bin/pdftex
|
||||
.endif
|
||||
LATEX_CMD?= ${PREFIX}/bin/latex
|
||||
JADETEX_CMD?= ${TEX_CMD} "&jadetex"
|
||||
JADETEX_PREPROCESS?= /bin/cat
|
||||
PDFJADETEX_CMD?=${PDFTEX_CMD} "&pdfjadetex"
|
||||
PDFJADETEX_PREPROCESS?= /bin/cat
|
||||
PS2PDF?= ${PREFIX}/bin/ps2pdf
|
||||
FOP_CMD?= ${PREFIX}/share/fop/fop.sh
|
||||
XEP_CMD?= sh ${HOME}/XEP/xep.sh
|
||||
JAVA_CMD?= ${PREFIX}/bin/javavm
|
||||
SAXON_CMD?= ${JAVA_CMD} -jar ${PREFIX}/share/java/classes/saxon.jar
|
||||
|
||||
#
|
||||
# Currently, we have to use the FixRTF utility available as textproc/fixrtf
|
||||
# to apply several RTF fixups:
|
||||
#
|
||||
# 1. Embed PNGs into RTF. (Option: -p)
|
||||
# 2. Embed FreeBSD-specific information into RTF, such as organization name,
|
||||
# building time. But unfortunately, so far only Microsoft Word can read
|
||||
# them. In contrast, Microsoft Word Viewer and OpenOffice even cannot read
|
||||
# this kind of information from RTF created by Microsoft Word and
|
||||
# OpenOffice. (Option: -i)
|
||||
# 3. Do some locale-specific fixing. (Option: -e <encoding>)
|
||||
#
|
||||
# This is a transitional solution before Jade/OpenJade provides these features.
|
||||
#
|
||||
FIXRTF?= ${PREFIX}/bin/fixrtf
|
||||
FIXRTFOPTS?= -i -p
|
||||
.if defined(SP_ENCODING)
|
||||
FIXRTFOPTS+= -e ${SP_ENCODING}
|
||||
.endif
|
||||
|
||||
SCR2PNG?= ${PREFIX}/bin/scr2png
|
||||
SCR2PNGOPTS?= ${SCR2PNGFLAGS}
|
||||
SCR2TXT?= ${PREFIX}/bin/scr2txt
|
||||
SCR2TXTOPTS?= -l ${SCR2TXTFLAGS}
|
||||
EPS2PNM?= ${PREFIX}/bin/gs
|
||||
EPS2PNMOPTS?= -q -dBATCH -dGraphicsAlphaBits=4 -dTextAlphaBits=4 \
|
||||
-dEPSCrop -r${EPS2PNM_RES}x${EPS2PNM_RES} \
|
||||
-dNOPAUSE -dSAFER -sDEVICE=pnm -sOutputFile=-
|
||||
#
|
||||
# epsgeom is a perl script for 1) extracting geometry information
|
||||
# from a .eps file and 2) arrange it for ghostscript's pnm driver.
|
||||
#
|
||||
EPSGEOM?= ${PERL} ${DOC_PREFIX}/share/misc/epsgeom
|
||||
EPSGEOMOPTS?= ${EPS2PNM_RES} ${EPS2PNM_RES}
|
||||
PNMTOPNG?= ${PREFIX}/bin/pnmtopng
|
||||
PNMTOPNGOPTS?= ${PNGTOPNGFLAGS}
|
||||
PNGTOPNM?= ${PREFIX}/bin/pngtopnm
|
||||
PNGTOPNMOPTS?= ${PNGTOPNMFLAGS}
|
||||
PPMTOPGM?= ${PREFIX}/bin/ppmtopgm
|
||||
PPMTOPGMOPTS?= ${PPMTOPGMFLAGS}
|
||||
PNMTOPS?= ${PREFIX}/bin/pnmtops
|
||||
PNMTOPSOPTS?= -noturn ${PNMTOPSFLAGS}
|
||||
EPSTOPDF?= ${PREFIX}/bin/epstopdf
|
||||
EPSTOPDFOPTS?= ${EPSTOPDFFLAGS}
|
||||
#
|
||||
PIC2PS?= ${GROFF} -p -S -Wall -mtty-char -man
|
||||
#
|
||||
PS2EPS?= ${PREFIX}/bin/gs
|
||||
PS2EPSOPTS?= -q -dNOPAUSE -dSAFER -dDELAYSAFER \
|
||||
-sPAPERSIZE=letter -r72 -sDEVICE=bit \
|
||||
-sOutputFile=/dev/null ${PS2EPSFLAGS} ps2epsi.ps
|
||||
PS2BBOX?= ${PREFIX}/bin/gs
|
||||
PS2BBOXOPTS?= -q -dNOPAUSE -dBATCH -dSAFER -dDELAYSAFER \
|
||||
-sPAPERSIZE=letter -r72 -sDEVICE=bbox \
|
||||
-sOutputFile=/dev/null ${PS2BBOXFLAGS}
|
|
@ -5,14 +5,6 @@
|
|||
# documents commonly used in doc/ and www/ tree.
|
||||
#
|
||||
|
||||
AWK?= /usr/bin/awk
|
||||
GREP?= /usr/bin/grep
|
||||
REALPATH?= /bin/realpath
|
||||
SED?= /usr/bin/sed
|
||||
# a hack to keep tidy from converting tabs to spaces
|
||||
# replace them with 	 before calling tidy
|
||||
REINPLACE_TABS_CMD?= ${SED} -i "" -e 's/ /\&\#09;/g'
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
#
|
||||
# Work out the language and encoding used for this document.
|
||||
|
|
|
@ -81,21 +81,8 @@ RENDERENGINE?= jade
|
|||
DSLHTML?= ${DOC_PREFIX}/share/xml/spellcheck.dsl
|
||||
.endif
|
||||
|
||||
XMLLINT?= /usr/local/bin/xmllint
|
||||
XMLDECL?= /usr/local/share/sgml/docbook/dsssl/modular/dtds/decls/xml.dcl
|
||||
|
||||
.if exists(${PREFIX}/bin/jade) && !defined(OPENJADE)
|
||||
JADE?= ${PREFIX}/bin/jade
|
||||
.else
|
||||
JADE?= ${PREFIX}/bin/openjade
|
||||
JADEFLAGS+= -V openjade
|
||||
.endif
|
||||
|
||||
JADE_CMD= ${SETENV} ${JADE_ENV} ${JADE}
|
||||
|
||||
FOP?= ${PREFIX}/bin/fop
|
||||
FOPOPTS?=
|
||||
|
||||
DSLHTML?= ${DOC_PREFIX}/share/xml/default.dsl
|
||||
DSLPRINT?= ${DOC_PREFIX}/share/xml/default.dsl
|
||||
DSLPGP?= ${DOC_PREFIX}/share/xml/pgp.dsl
|
||||
|
@ -142,51 +129,6 @@ HTMLFLAGS+= -V %show-all-trademark-symbols%
|
|||
PRINTFLAGS+= -V %show-all-trademark-symbols%
|
||||
.endif
|
||||
|
||||
PERL?= /usr/bin/perl
|
||||
PKG_CREATE?= /usr/sbin/pkg_create
|
||||
SORT?= /usr/bin/sort
|
||||
TAR?= /usr/bin/tar
|
||||
TOUCH?= /usr/bin/touch
|
||||
XARGS?= /usr/bin/xargs
|
||||
|
||||
GROFF?= groff
|
||||
HTML2TXT?= ${PREFIX}/bin/links
|
||||
HTML2TXTOPTS?= -dump -width 72 ${HTML2TXTFLAGS}
|
||||
HTML2PDB?= ${PREFIX}/bin/iSiloBSD
|
||||
HTML2PDBOPTS?= -y -d0 -Idef ${HTML2PDBFLAGS}
|
||||
DVIPS?= ${PREFIX}/bin/dvips
|
||||
.if defined(PAPERSIZE)
|
||||
DVIPSOPTS?= -t ${PAPERSIZE:L}
|
||||
.endif
|
||||
DVIPSOPTS+= ${DVIPSFLAGS}
|
||||
|
||||
#
|
||||
# Currently, we have to use the FixRTF utility available as textproc/fixrtf
|
||||
# to apply several RTF fixups:
|
||||
#
|
||||
# 1. Embed PNGs into RTF. (Option: -p)
|
||||
# 2. Embed FreeBSD-specific information into RTF, such as organization name,
|
||||
# building time. But unfortunately, so far only Microsoft Word can read
|
||||
# them. In contrast, Microsoft Word Viewer and OpenOffice even cannot read
|
||||
# this kind of information from RTF created by Microsoft Word and
|
||||
# OpenOffice. (Option: -i)
|
||||
# 3. Do some locale-specific fixing. (Option: -e <encoding>)
|
||||
#
|
||||
# This is a transitional solution before Jade/OpenJade provides these features.
|
||||
#
|
||||
FIXRTF?= ${PREFIX}/bin/fixrtf
|
||||
FIXRTFOPTS?= -i -p
|
||||
.if defined(SP_ENCODING)
|
||||
FIXRTFOPTS+= -e ${SP_ENCODING}
|
||||
.endif
|
||||
|
||||
GZIP?= -9
|
||||
GZIP_CMD?= gzip -qf ${GZIP}
|
||||
BZIP2?= -9
|
||||
BZIP2_CMD?= bzip2 -qf ${BZIP2}
|
||||
ZIP?= -9
|
||||
ZIP_CMD?= ${PREFIX}/bin/zip -j ${ZIP}
|
||||
|
||||
#
|
||||
# Instruction for bsd.subdir.mk to not to process SUBDIR directive.
|
||||
# It is not necessary since doc.docbook.mk do it too.
|
||||
|
@ -456,7 +398,7 @@ ${.CURDIR:T}.pdb.${_curcomp}: ${DOC}.pdb.${_curcomp}
|
|||
.if !defined(NO_RTF)
|
||||
${DOC}.rtf: ${DOC}.parsed.xml ${LOCAL_IMAGES_EPS} ${PRINT_INDEX} \
|
||||
${LOCAL_IMAGES_TXT} ${LOCAL_IMAGES_PNG}
|
||||
${JADE_CMD} -V rtf-backend ${PRINTOPTS} -ioutput.rtf.images \
|
||||
${JADE} -V rtf-backend ${PRINTOPTS} -ioutput.rtf.images \
|
||||
${JADEOPTS} -t rtf -o ${.TARGET}-nopng ${XMLDECL} \
|
||||
${DOC}.parsed.xml
|
||||
${FIXRTF} ${FIXRTFOPTS} < ${.TARGET}-nopng > ${.TARGET}
|
||||
|
@ -480,7 +422,7 @@ ${DOC}.rtf:
|
|||
${DOC}.tex: ${SRCS} ${LOCAL_IMAGES_EPS} ${PRINT_INDEX} \
|
||||
${LOCAL_IMAGES_TXT} ${LOCAL_IMAGES_EN} \
|
||||
${DOC}.parsed.xml
|
||||
${JADE_CMD} -V tex-backend ${PRINTOPTS} \
|
||||
${JADE} -V tex-backend ${PRINTOPTS} \
|
||||
${JADEOPTS} -t tex -o ${.TARGET} ${XMLDECL} ${DOC}.parsed.xml
|
||||
|
||||
${DOC}.tex-ps: ${DOC}.tex
|
||||
|
@ -491,7 +433,7 @@ ${DOC}.tex-pdf: ${SRCS} ${IMAGES_PDF} ${PRINT_INDEX} \
|
|||
${LOCAL_IMAGES_TXT} ${DOC}.parsed.xml
|
||||
${RM} -f ${.TARGET}
|
||||
${CAT} ${PDFTEX_DEF} > ${.TARGET}
|
||||
${JADE_CMD} -V tex-backend ${PRINTOPTS} -ioutput.print.pdf \
|
||||
${JADE} -V tex-backend ${PRINTOPTS} -ioutput.print.pdf \
|
||||
${JADEOPTS} -t tex -o /dev/stdout ${XMLDECL} ${DOC}.parsed.xml >> ${.TARGET}
|
||||
.endif
|
||||
|
||||
|
@ -612,13 +554,13 @@ KNOWN_COMPRESS= gz bz2 zip
|
|||
#
|
||||
|
||||
_PROG_COMPRESS_gz: .USE
|
||||
${GZIP_CMD} < ${.ALLSRC} > ${.TARGET}
|
||||
${GZIP} ${GZIPOPTS} < ${.ALLSRC} > ${.TARGET}
|
||||
|
||||
_PROG_COMPRESS_bz2: .USE
|
||||
${BZIP2_CMD} < ${.ALLSRC} > ${.TARGET}
|
||||
${BZIP2} ${BZIP2OPTS} < ${.ALLSRC} > ${.TARGET}
|
||||
|
||||
_PROG_COMPRESS_zip: .USE
|
||||
${ZIP_CMD} ${.TARGET} ${.ALLSRC}
|
||||
${ZIP} ${ZIPOPTS} ${.TARGET} ${.ALLSRC}
|
||||
|
||||
#
|
||||
# Build a list of targets for each compression scheme and output format.
|
||||
|
|
|
@ -1,371 +0,0 @@
|
|||
#
|
||||
# $FreeBSD$
|
||||
#
|
||||
# This include file <doc.html.mk> handles building and installing of
|
||||
# HTML documentation in the FreeBSD Documentation Project.
|
||||
#
|
||||
# Documentation using DOCFORMAT=html is expected to be marked up
|
||||
# according to the HTML DTD
|
||||
#
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
#
|
||||
# Document-specific variables
|
||||
#
|
||||
# DOC This should be set to the name of the HTML
|
||||
# marked-up file, without the .sgml 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:
|
||||
#
|
||||
# EXTRA_CATALOGS Additional catalog files that should be used by
|
||||
# any SGML processing applications.
|
||||
#
|
||||
# Documents should use the += format to access these.
|
||||
#
|
||||
|
||||
MASTERDOC?= ${.CURDIR}/${DOC}.sgml
|
||||
|
||||
KNOWN_FORMATS= html txt tar pdb
|
||||
|
||||
CSS_SHEET?=
|
||||
|
||||
HTMLCATALOG= ${PREFIX}/share/xml/html/catalog
|
||||
|
||||
IMAGES_LIB?=
|
||||
|
||||
if exists(${PREFIX}/bin/sgmlnorm) && !defined(OPENJADE)
|
||||
NSGMLS?= ${PREFIX}/bin/nsgmls
|
||||
SGMLNORM?= ${PREFIX}/bin/sgmlnorm
|
||||
.else
|
||||
NSGMLS?= ${PREFIX}/bin/onsgmls
|
||||
SGMLNORM?= ${PREFIX}/bin/osgmlnorm
|
||||
.endif
|
||||
|
||||
PKG_CREATE?= /usr/sbin/pkg_create
|
||||
TAR?= /usr/bin/tar
|
||||
XARGS?= /usr/bin/xargs
|
||||
|
||||
HTML2PDB?= ${PREFIX}/bin/iSiloBSD
|
||||
HTML2PDBOPTS?= -y -d0 -Idef ${HTML2PDBFLAGS}
|
||||
|
||||
GZIP?= -9
|
||||
GZIP_CMD?= gzip -qf ${GZIP}
|
||||
BZIP2?= -9
|
||||
BZIP2_CMD?= bzip2 -qf ${BZIP2}
|
||||
ZIP?= -9
|
||||
ZIP_CMD?= ${PREFIX}/bin/zip -j ${ZIP}
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
.if ${.OBJDIR} != ${.CURDIR}
|
||||
LOCAL_CSS_SHEET= ${.OBJDIR}/${CSS_SHEET:T}
|
||||
CLEANFILES+= ${LOCAL_CSS_SHEET}
|
||||
.else
|
||||
LOCAL_CSS_SHEET= ${CSS_SHEET:T}
|
||||
.endif
|
||||
|
||||
.for _curformat in ${FORMATS}
|
||||
_cf=${_curformat}
|
||||
|
||||
# Create a 'bogus' doc for any format we support or not. This is so
|
||||
# that we can fake up a target for it later on, and this target can print
|
||||
# the warning message about the unsupported format.
|
||||
_docs+= ${DOC}.${_curformat}
|
||||
CLEANFILES+= ${DOC}.${_curformat}
|
||||
CLEANFILES+= PLIST.${_curformat}
|
||||
|
||||
.if ${_cf} == "txt"
|
||||
.if ${LOCAL_CSS_SHEET} != ${CSS_SHEET}
|
||||
CLEANFILES+= ${LOCAL_CSS_SHEET}
|
||||
.endif
|
||||
|
||||
.elif ${_cf} == "txt"
|
||||
CLEANFILES+= ${DOC}.html
|
||||
|
||||
.elif ${_cf} == "pdb"
|
||||
_docs+= ${.CURDIR:T}.pdb
|
||||
CLEANFILES+= ${.CURDIR:T}.pdb
|
||||
|
||||
.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}
|
||||
|
||||
.if ${_cf} != "html-split"
|
||||
_curinst+= install-${_curformat}.${_curcomp}
|
||||
_docs+= ${DOC}.${_curformat}.${_curcomp}
|
||||
CLEANFILES+= ${DOC}.${_curformat}.${_curcomp}
|
||||
|
||||
.if ${_cf} == "pdb"
|
||||
_docs+= ${.CURDIR:T}.${_curformat}.${_curcomp}
|
||||
CLEANFILES+= ${.CURDIR:T}.${_curformat}.${_curcomp}
|
||||
|
||||
.endif
|
||||
.endif
|
||||
.endfor
|
||||
.endfor
|
||||
.endif
|
||||
|
||||
.MAIN: all
|
||||
|
||||
all: ${_docs}
|
||||
|
||||
${DOC}.html: ${SRCS} ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG} ${LOCAL_CSS_SHEET}
|
||||
${SGMLNORM} -c ${HTMLCATALOG} ${SRCS:S|^|${.CURDIR}/|} > ${.TARGET}
|
||||
|
||||
${DOC}.txt: ${DOC}.html
|
||||
${HTML2TXT} ${HTML2TXTOPTS} ${.ALLSRC} > ${.TARGET}
|
||||
|
||||
${DOC}.pdb: ${DOC}.html ${LOCAL_IMAGES_LIB} ${LOCAL_IMAGES_PNG}
|
||||
${HTML2PDB} ${HTML2PDBOPTS} ${DOC}.html ${.TARGET}
|
||||
|
||||
${.CURDIR:T}.pdb: ${DOC}.pdb
|
||||
${LN} -f ${.ALLSRC} ${.TARGET}
|
||||
|
||||
.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
|
||||
|
||||
${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
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
#
|
||||
# Validation targets
|
||||
#
|
||||
|
||||
#
|
||||
# Lets you quickly check that the document conforms to the DTD without
|
||||
# having to convert it to any other formats
|
||||
#
|
||||
|
||||
lint validate:
|
||||
${XMLLINT} --catalogs --nonet --noout --noent --valid ${MASTERDOC}
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
#
|
||||
# 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_CMD} < ${.ALLSRC} > ${.TARGET}
|
||||
|
||||
_PROG_COMPRESS_bz2: .USE
|
||||
${BZIP2_CMD} < ${.ALLSRC} > ${.TARGET}
|
||||
|
||||
_PROG_COMPRESS_zip: .USE
|
||||
${ZIP_CMD} ${.TARGET} ${.ALLSRC}
|
||||
|
||||
#
|
||||
# Build a list of targets for each compression scheme and output format.
|
||||
# Don't compress the html-split output format.
|
||||
#
|
||||
.for _curformat in ${KNOWN_FORMATS}
|
||||
_cf=${_curformat}
|
||||
.for _curcompress in ${KNOWN_COMPRESS}
|
||||
${DOC}.${_cf}.${_curcompress}: ${DOC}.${_cf} _PROG_COMPRESS_${_curcompress}
|
||||
.endfor
|
||||
.endfor
|
||||
|
||||
#
|
||||
# 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
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
#
|
||||
# Install targets
|
||||
#
|
||||
# Build install-* targets, one per allowed value in FORMATS.
|
||||
#
|
||||
# "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})
|
||||
install-${_curformat}: ${DOC}.${_curformat}
|
||||
@[ -d ${DESTDIR} ] || ${MKDIR} -p ${DESTDIR}
|
||||
${INSTALL_DOCS} ${.ALLSRC} ${DESTDIR}
|
||||
.if !empty(CSS_SHEET)
|
||||
${INSTALL_DOCS} ${CSS_SHEET} ${DESTDIR}
|
||||
.endif
|
||||
.for _curimage in ${IMAGES_LIB}
|
||||
@[ -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}
|
||||
.endfor
|
||||
# Install the images. First, loop over all the image names that contain a
|
||||
# directory separator, make the subdirectories, and install. Then loop over
|
||||
# the ones that don't contain a directory separator, and install them in the
|
||||
# top level.
|
||||
.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:N*/*}
|
||||
${INSTALL_DOCS} ${.CURDIR}/${_curimage} ${DESTDIR}
|
||||
.endfor
|
||||
.if ${_cf} == "pdb"
|
||||
${LN} -f ${DESTDIR}/${.ALLSRC} ${DESTDIR}/${.CURDIR:T}.${_curformat}
|
||||
.endif
|
||||
|
||||
.for _compressext in ${KNOWN_COMPRESS}
|
||||
install-${_cf}.${_compressext}: ${DOC}.${_cf}.${_compressext}
|
||||
@[ -d ${DESTDIR} ] || ${MKDIR} -p ${DESTDIR}
|
||||
${INSTALL_DOCS} ${.ALLSRC} ${DESTDIR}
|
||||
.endfor
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
#
|
||||
# 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
|
||||
|
||||
|
||||
# ------------------------------------------------------------------------
|
||||
#
|
||||
# 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_CMD} ${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}
|
||||
PLIST.${_curformat}: ${DOC}.${_curformat}
|
||||
@${ECHO_CMD} ${DOC}.${_curformat} > PLIST.${_curformat}
|
||||
.if ${_cf} == "html" && \
|
||||
(!empty(LOCAL_IMAGES_LIB) || !empty(IMAGES_PNG) || !empty(CSS_SHEET))
|
||||
@${ECHO_CMD} ${LOCAL_IMAGES_LIB} ${IMAGES_PNG} ${CSS_SHEET} | \
|
||||
${XARGS} -n1 >> PLIST.${_curformat}
|
||||
.elif ${_cf} == "pdb"
|
||||
@${ECHO_CMD} ${.CURDIR:T}.${_curformat} >> PLIST.${_curformat}
|
||||
.endif
|
||||
|
||||
${PACKAGES}/${.CURDIR:T}.${LANGCODE}.${_curformat}.tgz: PLIST.${_curformat}
|
||||
@${PKG_CREATE} -v -f PLIST.${_curformat} -p ${DESTDIR} -s ${.OBJDIR} \
|
||||
-c -"FDP ${.CURDIR:T} ${_curformat} package" \
|
||||
-d -"FDP ${.CURDIR:T} ${_curformat} package" ${.TARGET}
|
||||
|
||||
package-${_curformat}: ${PACKAGES}/${.CURDIR:T}.${LANGCODE}.${_curformat}.tgz
|
||||
.endfor
|
||||
|
||||
#
|
||||
# Build install- targets for any formats we've missed that we don't handle.
|
||||
#
|
||||
|
||||
.for _curformat in ${ALL_FORMATS}
|
||||
.if !target(package-${_curformat})
|
||||
package-${_curformat}:
|
||||
@${ECHO_CMD} \"${_curformat}\" is not a valid output format for this document.
|
||||
.endif
|
||||
.endfor
|
||||
|
||||
.if ${LOCAL_CSS_SHEET} != ${CSS_SHEET}
|
||||
${LOCAL_CSS_SHEET}: ${CSS_SHEET}
|
||||
${CP} -p ${.ALLSRC} ${.TARGET}
|
||||
.endif
|
|
@ -109,42 +109,6 @@ EPS2PNM_RES?= 100
|
|||
# shared image directory.
|
||||
IMAGES_PDF= ${IMAGES_GEN_PDF} ${_IMAGES_PNG}
|
||||
|
||||
SCR2PNG?= ${PREFIX}/bin/scr2png
|
||||
SCR2PNGOPTS?= ${SCR2PNGFLAGS}
|
||||
SCR2TXT?= ${PREFIX}/bin/scr2txt
|
||||
SCR2TXTOPTS?= -l ${SCR2TXTFLAGS}
|
||||
SED?= /usr/bin/sed
|
||||
EPS2PNM?= ${PREFIX}/bin/gs
|
||||
EPS2PNMOPTS?= -q -dBATCH -dGraphicsAlphaBits=4 -dTextAlphaBits=4 \
|
||||
-dEPSCrop -r${EPS2PNM_RES}x${EPS2PNM_RES} \
|
||||
-dNOPAUSE -dSAFER -sDEVICE=pnm -sOutputFile=-
|
||||
#
|
||||
# epsgeom is a perl script for 1) extracting geometry information
|
||||
# from a .eps file and 2) arrange it for ghostscript's pnm driver.
|
||||
#
|
||||
EPSGEOM?= ${PERL} ${DOC_PREFIX}/share/misc/epsgeom
|
||||
EPSGEOMOPTS?= ${EPS2PNM_RES} ${EPS2PNM_RES}
|
||||
PNMTOPNG?= ${PREFIX}/bin/pnmtopng
|
||||
PNMTOPNGOPTS?= ${PNGTOPNGFLAGS}
|
||||
PNGTOPNM?= ${PREFIX}/bin/pngtopnm
|
||||
PNGTOPNMOPTS?= ${PNGTOPNMFLAGS}
|
||||
PPMTOPGM?= ${PREFIX}/bin/ppmtopgm
|
||||
PPMTOPGMOPTS?= ${PPMTOPGMFLAGS}
|
||||
PNMTOPS?= ${PREFIX}/bin/pnmtops
|
||||
PNMTOPSOPTS?= -noturn ${PNMTOPSFLAGS}
|
||||
EPSTOPDF?= ${PREFIX}/bin/epstopdf
|
||||
EPSTOPDFOPTS?= ${EPSTOPDFFLAGS}
|
||||
#
|
||||
PIC2PS?= ${GROFF} -p -S -Wall -mtty-char -man
|
||||
#
|
||||
PS2EPS?= ${PREFIX}/bin/gs
|
||||
PS2EPSOPTS?= -q -dNOPAUSE -dSAFER -dDELAYSAFER \
|
||||
-sPAPERSIZE=letter -r72 -sDEVICE=bit \
|
||||
-sOutputFile=/dev/null ${PS2EPSFLAGS} ps2epsi.ps
|
||||
PS2BBOX?= ${PREFIX}/bin/gs
|
||||
PS2BBOXOPTS?= -q -dNOPAUSE -dBATCH -dSAFER -dDELAYSAFER \
|
||||
-sPAPERSIZE=letter -r72 -sDEVICE=bbox \
|
||||
-sOutputFile=/dev/null ${PS2BBOXFLAGS}
|
||||
#
|
||||
# Use suffix rules to convert .scr files to other formats
|
||||
.SUFFIXES: .scr .pic .png .ps .eps .txt
|
||||
|
|
|
@ -66,57 +66,13 @@ MAINTAINER?= doc@FreeBSD.org
|
|||
# formats
|
||||
ALL_FORMATS= html html.tar html-split html-split.tar txt rtf ps pdf tex dvi tar pdb
|
||||
|
||||
.include "doc.commands.mk"
|
||||
|
||||
# User-modifiable
|
||||
LOCALBASE?= /usr/local
|
||||
PREFIX?= ${LOCALBASE}
|
||||
PRI_LANG?= en_US.ISO8859-1
|
||||
|
||||
CP?= /bin/cp
|
||||
CAT?= /bin/cat
|
||||
ECHO_CMD?= echo
|
||||
LN?= /bin/ln
|
||||
MKDIR?= /bin/mkdir
|
||||
RM?= /bin/rm
|
||||
MV?= /bin/mv
|
||||
HTML2TXT?= ${PREFIX}/bin/links
|
||||
HTML2TXTOPTS?= -dump -width 72 ${HTML2TXTFLAGS}
|
||||
ISPELL?= ispell
|
||||
ISPELLOPTS?= -l -p /usr/share/dict/freebsd ${ISPELLFLAGS}
|
||||
.if exists(/usr/bin/perl)
|
||||
PERL?= /usr/bin/perl
|
||||
.elif exists(/usr/local/bin/perl)
|
||||
PERL?= /usr/local/bin/perl
|
||||
.else
|
||||
PERL?= perl
|
||||
.endif
|
||||
REALPATH?= /bin/realpath
|
||||
SETENV?= /usr/bin/env
|
||||
XSLTPROC?= ${PREFIX}/bin/xsltproc
|
||||
XMLLINT?= ${PREFIX}/bin/xmllint
|
||||
#
|
||||
# In teTeX 3.0 and later, pdfetex(1) is used as the default TeX
|
||||
# engine for JadeTeX and tex(1) cannot be used as ${TEX_CMD} anymore
|
||||
# due to incompatibility of the format file. Since the teTeX 3.0
|
||||
# distribution has "${PREFIX}/share/texmf-dist/LICENSE.texmf,"
|
||||
# it is checked here to determine which TeX engine should be used.
|
||||
.if exists(${PREFIX}/share/texmf-dist/LICENSE.texmf)
|
||||
TEX_CMD?= ${PREFIX}/bin/etex
|
||||
PDFTEX_CMD?= ${PREFIX}/bin/pdfetex
|
||||
.else
|
||||
TEX_CMD?= ${PREFIX}/bin/tex
|
||||
PDFTEX_CMD?= ${PREFIX}/bin/pdftex
|
||||
.endif
|
||||
LATEX_CMD?= ${PREFIX}/bin/latex
|
||||
JADETEX_CMD?= ${TEX_CMD} "&jadetex"
|
||||
JADETEX_PREPROCESS?= /bin/cat
|
||||
PDFJADETEX_CMD?=${PDFTEX_CMD} "&pdfjadetex"
|
||||
PDFJADETEX_PREPROCESS?= /bin/cat
|
||||
PS2PDF?= ${PREFIX}/bin/ps2pdf
|
||||
FOP_CMD?= ${PREFIX}/share/fop/fop.sh
|
||||
XEP_CMD?= sh ${HOME}/XEP/xep.sh
|
||||
JAVA_CMD?= ${PREFIX}/bin/javavm
|
||||
SAXON_CMD?= ${JAVA_CMD} -jar ${PREFIX}/share/java/classes/saxon.jar
|
||||
|
||||
# Image processing (contains code used by the doc.<format>.mk files, so must
|
||||
# be listed first).
|
||||
.include "doc.images.mk"
|
||||
|
@ -144,9 +100,6 @@ DOC_LOCAL_MK= ${DOC_PREFIX}/${LANGCODE}/share/mk/doc.local.mk
|
|||
.if ${DOCFORMAT} == "slides"
|
||||
.include "doc.slides.mk"
|
||||
.endif
|
||||
.if ${DOCFORMAT} == "html"
|
||||
.include "doc.html.mk"
|
||||
.endif
|
||||
.endif
|
||||
|
||||
# Subdirectory glue.
|
||||
|
|
|
@ -38,52 +38,12 @@ CGIGRP?= www
|
|||
.endif
|
||||
CGIMODE?= 775
|
||||
|
||||
BUNZIP2?= /usr/bin/bunzip2
|
||||
CP?= /bin/cp
|
||||
CVS?= /usr/bin/cvs
|
||||
ECHO_CMD?= echo
|
||||
FETCH?= /usr/bin/fetch
|
||||
FIND?= /usr/bin/find
|
||||
SETENV?= /usr/bin/env
|
||||
LN?= /bin/ln
|
||||
MKDIR?= /bin/mkdir
|
||||
MV?= /bin/mv
|
||||
PERL?= /usr/bin/perl5
|
||||
.if !exists(${PERL}) && exists(/usr/local/bin/perl5)
|
||||
PERL= /usr/local/bin/perl5
|
||||
.endif
|
||||
RM?= /bin/rm
|
||||
SED?= /usr/bin/sed
|
||||
SH?= /bin/sh
|
||||
SORT?= /usr/bin/sort
|
||||
TOUCH?= /usr/bin/touch
|
||||
TRUE?= /usr/bin/true
|
||||
|
||||
LOCALBASE?= /usr/local
|
||||
PREFIX?= ${LOCALBASE}
|
||||
|
||||
.if exists(${PREFIX}/bin/sgmlnorm) && !defined(OPENJADE)
|
||||
SGMLNORM?= ${PREFIX}/bin/sgmlnorm
|
||||
.else
|
||||
SGMLNORM?= ${PREFIX}/bin/osgmlnorm
|
||||
.endif
|
||||
SGMLNORMOPTS?= -d ${SGMLNORMFLAGS} ${CATALOG:S,^,-c ,} -D ${.CURDIR}
|
||||
|
||||
XSLTPROC?= ${PREFIX}/bin/xsltproc
|
||||
XSLTPROCOPTS?= ${XSLTPROCFLAGS}
|
||||
|
||||
XMLLINT?= ${PREFIX}/bin/xmllint
|
||||
XMLLINTOPTS?= ${XMLLINTFLAGS}
|
||||
|
||||
HTML2TXT?= ${PREFIX}/bin/w3m
|
||||
HTML2TXTOPTS?= -dump ${HTML2TXTFLAGS}
|
||||
ISPELL?= ispell
|
||||
ISPELLOPTS?= -l -p /usr/share/dict/freebsd ${ISPELLFLAGS}
|
||||
|
||||
.if defined(WWWFREEBSDORG)
|
||||
SGMLNORMOPTS+= -i html.header.script.google
|
||||
.endif
|
||||
|
||||
WEBCHECK?= ${PREFIX}/bin/webcheck
|
||||
WEBCHECKOPTS?= -ab ${WEBCHECKFLAGS}
|
||||
WEBCHECKDIR?= /webcheck
|
||||
|
|
Loading…
Reference in a new issue