]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - tidl/tidl-api.git/blob - docs/Makefile
Add documentation for examples
[tidl/tidl-api.git] / docs / Makefile
1 # Copyright (c) 2018 Texas Instruments Incorporated - http://www.ti.com/
2 # All rights reserved.
3 #
4 # Redistribution and use in source and binary forms, with or without
5 # modification, are permitted provided that the following conditions are met:
6 # * Redistributions of source code must retain the above copyright
7 # notice, this list of conditions and the following disclaimer.
8 # * Redistributions in binary form must reproduce the above copyright
9 # notice, this list of conditions and the following disclaimer in the
10 # documentation and/or other materials provided with the distribution.
11 # * Neither the name of Texas Instruments Incorporated nor the
12 # names of its contributors may be used to endorse or promote products
13 # derived from this software without specific prior written permission.
14 #
15 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16 # AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 # ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19 # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20 # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21 # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23 # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
25 # THE POSSIBILITY OF SUCH DAMAGE.
27 # Makefile for Sphinx documentation
28 # Uses breathe to integrate doxygen API documentation into sphinx
29 # https://breathe.readthedocs.io/en/latest/
31 default: html
33 # You can set these variables from the command line.
34 SPHINXOPTS    =
35 SPHINXBUILD   = sphinx-build
36 PAPER         =
37 BUILDDIR      = build
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
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
51 .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext
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 "  applehelp  to make an Apple Help Book"
63         @echo "  devhelp    to make HTML files and a Devhelp project"
64         @echo "  epub       to make an epub"
65         @echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
66         @echo "  latexpdf   to make LaTeX files and run them through pdflatex"
67         @echo "  latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
68         @echo "  text       to make text files"
69         @echo "  man        to make manual pages"
70         @echo "  texinfo    to make Texinfo files"
71         @echo "  info       to make Texinfo files and run them through makeinfo"
72         @echo "  gettext    to make PO message catalogs"
73         @echo "  changes    to make an overview of all changed/added/deprecated items"
74         @echo "  xml        to make Docutils-native XML files"
75         @echo "  pseudoxml  to make pseudoxml-XML files for display purposes"
76         @echo "  linkcheck  to check all external links for integrity"
77         @echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
78         @echo "  coverage   to run coverage check of the documentation (if enabled)"
80 clean:
81         rm -rf $(BUILDDIR)/*
83 html: api-xml 
84         $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)
85         @echo
86         @echo "Build finished. The HTML pages are in $(BUILDDIR)."
88 dirhtml:
89         $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
90         @echo
91         @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
93 singlehtml:
94         $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
95         @echo
96         @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
98 pickle:
99         $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
100         @echo
101         @echo "Build finished; now you can process the pickle files."
103 json:
104         $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
105         @echo
106         @echo "Build finished; now you can process the JSON files."
108 htmlhelp:
109         $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
110         @echo
111         @echo "Build finished; now you can run HTML Help Workshop with the" \
112               ".hhp project file in $(BUILDDIR)/htmlhelp."
114 qthelp:
115         $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
116         @echo
117         @echo "Build finished; now you can run "qcollectiongenerator" with the" \
118               ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
119         @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/TIOpenCL.qhcp"
120         @echo "To view the help file:"
121         @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/TIOpenCL.qhc"
123 applehelp:
124         $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp
125         @echo
126         @echo "Build finished. The help book is in $(BUILDDIR)/applehelp."
127         @echo "N.B. You won't be able to view it unless you put it in" \
128               "~/Library/Documentation/Help or install it in your application" \
129               "bundle."
131 devhelp:
132         $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
133         @echo
134         @echo "Build finished."
135         @echo "To view the help file:"
136         @echo "# mkdir -p $$HOME/.local/share/devhelp/TIOpenCL"
137         @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/TIOpenCL"
138         @echo "# devhelp"
140 epub:
141         $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
142         @echo
143         @echo "Build finished. The epub file is in $(BUILDDIR)/epub."
145 latex:
146         $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
147         @echo
148         @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
149         @echo "Run \`make' in that directory to run these through (pdf)latex" \
150               "(use \`make latexpdf' here to do that automatically)."
152 latexpdf:
153         $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
154         @echo "Running LaTeX files through pdflatex..."
155         $(MAKE) -C $(BUILDDIR)/latex all-pdf
156         @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
158 latexpdfja:
159         $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
160         @echo "Running LaTeX files through platex and dvipdfmx..."
161         $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
162         @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
164 text:
165         $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
166         @echo
167         @echo "Build finished. The text files are in $(BUILDDIR)/text."
169 man:
170         $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
171         @echo
172         @echo "Build finished. The manual pages are in $(BUILDDIR)/man."
174 texinfo:
175         $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
176         @echo
177         @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
178         @echo "Run \`make' in that directory to run these through makeinfo" \
179               "(use \`make info' here to do that automatically)."
181 info:
182         $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
183         @echo "Running Texinfo files through makeinfo..."
184         make -C $(BUILDDIR)/texinfo info
185         @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
187 gettext:
188         $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
189         @echo
190         @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
192 changes:
193         $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
194         @echo
195         @echo "The overview file is in $(BUILDDIR)/changes."
197 linkcheck:
198         $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
199         @echo
200         @echo "Link check complete; look for any errors in the above output " \
201               "or in $(BUILDDIR)/linkcheck/output.txt."
203 doctest:
204         $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
205         @echo "Testing of doctests in the sources finished, look at the " \
206               "results in $(BUILDDIR)/doctest/output.txt."
208 coverage:
209         $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
210         @echo "Testing of coverage in the sources finished, look at the " \
211               "results in $(BUILDDIR)/coverage/python.txt."
213 xml:
214         $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
215         @echo
216         @echo "Build finished. The XML files are in $(BUILDDIR)/xml."
218 pseudoxml:
219         $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
220         @echo
221         @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."
223 artifacts:
224         $(MAKE) -c artifacts
226 api-xml:
227         (cd ../tidl_api/doxygen; doxygen)