Replace 'connexion' with 'connection' in English contexts
[networkupstools/kirr.git] / docs / Makefile.am
blob0149f52e644b8005b0024888ab2a38e5b4202c16
1 IMAGE_FILES = images/asciidoc.png \
2         images/hostedby.png \
3         images/nut_layering.png \
4         images/nut-logo.png \
5         images/note.png \
6         images/warning.png \
7         images/blue-arrow.png \
8         images/simple.png \
9         images/advanced.png \
10         images/bigbox.png \
11         images/bizarre.png \
12         images/old-cgi.png
14 # Only track here the local deps
15 SHARED_DEPS = nut-names.txt asciidoc.conf
17 USER_MANUAL_DEPS = acknowledgements.txt cables.txt config-notes.txt     \
18  configure.txt download.txt documentation.txt features.txt history.txt  \
19  outlets.txt scheduling.txt security.txt support.txt user-manual.txt \
20  stable-hcl.txt
22 DEVELOPER_GUIDE_DEPS = contact-closure.txt design.txt developers.txt    \
23  developer-guide.txt hid-subdrivers.txt macros.txt new-clients.txt      \
24  new-drivers.txt net-protocol.txt nutdrv_qx-subdrivers.txt      \
25  snmp-subdrivers.txt sock-protocol.txt
27 CABLES_DEPS = cables/apc-rs500-serial.txt       \
28  cables/apc.txt cables/ge-imv-victron.txt cables/imv.txt                \
29  cables/mgeups.txt cables/powerware.txt cables/repotec.txt              \
30  cables/sms.txt
32 CABLES_IMAGES = images/cables/73-0724.png images/cables/940-0024C.jpg \
33  images/cables/belkin-f6cx-rkm-xu-cable.jpg images/cables/Lansafecable.jpg \
34  images/cables/mac-940-0024C.png images/cables/mge-66049.png \
35  images/cables/mge-db9-rj12.jpg images/cables/mge-db9-rj45.jpg \
36  images/cables/SOLA-330.png
38 ALL_TXT_SRC = nut-names.txt $(USER_MANUAL_DEPS) $(DEVELOPER_GUIDE_DEPS) \
39  $(CABLES_DEPS) FAQ.txt nut-hal.txt nut-qa.txt packager-guide.txt snmp.txt
41 NUT_SPELL_DICT = nut.dict
42 EXTRA_DIST = $(ALL_TXT_SRC) $(SHARED_DEPS) $(IMAGE_FILES) \
43  $(CABLES_IMAGES) docinfo.xml $(NUT_SPELL_DICT)
45 ASCIIDOC_HTML_SINGLE = user-manual.html \
46         developer-guide.html \
47         packager-guide.html \
48         FAQ.html
50 ASCIIDOC_HTML_CHUNKED = user-manual.chunked \
51         developer-guide.chunked \
52         packager-guide.chunked \
53         FAQ.html
55 ASCIIDOC_PDF = user-manual.pdf \
56         developer-guide.pdf \
57         packager-guide.pdf \
58         FAQ.pdf
60 # Force build in ./ and man/ before website 
61 SUBDIRS = . man website
62 SUFFIXES = .txt .html .pdf
64 all: doc
66 doc: @DOC_BUILD_LIST@
68 pdf: $(ASCIIDOC_PDF)
69 # also build the HTML manpages with these targets
70 html-single: $(ASCIIDOC_HTML_SINGLE)
71 html-chunked: $(ASCIIDOC_HTML_CHUNKED)
73 if HAVE_ASCIIDOC
74 website: html-chunked pdf
75 else !HAVE_ASCIIDOC
76 website:
77         @echo "Not building website documentation since 'asciidoc' was not found."
78 endif !HAVE_ASCIIDOC
80 clean-local:
81         rm -rf *.pdf *.html *.chunked docbook-xsl.css *.bak
83 # Static HCL is generated automatically
84 # This is more of a harness, since this file should have already been
85 # generated, due to the top level Makefile SUBDIRS ordering (tools before docs)
86 ups-html.txt: ../data/driver.list.in
87         cd ../data && $(MAKE) $(AM_MAKEFLAGS) driver.list
88         cd ../tools && $(MAKE) $(AM_MAKEFLAGS) website
90 ### TODO: automatic dependency generation
91 # Add other directory deps (not for local EXTRA_DIST) and generated contents
92 FULL_USER_MANUAL_DEPS = $(USER_MANUAL_DEPS) $(SHARED_DEPS) ../README \
93         ../INSTALL ../UPGRADING ../TODO ../scripts/ufw/README
94 FULL_DEVELOPER_GUIDE_DEPS = $(DEVELOPER_GUIDE_DEPS) $(SHARED_DEPS) \
95         ../scripts/augeas/README ../TODO ../lib/README \
96         ../tools/nut-scanner/README
98 user-manual.html user-manual.chunked user-manual.pdf: $(FULL_USER_MANUAL_DEPS)
99 developer-guide.html developer-guide.chunked developer-guide.pdf: $(FULL_DEVELOPER_GUIDE_DEPS)
100 packager-guide.html packager-guide.chunked packager-guide.pdf: packager-guide.txt asciidoc.conf
102 # Note: without the "-v", asciidoc (circa 8.6.2) sometimes hangs when
103 # generating the chunked HTML. In this case, export the environment
104 # variable ASCIIDOC_VERBOSE to "-v", ie:
105 #   $ ASCIIDOC_VERBOSE=-v make
106 A2X_COMMON_OPTS = $(ASCIIDOC_VERBOSE) --attribute icons \
107     --attribute localdate=`TZ=UTC date +%Y-%m-%d` \
108     --attribute localtime=`TZ=UTC date +%H:%M:%S` \
109     --attribute iconsdir=$(srcdir)/images \
110     --attribute=badges \
111     --attribute=external_title \
112     --attribute tree_version=@TREE_VERSION@ \
113     -a toc -a numbered --destination-dir=.
115 .txt.html:
116         $(A2X) $(A2X_COMMON_OPTS) --attribute=xhtml11_format --format=xhtml $<
118 .txt.chunked:
119         $(A2X) $(A2X_COMMON_OPTS) --attribute=chunked_format --format=chunked $<
121 .txt.pdf: docinfo.xml
122         $(A2X) $(A2X_COMMON_OPTS) --attribute=pdf_format --format=pdf -a docinfo1 $<
124 if HAVE_ASPELL
125 # FIXME: also check ../{NEWS,README,UPGRADING}+other dirs
126 # Non-interactively spell check all documentation source files.
127 # This is useful for Buildbot and automated QA processing
128 # FIXME: how to present output (std{out,err}, single file or per target)?
129 spellcheck: 
130         @for docsrc in $(ALL_TXT_SRC); do \
131                 echo "Spell checking on $$docsrc"; \
132                 LANG=C $(ASPELL) -a -t -p $(NUT_SPELL_DICT) < $$docsrc | grep [^*]; \
133         done
134 # Interactively spell check all documentation source files
135 spellcheck-interactive: 
136         @for docsrc in $(ALL_TXT_SRC); do\
137                 echo "Spell checking on $$docsrc"; \
138                 LANG=C $(ASPELL) check -p $(NUT_SPELL_DICT) $$docsrc; \
139         done
140 else !HAVE_ASPELL
141 spellcheck:
142         @echo "Documentation spell check not available since 'aspell' was not found."
143 spellcheck-interactive:
144         @echo "Documentation spell check not available since 'aspell' was not found."
145 endif !HAVE_ASPELL
147 .PHONY: html html-single pdf website