doc-rst: add an option to ignore DocBooks when generating docs
authorMauro Carvalho Chehab <mchehab@s-opensource.com>
Sat, 9 Jul 2016 16:12:45 +0000 (13:12 -0300)
committerJonathan Corbet <corbet@lwn.net>
Sun, 10 Jul 2016 05:15:05 +0000 (23:15 -0600)
Sometimes, we want to do a partial build, instead of building
everything. However, right now, if one wants to build just
Sphinx books, it will build also the DocBooks.

Add an option to allow to ignore all DocBooks when building
documentation.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Documentation/DocBook/Makefile

index 496d4295ec38e5a7b9c0d6d1927ac2be009193fd..01bab5014a4a73f40d6a3f5062873e9a5fa46516 100644 (file)
@@ -6,6 +6,8 @@
 # To add a new book the only step required is to add the book to the
 # list of DOCBOOKS.
 
+ifeq ($(IGNORE_DOCBOOKS),)
+
 DOCBOOKS := z8530book.xml device-drivers.xml \
            kernel-hacking.xml kernel-locking.xml deviceiobook.xml \
            writing_usb_driver.xml networking.xml \
@@ -215,6 +217,20 @@ silent_gen_xml = :
               -e "s/>/\\&gt;/g";     \
           echo "</programlisting>")  > $@
 
+else
+
+# Needed, due to cleanmediadocs
+include Documentation/DocBook/media/Makefile
+
+htmldocs:
+pdfdocs:
+psdocs:
+xmldocs:
+installmandocs:
+
+endif # IGNORE_DOCBOOKS
+
+
 ###
 # Help targets as used by the top-level makefile
 dochelp:
@@ -229,6 +245,9 @@ dochelp:
        @echo
        @echo  '  make DOCBOOKS="s1.xml s2.xml" [target] Generate only docs s1.xml s2.xml'
        @echo  '  valid values for DOCBOOKS are: $(DOCBOOKS)'
+       @echo
+       @echo  "  make IGNORE_DOCBOOKS=1 [target] Don't generate docs from Docbook"
+       @echo  '     This is useful to generate only the ReST docs (Sphinx)'
 
 
 ###