Fix for building docs.
[awesomized/libmemcached] / docs / Makefile
1 # Makefile for Sphinx documentation
2
3 # You can set these variables from the command line.
4 SPHINXOPTS =
5 SPHINXBUILD = sphinx-build
6 PAPER =
7 BUILDDIR = build
8
9 # Custom rules used by top level make
10 MANGOAL:= $(BUILDDIR)/man/.dirstamp
11 HTMLGOAL:= $(BUILDDIR)/html/.dirstamp
12
13 .PHONY: all distclean distcheck maintainer-clean check test
14 all: $(MANGOAL) $(HTMLGOAL)
15
16 maintainer-clean distclean: clean
17
18 distcheck check distdir:
19
20 RST_FILES= $(shell find source -type f -name '*.rst')
21
22 .DEFAULT_GOAL:= all
23
24 .NOTPARALLEL:
25
26 SOURCES=
27 SOURCES+= $(RST_FILES)
28 SOURCES+= source/conf.py
29 SOURCES+= Makefile
30
31 $(MANGOAL): $(SOURCES)
32 @$(MAKE) $(AM_MAKEFLAGS) man
33 @touch $@
34
35 $(HTMLGOAL): $(SOURCES)
36 @$(MAKE) $(AM_MAKEFLAGS) html
37 @touch $@
38
39 # User-friendly check for sphinx-build
40 ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
41 $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
42 endif
43
44 # Internal variables.
45 PAPEROPT_a4 = -D latex_paper_size=a4
46 PAPEROPT_letter = -D latex_paper_size=letter
47 ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
48 # the i18n builder cannot share the environment and doctrees with the others
49 I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
50
51 .PHONY: help clean dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text changes linkcheck doctest gettext
52
53 help:
54 @echo "Please use \`make <target>' where <target> is one of"
55 @echo " html to make standalone HTML files"
56 @echo " dirhtml to make HTML files named index.html in directories"
57 @echo " singlehtml to make a single large HTML file"
58 @echo " pickle to make pickle files"
59 @echo " json to make JSON files"
60 @echo " htmlhelp to make HTML files and a HTML help project"
61 @echo " qthelp to make HTML files and a qthelp project"
62 @echo " devhelp to make HTML files and a Devhelp project"
63 @echo " epub to make an epub"
64 @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
65 @echo " latexpdf to make LaTeX files and run them through pdflatex"
66 @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
67 @echo " text to make text files"
68 @echo " man to make manual pages"
69 @echo " texinfo to make Texinfo files"
70 @echo " info to make Texinfo files and run them through makeinfo"
71 @echo " gettext to make PO message catalogs"
72 @echo " changes to make an overview of all changed/added/deprecated items"
73 @echo " xml to make Docutils-native XML files"
74 @echo " pseudoxml to make pseudoxml-XML files for display purposes"
75 @echo " linkcheck to check all external links for integrity"
76 @echo " doctest to run all doctests embedded in the documentation (if enabled)"
77
78 clean:
79 @$(RM) -r $(BUILDDIR)/*
80
81 html: $(SOURCES)
82 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
83
84 dirhtml:
85 $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
86 @echo
87 @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
88
89 singlehtml:
90 $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
91 @echo
92 @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
93
94 pickle:
95 $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
96
97 json:
98 $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
99 @echo
100 @echo "Build finished; now you can process the JSON files."
101
102 htmlhelp:
103 $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
104 @echo
105 @echo "Build finished; now you can run HTML Help Workshop with the" \
106 ".hhp project file in $(BUILDDIR)/htmlhelp."
107
108 qthelp:
109 $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
110 @echo
111 @echo "Build finished; now you can run "qcollectiongenerator" with the" \
112 ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
113 @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/gearmand.qhcp"
114 @echo "To view the help file:"
115 @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/gearmand.qhc"
116
117 devhelp:
118 $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
119 @echo
120 @echo "Build finished."
121 @echo "To view the help file:"
122 @echo "# mkdir -p $$HOME/.local/share/devhelp/gearmand"
123 @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/gearmand"
124 @echo "# devhelp"
125
126 epub:
127 $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
128 @echo
129 @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
130
131 latex:
132 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
133 @echo
134 @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
135 @echo "Run \`make' in that directory to run these through (pdf)latex" \
136 "(use \`make latexpdf' here to do that automatically)."
137
138 latexpdf:
139 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
140 @echo "Running LaTeX files through pdflatex..."
141 $(MAKE) -C $(BUILDDIR)/latex all-pdf
142 @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
143
144 latexpdfja:
145 $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
146 @echo "Running LaTeX files through platex and dvipdfmx..."
147 $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
148 @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
149
150 text:
151 $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
152 @echo
153 @echo "Build finished. The text files are in $(BUILDDIR)/text."
154
155 man: $(SOURCES)
156 $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
157
158 texinfo:
159 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
160 @echo
161 @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
162 @echo "Run \`make' in that directory to run these through makeinfo" \
163 "(use \`make info' here to do that automatically)."
164
165 info:
166 $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
167 @echo "Running Texinfo files through makeinfo..."
168 make -C $(BUILDDIR)/texinfo info
169 @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
170
171 gettext:
172 $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
173 @echo
174 @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
175
176 changes:
177 $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
178 @echo
179 @echo "The overview file is in $(BUILDDIR)/changes."
180
181 linkcheck:
182 $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
183 @echo
184 @echo "Link check complete; look for any errors in the above output " \
185 "or in $(BUILDDIR)/linkcheck/output.txt."
186
187 doctest:
188 @$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
189 @echo "Testing of doctests in the sources finished, look at the " \
190 "results in $(BUILDDIR)/doctest/output.txt."
191
192 xml:
193 $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
194 @echo
195 @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
196
197 pseudoxml:
198 $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
199 @echo
200 @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."