source: trunk/doc/guide/Makefile @ 27371

Last change on this file since 27371 was 27371, checked in by markd@…, 11 years ago

Add --nonet to the params for the new guide to try to eliminate occasional regen failures.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.8 KB
Line 
1# $Id: Makefile 27371 2007-07-31 18:52:12Z markd@macports.org $
2
3# To build MacPorts  guide files from the source docbook xml.
4# michaelm@opendarwin.org
5
6## Targets
7#
8# html  : Makes unformated, chunked html from xml
9# xhtml : Makes unformated, chunked xhtml from xml
10# tidy  : Tidies (formats, indents) xhtml and html
11# clean : Deletes html and xhtml
12# all   : html, xhtml and tidy
13
14## Details and Caveats
15#
16# Requires docbook-xsl and docbook-xml ports to have been installed (or the
17# stylesheets and dtds to have been installed elswhere, and requires the
18# libxslt port to be installed.
19
20# This Makefile assumes things have been installed using prefix, you may want
21# to override some of the variables below to match your local installation.
22
23# To use local dtd catalogs you must first create the catalog, I currently assume
24# the catalogs are in ${prefix}/etc/xml, if yours are elswhere you should alter
25# the $XML_CATALOG_FILES variable.
26
27# set XML_DEBUG_CATALOG= to see catalog debugging info
28
29SOURCEDIR?=             xml
30NEWSOURCEDIR?=          new/xml
31DOCBOOK_XSL?=           ${prefix}/share/xsl/docbook-xsl/
32HTMLDIR?=               html
33NEWHTMLDIR?=            new/html
34XHTMLDIR?=              xhtml
35STYLESHEET?=            ${DOCBOOK_XSL}/html/chunk.xsl
36XSTYLESHEET?=           ${DOCBOOK_XSL}/xhtml/chunk.xsl
37NEWSTYLESHEET?=         ${DOCBOOK_XSL}/xhtml/docbook.xsl
38XML_CATALOG_FILES?=    ${prefix}/etc/xml/catalog
39XML_DEBUG_CATALOG?=
40CSS_STYLESHEET?=        docbook.css
41RESOURCES?=             resources/
42NEWRESOURCES?=          new/resources/
43STRINGPARAMS?=          --stringparam html.stylesheet ${CSS_STYLESHEET} --stringparam chunk.section.depth 0
44NEWSTRINGPARAMS?=       --stringparam html.stylesheet ${CSS_STYLESHEET} \
45                        --stringparam section.autolabel 1 \
46                        --stringparam toc.section.depth 1 \
47                        --stringparam generate.toc "book toc" \
48                        --stringparam section.label.includes.component.label 1
49
50.PHONY : all
51.PHONY : clean
52#.PHONY : install
53.PHONY : html
54.PHONY : xhtml
55.PHONY : new
56.PHONY : check
57.PHONY : tidy
58
59check:
60        xmllint --xinclude --noout "${SOURCEDIR}/guide.xml"
61
62html:
63        mkdir -p ${HTMLDIR}
64        xsltproc --xinclude -o "${HTMLDIR}/" "${STYLESHEET}" "${SOURCEDIR}/guide.xml"
65
66xhtml: 
67        mkdir -p ${XHTMLDIR}
68        cp ${RESOURCES}${CSS_STYLESHEET} ${XHTMLDIR}
69        xsltproc --xinclude ${STRINGPARAMS} -o "${XHTMLDIR}/" "${XSTYLESHEET}" "${SOURCEDIR}/guide.xml"
70
71new:
72        mkdir -p ${NEWHTMLDIR}
73        cp ${NEWRESOURCES}${CSS_STYLESHEET} ${NEWHTMLDIR}
74        cp ${NEWRESOURCES}/images/* ${NEWHTMLDIR}
75        xsltproc --nonet --xinclude ${NEWSTRINGPARAMS} -o "${NEWHTMLDIR}/guide.html" "${NEWSTYLESHEET}" "${NEWSOURCEDIR}/guide.xml"
76
77all: html xhtml tidy
78
79tidy:
80# This target will *only* work if you have installed the www/tidy port
81# or if have tidy from http://tidy.sourceforge.net/ installed somewhere
82# in your path.
83
84        -tidy -quiet -modify -indent ${HTMLDIR}/*
85        -tidy -quiet -modify -indent -xml ${XHTMLDIR}/*
86
87clean:
88        rm -fr ${HTMLDIR} ${XHTMLDIR} ${NEWHTMLDIR}
89
90include ../../base/Mk/macports.autoconf.mk
Note: See TracBrowser for help on using the repository browser.