2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 13:37:55 +00:00
kea/doc/sphinx/Makefile.am

270 lines
8.1 KiB
Makefile
Raw Normal View History

2020-05-24 09:31:05 +02:00
EXTRA_DIST =
sphinxbuilddir = $(builddir)/_build
abs_sphinxbuilddir = $(abs_builddir)/_build
if GENERATE_DOCS
2020-05-24 09:31:05 +02:00
sphinxopts =
sphinxopts += -v
sphinxopts += -E
sphinxopts += -a
sphinxopts += -W
sphinxopts += -c "${abs_srcdir}"
2021-11-09 20:15:53 +02:00
static_sources =
static_sources += static/kea-imageonly-100bw.png
static_sources += static/kea-logo-100x70.png
static_sources += static/kea-logo-200.png
static_sources += static/kea.css
# ARM
2020-05-24 09:31:05 +02:00
rst_arm_sources =
rst_arm_sources += index.rst
rst_arm_sources += manpages.rst
2020-08-02 16:24:54 +02:00
rst_arm_sources += umls.rst
rst_arm_sources += debug-messages.rst
rst_arm_sources += kea-messages.rst
2020-05-24 09:31:05 +02:00
include arm/rst_arm_sources.mk
EXTRA_DIST += arm/rst_arm_sources.mk
main_sources = $(rst_arm_sources) conf.py $(static_sources)
# mans
2020-05-24 09:31:05 +02:00
rst_man_sources =
include man/rst_man_sources.mk
EXTRA_DIST += man/rst_man_sources.mk
rst_arm_sources += grammar/grammar.rst
rst_arm_sources += grammar/grammar-ca-parser.rst
rst_arm_sources += grammar/grammar-d2-parser.rst
rst_arm_sources += grammar/grammar-dhcp4-parser.rst
rst_arm_sources += grammar/grammar-dhcp6-parser.rst
rst_arm_sources += grammar/grammar-netconf-parser.rst
2020-05-24 09:31:05 +02:00
man8s =
include man/man8s.mk
EXTRA_DIST += man/man8s.mk
man_sources = $(rst_man_sources) conf.py
EXTRA_DIST += $(main_sources) $(man_sources) mes2doc.py api2doc.py $(man8s)
2019-07-18 14:37:52 +02:00
# list of messages files that are used to generate kea-messages.rst and then kea-messages.pdf
2020-05-24 09:31:05 +02:00
mes_files =
include $(srcdir)/mes_files.mk
2020-05-24 09:31:05 +02:00
EXTRA_DIST += mes_files.mk
# list of api files that are used to generate api.rst
2020-05-24 09:31:05 +02:00
api_files =
2020-08-31 17:06:48 +02:00
include $(top_srcdir)/src/share/api/api_files.mk
2019-07-24 09:58:40 +02:00
if HAVE_PDFLATEX
all: debug-messages.rst kea-messages.rst html mans pdf singlehtml text
else
all: debug-messages.rst kea-messages.rst html mans singlehtml text
2019-07-24 09:58:40 +02:00
endif
2020-05-24 09:31:05 +02:00
# build the list of message files
mes_files.mk: mes-files.txt
@sed 's;^;mes_files += $$(top_srcdir)/;g' $< > $@
mes-files.txt:
@find ../.. -type f -name '*.mes' | sort -V | sed 's#^../../##g' > $@
2020-05-24 09:31:05 +02:00
# Used in official build process. debug-messages.rst is generated via ./tools/check-messages.py -g.
$(srcdir)/debug-messages.rst: $(srcdir)/../../tools/check-messages.py
$(PYTHON) $< --generate-debug-messages-page
# Used in official build process. kea-messages.rst is generated via mes2doc.py.
$(srcdir)/kea-messages.rst: mes2doc.py
$(PYTHON) $(srcdir)/mes2doc.py -o $@
2020-05-24 09:31:05 +02:00
# build the list of api files
2020-08-31 17:06:48 +02:00
api-files.txt: $(top_srcdir)/src/share/api/api_files.mk
@sed 's;api_files .*)/;;' $< > $@
2020-05-24 09:31:05 +02:00
EXTRA_DIST += debug-messages.rst
EXTRA_DIST += kea-messages.rst
2020-07-27 16:20:33 +02:00
# some tools do not use this makefile but still need generate files.
EXTRA_DIST += mes-files.txt api-files.txt
# this rule is only used for development purposes and is not used in official
# build process as api.rst is always generated via sphinx's conf.py
$(srcdir)/api.rst: api2doc.py
$(PYTHON) $(srcdir)/api2doc.py -o $@
$(srcdir)/arm/platforms.rst:
2020-03-18 16:40:08 +01:00
rm -f $(srcdir)/arm/platforms.rst
cp $(srcdir)/../../platforms.rst $(srcdir)/arm/platforms.rst
2019-07-18 14:37:52 +02:00
2020-08-02 16:24:54 +02:00
# UML files
umls =
umls += uml/appendRequestedOptions.uml
umls += uml/appendRequestedVendorOptions.uml
umls += uml/assign-lease4.uml
umls += uml/buildCfgOptionList.uml
umls += uml/currentHost4.uml
umls += uml/lease-states.uml
umls += uml/main-loop.uml
umls += uml/packet4.uml
2023-11-09 12:09:07 +02:00
umls += uml/radius.uml
umls += uml/recognizing-same-client.uml
umls += uml/request4-lease.uml
umls += uml/request4.uml
umls += uml/requestLease4.uml
umls += uml/select4.uml
umls += uml/tkey.uml
umls += uml/update.uml
pngs =
pngs += uml/appendRequestedOptions.png
pngs += uml/appendRequestedVendorOptions.png
pngs += uml/assign-lease4.png
pngs += uml/buildCfgOptionList.png
pngs += uml/currentHost4.png
pngs += uml/lease-states.png
pngs += uml/main-loop.png
pngs += uml/packet4.png
2023-11-09 12:09:07 +02:00
pngs += uml/radius.png
pngs += uml/recognizing-same-client.png
pngs += uml/request4-lease.png
pngs += uml/request4.png
pngs += uml/requestLease4.png
pngs += uml/select4.png
pngs += uml/tkey.png
pngs += uml/update.png
svgs =
svgs += uml/appendRequestedOptions.svg
svgs += uml/appendRequestedVendorOptions.svg
svgs += uml/assign-lease4.svg
svgs += uml/buildCfgOptionList.svg
svgs += uml/currentHost4.svg
svgs += uml/lease-states.svg
svgs += uml/main-loop.svg
svgs += uml/packet4.svg
2023-11-09 12:09:07 +02:00
svgs += uml/radius.svg
svgs += uml/recognizing-same-client.svg
svgs += uml/request4-lease.svg
svgs += uml/request4.svg
svgs += uml/requestLease4.svg
svgs += uml/select4.svg
svgs += uml/tkey.svg
svgs += uml/update.svg
txts =
txts += uml/option-data-priority.atxt
txts += uml/priority-of-lease-lifetimes-and-dhcpv4-fields.atxt
txts += uml/tkey.atxt
txts += uml/update.atxt
2020-08-02 16:24:54 +02:00
if HAVE_PLANTUML
uml: uml-to-png uml-to-svg format-svgs uml-to-txt
uml-to-png: $(umls)
@ @PLANTUML@ -tpng $^
uml-to-svg: $(umls)
@ @PLANTUML@ -tsvg $^
2020-08-02 16:24:54 +02:00
# Formatting puts every tag on a separate line, which makes it easier for diffing.
format-svgs: $(svgs)
if HAVE_XMLLINT
@ for svg in $(svgs); do xmllint --format $$svg > tmp; mv tmp $$svg; done
else
@ printf 'WARNING: xmllint not found. SVGs not formatted.\n'
endif
# Only sequence diagrams support ASCII art.
uml-to-txt: uml/tkey.uml uml/update.uml
@ @PLANTUML@ -ttxt $^
@ for txt in $(txts); do sed 's/ *$$//g' $$txt > tmp; mv tmp $$txt; done
2020-08-02 16:24:54 +02:00
endif
EXTRA_DIST += $(umls)
EXTRA_DIST += $(pngs)
EXTRA_DIST += $(svgs)
2023-10-06 09:30:37 +03:00
EXTRA_DIST += $(txts)
2020-08-02 16:24:54 +02:00
2019-07-24 09:58:40 +02:00
PDFLATEX_AND_OPTS=$(PDFLATEX) -interaction nonstopmode
2020-05-24 09:31:05 +02:00
pdf: $(main_sources) api-files.txt mes-files.txt $(srcdir)/arm/platforms.rst
2019-07-24 09:58:40 +02:00
$(SPHINXBUILD) -M latex $(srcdir) $(sphinxbuilddir) $(sphinxopts)
2020-05-24 09:31:05 +02:00
cd $(abs_sphinxbuilddir)/latex && $(PDFLATEX_AND_OPTS) kea-arm.tex
cd $(abs_sphinxbuilddir)/latex && makeindex -s python.ist kea-arm.idx
cd $(abs_sphinxbuilddir)/latex && $(PDFLATEX_AND_OPTS) kea-arm.tex
cd $(abs_sphinxbuilddir)/latex && $(PDFLATEX_AND_OPTS) kea-messages.tex
cd $(abs_sphinxbuilddir)/latex && makeindex -s python.ist kea-messages.idx
2020-05-24 09:31:05 +02:00
cd $(abs_sphinxbuilddir)/latex && $(PDFLATEX_AND_OPTS) kea-messages.tex
html: $(main_sources) api-files.txt mes-files.txt $(srcdir)/arm/platforms.rst
$(SPHINXBUILD) -M html $(srcdir) $(sphinxbuilddir) $(sphinxopts)
# This target is not used anywhere, but people who prefer single page docs
# can do make -C doc/sphinx singlehtml and then enjoy their docs being
# generated in doc/sphinx/_build/singlehtml
2020-05-24 09:31:05 +02:00
singlehtml: $(main_sources) api-files.txt mes-files.txt $(srcdir)/arm/platforms.rst
$(SPHINXBUILD) -M singlehtml $(srcdir) $(sphinxbuilddir) $(sphinxopts)
text: $(main_sources) api-files.txt mes-files.txt $(srcdir)/arm/platforms.rst
$(SPHINXBUILD) -M text $(srcdir) $(sphinxbuilddir) $(sphinxopts)
$(man8s): mans
2020-05-24 09:31:05 +02:00
mans: $(man_sources) api-files.txt mes-files.txt
$(SPHINXBUILD) -M man $(srcdir) $(sphinxbuilddir) $(sphinxopts)
2021-11-16 11:57:25 +02:00
# Updates sphinx dependencies to the latest versions available on the current
# host and freezes them in ./src/requirements.txt. Requires pip-compile:
# pip install pip-tools
# Run this when dependencies are added, changed or removed.
2021-11-09 20:15:53 +02:00
update-python-dependencies: ./src/requirements.in
rm -f ./src/requirements.txt
2021-11-09 20:15:53 +02:00
pip-compile -r ./src/requirements.in
clean-local:
rm -rf $(sphinxbuilddir)
2022-08-08 16:23:39 +02:00
rm -f $(srcdir)/mes-files.txt $(srcdir)/api-files.txt
rm -f $(srcdir)/debug-messages.rst $(srcdir)/kea-messages.rst $(srcdir)/api.rst
2020-03-20 14:30:04 +01:00
rm -f $(srcdir)/arm/platforms.rst
.PHONY: all pdf html mans update-python-dependencies uml uml-to-png uml-to-svg format-svgs uml-to-txt
endif
# install and uninstall can occur with GENERATE_DOCS and without it
# so we want to install all when GENERATE_DOCS is and
# just mans when GENERATE_DOCS is not used, and when man files exists (e.g release tarball)
install-data-local:
mkdir -p $(DESTDIR)$(docdir)
if GENERATE_DOCS
cp -r $(sphinxbuilddir)/html $(DESTDIR)$(docdir)
if HAVE_PDFLATEX
${INSTALL_DATA} $(sphinxbuilddir)/latex/kea-arm.pdf $(DESTDIR)$(docdir)
${INSTALL_DATA} $(sphinxbuilddir)/latex/kea-messages.pdf $(DESTDIR)$(docdir)
endif
${MKDIR_P} ${DESTDIR}${mandir}/man8
${INSTALL_DATA} $(man8s) ${DESTDIR}${mandir}/man8/
else
if INSTALL_MANS
${MKDIR_P} ${DESTDIR}${mandir}/man8
2020-07-27 13:36:43 +02:00
${INSTALL_DATA} $(sphinxbuilddir)/man/*.8 ${DESTDIR}${mandir}/man8/
endif
endif
2019-11-28 11:14:59 +07:00
uninstall-local:
rm -rf $(DESTDIR)$(docdir)
2019-11-28 11:14:59 +07:00
# There are sometimes conflicts when more then one sphinx-build is run at a time.
# This target blocks running anything in parallel in this Makefile,
# all is run serially.
.NOTPARALLEL: