diff --git a/share/mk/doc.project.mk b/share/mk/doc.project.mk index 1640cea5ae..b76639ff48 100644 --- a/share/mk/doc.project.mk +++ b/share/mk/doc.project.mk @@ -1,132 +1,134 @@ # # $FreeBSD$ # # This include file is the FreeBSD Documentation Project # co-ordination make file. # # This file includes the other makefiles, which contain enough # knowledge to perform their duties without the system make files. # # ------------------------------------------------------------------------ # # Document-specific variables: # # DOC This _must_ be set if there is a document to # build. It should be without prefix. # # DOCFORMAT Format of the document. Defaults to docbook. # docbook is also the only option currently. # # MAINTAINER This denotes who is responsible for maintaining # this section of the project. If unset, set to # doc@FreeBSD.org # # ------------------------------------------------------------------------ # # User-modifiable variables: # # PREFIX Standard path to document-building applications # installed to serve the documentation build # process, usually by installing the docproj port # or package. Default is ${LOCALBASE} or /usr/local # # NOINCLUDEMK Whether to include the standard BSD make files, # or just to emulate them poorly. Set this if you # aren't on FreeBSD, or a compatible sibling. By # default is not set. # # ------------------------------------------------------------------------ # # Make files included: # # doc.install.mk Installation specific information, including # ownership and permissions. # # doc.subdir.mk Subdirectory related configuration, including # handling "obj" builds. # # doc.common.mk targets and variables commonly used in doc/ and # www/ tree. # # DOCFORMAT-specific make files, like: # # doc.docbook.mk Building and installing docbook documentation. # Currently the only method. # # Document-specific defaults DOCFORMAT?= docbook MAINTAINER?= doc@FreeBSD.org # Master list of known target formats. The doc..mk files implement # the code to convert from their source format to one or more of these target # formats ALL_FORMATS= html html.tar html-split html-split.tar txt rtf ps pdf tex dvi tar pdb # 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 ${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 TIDY?= ${PREFIX}/bin/tidy TEX_CMD?= ${PREFIX}/bin/tex LATEX_CMD?= ${PREFIX}/bin/latex PDFTEX_CMD?= ${PREFIX}/bin/pdftex JADETEX_CMD?= ${TEX_CMD} "&jadetex" PDFJADETEX_CMD?=${PDFTEX_CMD} "&pdfjadetex" +FOP_CMD?= ${PREFIX}/share/fop/fop.sh +XEP_CMD?= sh ${HOME}/XEP/xep.sh # Image processing (contains code used by the doc..mk files, so must # be listed first). .include "doc.images.mk" # targets and variables commonly used in doc/ and www/ tree. .include "doc.common.mk" DOC_LOCAL_MK= ${DOC_PREFIX}/${LANGCODE}/share/mk/doc.local.mk .if exists(${DOC_LOCAL_MK}) .include "${DOC_LOCAL_MK}" .endif # Ownership information. .include "doc.install.mk" # Format-specific configuration .if defined(DOC) .if ${DOCFORMAT} == "docbook" .include "doc.docbook.mk" .endif .if ${DOCFORMAT} == "slides" .include "doc.slides.mk" .endif .if ${DOCFORMAT} == "html" .include "doc.html.mk" .endif .endif # Subdirectory glue. .include "doc.subdir.mk" diff --git a/share/mk/doc.slides.mk b/share/mk/doc.slides.mk index 54bdfd7b11..38ec06e2e5 100644 --- a/share/mk/doc.slides.mk +++ b/share/mk/doc.slides.mk @@ -1,63 +1,76 @@ # # $FreeBSD$ # # This include file handles building and installing of # DocBook Slides in the FreeBSD Documentation Project. # # Documentation using DOCFORMAT=slides is expected to be marked up # according to the DocBook slides DTD. # # PDF and HTML output formats are currently supported. # # ------------------------------------------------------------------------ # # Document-specific variables # # DOC This should be set to the name of the SLIDES # marked-up file, without the .xml suffix. # # It also determins the name of the output files # for print output : ${DOC}.pdf # # DOCBOOKSUFFIX The suffix of your document, defaulting to .xml # DOCBOOKSUFFIX?= xml MASTERDOC?= ${.CURDIR}/${DOC}.${DOCBOOKSUFFIX} KNOWN_FORMATS= html pdf CSS_SHEET?= SLIDES_XSLDIR= /usr/local/share/xsl/slides/xsl/ SLIDES_XSLHTML= ${SLIDES_XSLDIR}xhtml/default.xsl -SLIDES_XSLPRINT= ${SLIDES_XSLDIR}fo/plain.xsl +SLIDES_XSLPRINT?= ${SLIDES_XSLDIR}fo/plain.xsl # Loop through formats we should build. .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} .if ${_cf} == "pdf" -CLEANFILES+= ${DOC}.fo ${DOC}.aux ${DOC}.log ${DOC}.out ${DOC}.pdf texput.log +CLEANFILES+= ${DOC}.fo ${DOC}.pdf +.if ! defined (USE_FOP) && ! defined (USE_XEP) +CLEANFILES+= ${DOC}.aux ${DOC}.log ${DOC}.out texput.log +.endif .endif .endfor +XSLTPROCFLAGS?= --nonet +XSLTPROCOPTS= ${XSLTPROCFLAGS} .MAIN: all all: ${_docs} ${DOC}.html: ${SRCS} ${XSLTPROC} ${XSLTPROCOPTS} ${SLIDES_XSLHTML} ${.ALLSRC} -${DOC}.pdf: ${SRCS} +${DOC}.fo: ${SRCS} ${XSLTPROC} ${XSLTPROCOPTS} ${SLIDES_XSLPRINT} ${.ALLSRC} > ${.TARGET:S/.pdf$/.fo/} + +${DOC}.pdf: ${DOC}.fo +.if defined(USE_FOP) + ${FOP_CMD} ${.TARGET:S/.pdf$/.fo/} ${.TARGET} +.elif defined(USE_XEP) + ${XEP_CMD} ${.TARGET:S/.pdf$/.fo/} ${.TARGET} +.else ${PDFTEX_CMD} --interaction nonstopmode "&pdfxmltex" ${.TARGET:S/.pdf$/.fo/} +.endif