doc: add texinfodocs and infodocs targets
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>
Wed, 16 Nov 2022 19:02:09 +0000 (14:02 -0500)
committerJonathan Corbet <corbet@lwn.net>
Mon, 21 Nov 2022 21:13:57 +0000 (14:13 -0700)
Sphinx supports generating Texinfo sources and Info documentation,
which can be navigated easily and is convenient to search (via the
indexed nodes or anchors, for example).

Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Link: https://lore.kernel.org/r/20221116190210.28407-2-maxim.cournoyer@gmail.com
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/Makefile
Documentation/userspace-api/media/Makefile
Makefile

index 64d44c1ecad314968feaf4e45c8f892e4764c7e7..bb73dcb5ed0536e169ff6427b678a7e5a5d8cffb 100644 (file)
@@ -95,6 +95,15 @@ htmldocs:
        @$(srctree)/scripts/sphinx-pre-install --version-check
        @+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,html,$(var),,$(var)))
 
+texinfodocs:
+       @$(srctree)/scripts/sphinx-pre-install --version-check
+       @+$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,texinfo,$(var),texinfo,$(var)))
+
+# Note: the 'info' Make target is generated by sphinx itself when
+# running the texinfodocs target define above.
+infodocs: texinfodocs
+       $(MAKE) -C $(BUILDDIR)/texinfo info
+
 linkcheckdocs:
        @$(foreach var,$(SPHINXDIRS),$(call loop_cmd,sphinx,linkcheck,$(var),,$(var)))
 
@@ -143,6 +152,8 @@ cleandocs:
 dochelp:
        @echo  ' Linux kernel internal documentation in different formats from ReST:'
        @echo  '  htmldocs        - HTML'
+       @echo  '  texinfodocs     - Texinfo'
+       @echo  '  infodocs        - Info'
        @echo  '  latexdocs       - LaTeX'
        @echo  '  pdfdocs         - PDF'
        @echo  '  epubdocs        - EPUB'
index 00922aa7efde7f9911ea5c712f2a12334287c791..3d8aaf5c253b9088d247fc2bd9a2828ee3a473a5 100644 (file)
@@ -47,10 +47,11 @@ $(BUILDDIR)/lirc.h.rst: ${UAPI}/lirc.h ${PARSER} $(SRC_DIR)/lirc.h.rst.exception
 
 # Media build rules
 
-.PHONY: all html epub xml latex
+.PHONY: all html texinfo epub xml latex
 
 all: $(IMGDOT) $(BUILDDIR) ${TARGETS}
 html: all
+texinfo: all
 epub: all
 xml: all
 latex: $(IMGPDF) all
index f41ec8c8426ba2a351ca18d003872db77ea20127..2d393be42e4b3b576fca2fd724da493affa6dd9c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1785,7 +1785,7 @@ $(help-board-dirs): help-%:
 # Documentation targets
 # ---------------------------------------------------------------------------
 DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs \
-              linkcheckdocs dochelp refcheckdocs
+              linkcheckdocs dochelp refcheckdocs texinfodocs infodocs
 PHONY += $(DOC_TARGETS)
 $(DOC_TARGETS):
        $(Q)$(MAKE) $(build)=Documentation $@