# we can't use suitable-host-package here because that's not available in
# the context of 'make release'
asciidoc-check-dependencies:
$(Q)if [ -z "$(shell support/dependencies/check-host-asciidoc.sh)" ]; then \
echo "You need a sufficiently recent asciidoc on your host" \
"to generate documents"; \
$(Q)if [ -z "`which w3m 2>/dev/null`" ]; then \
echo "You need w3m on your host to generate documents"; \
asciidoc-check-dependencies-pdf:
$(Q)if [ -z "`which dblatex 2>/dev/null`" ]; then \
echo "You need dblatex on your host to generate PDF documents"; \
# PDF generation is broken because of a bug in xsltproc program provided
# by libxslt <=1.1.28, which does not honor an option we need to set.
# Fortunately, this bug is already fixed upstream:
# https://gitorious.org/libxslt/libxslt/commit/5af7ad745323004984287e48b42712e7305de35c
# So, bail out when trying to build a PDF using a buggy version of the
# So, to overcome this issue and being able to build a PDF, you can
# build xsltproc from its source repository, then run:
# $ PATH=/path/to/custom-xsltproc/bin:${PATH} make manual
GENDOC_XSLTPROC_IS_BROKEN = \
$(shell xsltproc --maxvars 0 >/dev/null 2>/dev/null || echo y)
# Apply this configuration to all documents
BR_ASCIIDOC_CONF = docs/conf/asciidoc.conf
################################################################################
# ASCIIDOC_INNER -- generates the make targets needed to build a specific type of
# asciidoc documentation.
# argument 1 is the name of the document and the top-level asciidoc file must
# argument 2 is the uppercase name of the document
# argument 3 is the directory containing the document
# argument 4 is the type of document to generate (-f argument of a2x)
# argument 5 is the document type as used in the make target
# argument 6 is the output file extension for the document type
# argument 7 is the human text for the document type
# argument 8 (optional) are extra arguments for a2x
# The variable <DOCUMENT_NAME>_SOURCES defines the dependencies.
# Since this function will be called from within an $(eval ...)
# all variable references except the arguments must be $$-quoted.
################################################################################
$(1)-$(5): $$(O)/docs/$(1)/$(1).$(6)
# Single line, because splitting a foreach is not easy...
asciidoc-check-dependencies-$(5):
$(1)-check-dependencies-$(5): asciidoc-check-dependencies-$(5)