2014-04-08 19:56:31 +02:00
|
|
|
# See LICENSE file for license and copyright information
|
|
|
|
#
|
|
|
|
include ../config.mk
|
|
|
|
include ../common.mk
|
2014-04-24 16:23:19 +02:00
|
|
|
include ../colors.mk
|
2014-04-08 19:56:31 +02:00
|
|
|
include config.mk
|
|
|
|
|
2014-04-27 16:01:44 +02:00
|
|
|
MAN_SOURCES=$(wildcard man/*.rst) $(wildcard man/*.txt) man/conf.py
|
2014-04-27 14:24:55 +02:00
|
|
|
DOXYGEN_SOURCES=$(wildcard ../*.h) Doxyfile
|
2014-11-07 22:29:43 +01:00
|
|
|
HTML_SOURCES=$(wildcard *.rst api/*.rst configuration/*.rst installation/*.rst usage/*.rst) conf.py
|
2014-04-27 14:24:55 +02:00
|
|
|
|
|
|
|
SPHINX_OPTS+=-d $(SPHINX_BUILDDIR)/doctrees
|
|
|
|
|
|
|
|
all: man html
|
2014-04-08 19:56:31 +02:00
|
|
|
|
|
|
|
clean:
|
2014-04-24 16:23:19 +02:00
|
|
|
$(call colorecho,RM,doc/$(SPHINX_BUILDDIR))
|
2014-04-08 19:56:31 +02:00
|
|
|
$(QUIET)rm -rf $(SPHINX_BUILDDIR)/
|
|
|
|
|
2014-04-27 14:24:55 +02:00
|
|
|
$(SPHINX_BUILDDIR)/html/index.html: $(HTML_SOURCES) $(SPHINX_BUILDDIR)/doxygen/xml/index.xml
|
2016-02-08 22:30:34 +01:00
|
|
|
$(QUIET)mkdir -p $(SPHINX_BUILDDIR)/html
|
2014-04-24 16:23:19 +02:00
|
|
|
$(call colorecho,DOC,"Build HTML documentation")
|
2014-04-27 14:24:55 +02:00
|
|
|
$(QUIET)$(SPHINX_BIN) -b html $(SPHINX_OPTS) . $(SPHINX_BUILDDIR)/html
|
2014-04-08 19:56:31 +02:00
|
|
|
|
2014-04-27 14:24:55 +02:00
|
|
|
$(SPHINX_BUILDDIR)/zathura.1 $(SPHINX_BUILDDIR)/zathurarc.5: $(MAN_SOURCES)
|
2016-02-08 22:30:34 +01:00
|
|
|
$(QUIET)mkdir -p $(SPHINX_BUILDDIR)
|
2014-04-24 16:23:19 +02:00
|
|
|
$(call colorecho,DOC,"Build man pages")
|
2014-04-27 14:24:55 +02:00
|
|
|
$(QUIET)$(SPHINX_BIN) -b man $(SPHINX_OPTS) man $(SPHINX_BUILDDIR)
|
2014-04-08 19:56:31 +02:00
|
|
|
|
2014-04-27 14:24:55 +02:00
|
|
|
$(SPHINX_BUILDDIR)/doxygen/xml/index.xml: $(DOXYGEN_SOURCES)
|
2016-02-08 22:30:34 +01:00
|
|
|
$(QUIET)mkdir -p $(SPHINX_BUILDDIR)/doxygen/xml
|
2014-04-24 16:23:19 +02:00
|
|
|
$(call colorecho,DOC,"Run doxygen")
|
2014-04-08 19:56:31 +02:00
|
|
|
$(QUIET)$(DOXYGEN_BIN) Doxyfile
|
|
|
|
|
2014-04-27 14:24:55 +02:00
|
|
|
ifeq ($(shell which $(SPHINX_BIN) >/dev/null 2>&1; echo $$?), 1)
|
|
|
|
man:
|
|
|
|
html:
|
|
|
|
else
|
|
|
|
man: $(SPHINX_BUILDDIR)/zathura.1 $(SPHINX_BUILDDIR)/zathurarc.5
|
|
|
|
|
2014-04-27 14:39:10 +02:00
|
|
|
# TODO: Make a better test for breathe and sphinx_rtd_theme
|
|
|
|
ifeq ($(shell which $(DOXYGEN_BIN) >/dev/null 2>&1 && $(PYTHON_BIN) -c "import breathe; import sphinx_rtd_theme" >/dev/null 2>&1; echo $$?), 0)
|
2014-04-27 14:24:55 +02:00
|
|
|
html: $(SPHINX_BUILDDIR)/html/index.html
|
|
|
|
else
|
|
|
|
html:
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
.PHONY: clean html man all
|