Don't fail to build documentation if kindlegen doesn't exist
[openafs.git] / doc / xml / AdminGuide / Makefile.in
index cbbba59..b60c80a 100644 (file)
@@ -15,7 +15,7 @@
 
 BOOK = auagd000
 
-all: $(BOOK).pdf index.html
+all: $(BOOK).pdf index.html $(BOOK).epub $(BOOK).mobi
 
 include @TOP_OBJDIR@/src/config/Makefile.config
 VERSION=version
@@ -30,6 +30,7 @@ HTML_XSL = @HTML_XSL@
 DOCBOOK_STYLESHEETS = @DOCBOOK_STYLESHEETS@
 XSLTPROC = @XSLTPROC@
 DOCBOOK2PDF = @DOCBOOK2PDF@
+DBTOEPUB = $(DOCBOOK_STYLESHEETS)/epub/bin/dbtoepub
 
 index.html: $(SRCS)
        $(XSLTPROC) --param navig.graphics 1 \
@@ -43,8 +44,18 @@ $(BOOK).pdf: $(SRCS)
                $(DOCBOOK2PDF) $(BOOK).xml; \
        fi
 
+$(BOOK).epub: $(SRCS)
+       if test -x "$(DBTOEPUB)" ; then \
+               $(DBTOEPUB) -s $(TOP_SRCDIR)/../doc/xml/mobi-fixup.xsl $(BOOK).xml; \
+       fi
+
+$(BOOK).mobi: $(BOOK).epub
+       if test -n "$(KINDLEGEN)" && test -x "$(DBTOEPUB)" ; then \
+               kindlegen $(BOOK).epub -o $(BOOK).mobi; \
+       fi
+
 check:
        xmllint --noout --valid $(BOOK).xml
 
 clean:
-       rm -f *.html *.pdf
+       rm -f *.aux *.epub *.fo *.html *.log *.mobi *.out *.pdf