2011-01-26 09:35:08 +00:00
|
|
|
IMAGE_FILES = images/asciidoc.png \
|
2012-08-12 21:39:31 +00:00
|
|
|
images/hostedby.png \
|
2011-01-26 09:35:08 +00:00
|
|
|
images/nut_layering.png \
|
2012-01-24 10:22:33 +00:00
|
|
|
images/nut-logo.png \
|
2011-01-26 09:35:08 +00:00
|
|
|
images/note.png \
|
|
|
|
images/warning.png \
|
|
|
|
images/blue-arrow.png \
|
|
|
|
images/simple.png \
|
|
|
|
images/advanced.png \
|
|
|
|
images/bigbox.png \
|
|
|
|
images/bizarre.png \
|
|
|
|
images/old-cgi.png
|
|
|
|
|
2012-01-24 10:22:33 +00:00
|
|
|
# Only track here the local deps
|
|
|
|
SHARED_DEPS = nut-names.txt asciidoc.conf
|
|
|
|
|
2011-01-26 09:35:08 +00:00
|
|
|
USER_MANUAL_DEPS = acknowledgements.txt cables.txt config-notes.txt \
|
|
|
|
configure.txt download.txt documentation.txt features.txt history.txt \
|
2014-04-22 18:39:47 +00:00
|
|
|
outlets.txt scheduling.txt security.txt support.txt user-manual.txt
|
2011-01-26 09:35:08 +00:00
|
|
|
|
|
|
|
DEVELOPER_GUIDE_DEPS = contact-closure.txt design.txt developers.txt \
|
2013-11-24 15:00:12 +00:00
|
|
|
developer-guide.txt hid-subdrivers.txt macros.txt new-clients.txt \
|
|
|
|
new-drivers.txt net-protocol.txt nutdrv_qx-subdrivers.txt \
|
|
|
|
snmp-subdrivers.txt sock-protocol.txt
|
2011-01-26 09:35:08 +00:00
|
|
|
|
|
|
|
CABLES_DEPS = cables/apc-rs500-serial.txt \
|
2010-03-25 23:20:59 +00:00
|
|
|
cables/apc.txt cables/ge-imv-victron.txt cables/imv.txt \
|
|
|
|
cables/mgeups.txt cables/powerware.txt cables/repotec.txt \
|
|
|
|
cables/sms.txt
|
2011-01-26 09:35:08 +00:00
|
|
|
|
|
|
|
CABLES_IMAGES = images/cables/73-0724.png images/cables/940-0024C.jpg \
|
|
|
|
images/cables/belkin-f6cx-rkm-xu-cable.jpg images/cables/Lansafecable.jpg \
|
|
|
|
images/cables/mac-940-0024C.png images/cables/mge-66049.png \
|
|
|
|
images/cables/mge-db9-rj12.jpg images/cables/mge-db9-rj45.jpg \
|
2015-04-30 13:53:36 +00:00
|
|
|
images/cables/mge-usb-rj45.jpg \
|
2011-01-26 09:35:08 +00:00
|
|
|
images/cables/SOLA-330.png
|
|
|
|
|
2013-11-24 15:00:12 +00:00
|
|
|
ALL_TXT_SRC = nut-names.txt $(USER_MANUAL_DEPS) $(DEVELOPER_GUIDE_DEPS) \
|
2014-04-22 18:39:47 +00:00
|
|
|
$(CABLES_DEPS) FAQ.txt nut-qa.txt packager-guide.txt snmp.txt
|
2013-11-24 15:00:12 +00:00
|
|
|
|
|
|
|
NUT_SPELL_DICT = nut.dict
|
|
|
|
EXTRA_DIST = $(ALL_TXT_SRC) $(SHARED_DEPS) $(IMAGE_FILES) \
|
2015-04-30 13:53:36 +00:00
|
|
|
$(CABLES_IMAGES) $(NUT_SPELL_DICT) \
|
2014-04-22 18:39:47 +00:00
|
|
|
common.xsl xhtml.xsl chunked.xsl
|
2011-01-26 09:35:08 +00:00
|
|
|
|
|
|
|
ASCIIDOC_HTML_SINGLE = user-manual.html \
|
|
|
|
developer-guide.html \
|
|
|
|
packager-guide.html \
|
|
|
|
FAQ.html
|
|
|
|
|
|
|
|
ASCIIDOC_HTML_CHUNKED = user-manual.chunked \
|
|
|
|
developer-guide.chunked \
|
|
|
|
packager-guide.chunked \
|
|
|
|
FAQ.html
|
|
|
|
|
|
|
|
ASCIIDOC_PDF = user-manual.pdf \
|
|
|
|
developer-guide.pdf \
|
|
|
|
packager-guide.pdf \
|
2014-04-22 18:39:47 +00:00
|
|
|
cables.pdf \
|
2011-01-26 09:35:08 +00:00
|
|
|
FAQ.pdf
|
|
|
|
|
2014-04-22 18:39:47 +00:00
|
|
|
SUBDIRS = man
|
2011-01-26 09:35:08 +00:00
|
|
|
SUFFIXES = .txt .html .pdf
|
|
|
|
|
|
|
|
all: doc
|
|
|
|
|
|
|
|
doc: @DOC_BUILD_LIST@
|
|
|
|
|
|
|
|
pdf: $(ASCIIDOC_PDF)
|
|
|
|
# also build the HTML manpages with these targets
|
|
|
|
html-single: $(ASCIIDOC_HTML_SINGLE)
|
|
|
|
html-chunked: $(ASCIIDOC_HTML_CHUNKED)
|
|
|
|
|
|
|
|
clean-local:
|
2013-11-24 15:00:12 +00:00
|
|
|
rm -rf *.pdf *.html *.chunked docbook-xsl.css *.bak
|
2011-01-26 09:35:08 +00:00
|
|
|
|
|
|
|
### TODO: automatic dependency generation
|
2012-01-24 10:22:33 +00:00
|
|
|
# Add other directory deps (not for local EXTRA_DIST) and generated contents
|
|
|
|
FULL_USER_MANUAL_DEPS = $(USER_MANUAL_DEPS) $(SHARED_DEPS) ../README \
|
2014-04-22 18:39:47 +00:00
|
|
|
../INSTALL.nut ../UPGRADING ../TODO ../scripts/ufw/README
|
2012-01-24 10:22:33 +00:00
|
|
|
FULL_DEVELOPER_GUIDE_DEPS = $(DEVELOPER_GUIDE_DEPS) $(SHARED_DEPS) \
|
|
|
|
../scripts/augeas/README ../TODO ../lib/README \
|
|
|
|
../tools/nut-scanner/README
|
2011-01-26 09:35:08 +00:00
|
|
|
|
|
|
|
user-manual.html user-manual.chunked user-manual.pdf: $(FULL_USER_MANUAL_DEPS)
|
|
|
|
developer-guide.html developer-guide.chunked developer-guide.pdf: $(FULL_DEVELOPER_GUIDE_DEPS)
|
|
|
|
packager-guide.html packager-guide.chunked packager-guide.pdf: packager-guide.txt asciidoc.conf
|
|
|
|
|
|
|
|
# Note: without the "-v", asciidoc (circa 8.6.2) sometimes hangs when
|
|
|
|
# generating the chunked HTML. In this case, export the environment
|
|
|
|
# variable ASCIIDOC_VERBOSE to "-v", ie:
|
|
|
|
# $ ASCIIDOC_VERBOSE=-v make
|
|
|
|
A2X_COMMON_OPTS = $(ASCIIDOC_VERBOSE) --attribute icons \
|
2015-04-30 13:53:36 +00:00
|
|
|
--xsltproc-opts "--nonet" \
|
|
|
|
--xsltproc-opts "--stringparam nut.localdate \"`TZ=UTC date +%Y-%m-%d`\"" \
|
|
|
|
--xsltproc-opts "--stringparam nut.localtime \"`TZ=UTC date +%H:%M:%S`\"" \
|
|
|
|
--xsltproc-opts "--stringparam nut.nutversion \"@PACKAGE_VERSION@\"" \
|
2011-01-26 09:35:08 +00:00
|
|
|
--attribute iconsdir=$(srcdir)/images \
|
|
|
|
--attribute=badges \
|
|
|
|
--attribute=external_title \
|
2012-01-24 10:22:33 +00:00
|
|
|
--attribute tree_version=@TREE_VERSION@ \
|
2011-01-26 09:35:08 +00:00
|
|
|
-a toc -a numbered --destination-dir=.
|
|
|
|
|
2014-04-22 18:39:47 +00:00
|
|
|
.txt.html: common.xsl xhtml.xsl
|
|
|
|
$(A2X) $(A2X_COMMON_OPTS) --attribute=xhtml11_format --format=xhtml --xsl-file=$(srcdir)/xhtml.xsl $<
|
2011-01-26 09:35:08 +00:00
|
|
|
|
2014-04-22 18:39:47 +00:00
|
|
|
.txt.chunked: common.xsl chunked.xsl
|
|
|
|
$(A2X) $(A2X_COMMON_OPTS) --attribute=chunked_format --format=chunked --xsl-file=$(srcdir)/chunked.xsl $<
|
2011-01-26 09:35:08 +00:00
|
|
|
|
|
|
|
.txt.pdf: docinfo.xml
|
|
|
|
$(A2X) $(A2X_COMMON_OPTS) --attribute=pdf_format --format=pdf -a docinfo1 $<
|
|
|
|
|
2013-11-24 15:00:12 +00:00
|
|
|
if HAVE_ASPELL
|
|
|
|
# FIXME: also check ../{NEWS,README,UPGRADING}+other dirs
|
|
|
|
# Non-interactively spell check all documentation source files.
|
|
|
|
# This is useful for Buildbot and automated QA processing
|
|
|
|
# FIXME: how to present output (std{out,err}, single file or per target)?
|
|
|
|
spellcheck:
|
|
|
|
@for docsrc in $(ALL_TXT_SRC); do \
|
|
|
|
echo "Spell checking on $$docsrc"; \
|
|
|
|
LANG=C $(ASPELL) -a -t -p $(NUT_SPELL_DICT) < $$docsrc | grep [^*]; \
|
|
|
|
done
|
|
|
|
# Interactively spell check all documentation source files
|
|
|
|
spellcheck-interactive:
|
|
|
|
@for docsrc in $(ALL_TXT_SRC); do\
|
|
|
|
echo "Spell checking on $$docsrc"; \
|
|
|
|
LANG=C $(ASPELL) check -p $(NUT_SPELL_DICT) $$docsrc; \
|
|
|
|
done
|
|
|
|
else !HAVE_ASPELL
|
|
|
|
spellcheck:
|
|
|
|
@echo "Documentation spell check not available since 'aspell' was not found."
|
|
|
|
spellcheck-interactive:
|
|
|
|
@echo "Documentation spell check not available since 'aspell' was not found."
|
|
|
|
endif !HAVE_ASPELL
|
|
|
|
|
2014-04-22 18:39:47 +00:00
|
|
|
.PHONY: html html-single pdf
|