# Copyright (C) 2004-2007, 2009, 2012, 2014-2016  Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2001, 2002  Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.

srcdir =	@srcdir@
VPATH =		@srcdir@
top_srcdir =	@top_srcdir@

@BIND9_MAKE_RULES@

MANOBJS = Bv9ARM.html notes.html

PDFOBJS = Bv9ARM.pdf notes.pdf

doc man:: ${MANOBJS} ${PDFOBJS}

clean::
	rm -f Bv9ARM.aux Bv9ARM.brf Bv9ARM.glo Bv9ARM.idx Bv9ARM.toc
	rm -f Bv9ARM.log Bv9ARM.out
	rm -f notes.aux notes.brf notes.glo notes.idx notes.toc
	rm -f notes.log notes.out

docclean manclean maintainer-clean:: clean
	rm -f *.html ${PDFOBJS}

maintainer-clean distclean::
	rm -f releaseinfo.xml
	rm -f pkgversion.xml
	rm -f noteversion.xml

# use xmllint to process include
notes.html: notes-wrapper.xml notes.xml releaseinfo.xml pkgversion.xml noteversion.xml
	expand notes-wrapper.xml | ${XMLLINT} --xinclude - | \
	${XSLTPROC} --stringparam generate.toc "" ../xsl/isc-notes-html.xsl - > notes.html

notes.pdf: notes-wrapper.xml notes.xml releaseinfo.xml pkgversion.xml noteversion.xml
	${XSLTPROC} ${top_srcdir}/doc/xsl/pre-latex.xsl notes-wrapper.xml | \
	${DBLATEX} -c notes.conf -Pdoc.layout="mainmatter" -o notes.pdf -

# use xmllint to process include
Bv9ARM.html: Bv9ARM-book.xml releaseinfo.xml pkgversion.xml noteversion.xml
	expand Bv9ARM-book.xml | ${XMLLINT} --xinclude - | \
	${XSLTPROC} --stringparam root.filename Bv9ARM \
		${top_srcdir}/doc/xsl/isc-docbook-chunk.xsl -

# use xmllint to process include
Bv9ARM-all.html: Bv9ARM-book.xml releaseinfo.xml pkgversion.xml noteversion.xml
	expand Bv9ARM-book.xml | ${XMLLINT} --xinclude - |\
	${XSLTPROC} -o Bv9ARM-all.html ../xsl/isc-docbook-html.xsl -

Bv9ARM.pdf: Bv9ARM-book.xml releaseinfo.xml pkgversion.xml noteversion.xml
	expand Bv9ARM-book.xml | \
	${XSLTPROC} ${top_srcdir}/doc/xsl/pre-latex.xsl - | \
	${DBLATEX} -c Bv9ARM.conf -o Bv9ARM.pdf -
