• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2#
3# Makefile for Sphinx documentation
4
5EXTRA_DIST = \
6abidiff.rst \
7abipkgdiff.rst \
8abicompat.rst \
9abidw.rst \
10abilint.rst \
11conf.py \
12index.rst \
13libabigail-concepts.rst \
14libabigail-overview.rst \
15libabigail-tools.rst \
16fedabipkgdiff.rst \
17kmidiff.rst \
18tools-use-libabigail.txt
19
20# You can set these variables from the command line.
21SPHINXOPTS    =
22SPHINXBUILD   = sphinx-build
23PAPER         =
24BUILDDIR      = $(abs_builddir)
25SOURCEDIR     = $(abs_srcdir)
26
27# Internal variables.
28PAPEROPT_a4     = -D latex_paper_size=a4
29PAPEROPT_letter = -D latex_paper_size=letter
30ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCEDIR)
31# the i18n builder cannot share the environment and doctrees with the others
32I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
33
34.PHONY: help clean html-local dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
35
36help:
37	@echo "Please use \`make <target>' where <target> is one of"
38	@echo "  html-doc   to make standalone HTML files"
39	@echo "  dirhtml    to make HTML files named index.html in directories"
40	@echo "  singlehtml to make a single large HTML file"
41	@echo "  pickle     to make pickle files"
42	@echo "  json       to make JSON files"
43	@echo "  htmlhelp   to make HTML files and a HTML help project"
44	@echo "  qthelp     to make HTML files and a qthelp project"
45	@echo "  devhelp    to make HTML files and a Devhelp project"
46	@echo "  epub       to make an epub"
47	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
48	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
49	@echo "  text       to make text files"
50	@echo "  man        to make manual pages"
51	@echo "  texinfo    to make Texinfo files"
52	@echo "  info       to make Texinfo files and run them through makeinfo"
53	@echo "  gettext    to make PO message catalogs"
54	@echo "  changes    to make an overview of all changed/added/deprecated items"
55	@echo "  linkcheck  to check all external links for integrity"
56	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
57
58html-doc:
59	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(DESTDIR)$(BUILDDIR)/html
60	@echo
61	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
62
63dirhtml:
64	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
65	@echo
66	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
67
68singlehtml:
69	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
70	@echo
71	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
72
73pickle:
74	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
75	@echo
76	@echo "Build finished; now you can process the pickle files."
77
78json:
79	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
80	@echo
81	@echo "Build finished; now you can process the JSON files."
82
83htmlhelp:
84	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
85	@echo
86	@echo "Build finished; now you can run HTML Help Workshop with the" \
87	      ".hhp project file in $(BUILDDIR)/htmlhelp."
88
89qthelp:
90	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
91	@echo
92	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
93	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
94	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Libabigailmanuals.qhcp"
95	@echo "To view the help file:"
96	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Libabigailmanuals.qhc"
97
98devhelp:
99	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
100	@echo
101	@echo "Build finished."
102	@echo "To view the help file:"
103	@echo "# mkdir -p $$HOME/.local/share/devhelp/Libabigailmanuals"
104	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Libabigailmanuals"
105	@echo "# devhelp"
106
107epub:
108	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
109	@echo
110	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
111
112latex:
113	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
114	@echo
115	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
116	@echo "Run \`make' in that directory to run these through (pdf)latex" \
117	      "(use \`make latexpdf' here to do that automatically)."
118
119latexpdf:
120	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
121	@echo "Running LaTeX files through pdflatex..."
122	$(MAKE) -C $(BUILDDIR)/latex all-pdf
123	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
124
125text:
126	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
127	@echo
128	@echo "Build finished. The text files are in $(BUILDDIR)/text."
129
130man:
131	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
132	@echo
133	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
134
135texinfo:
136	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
137	@echo
138	@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
139	@echo "Run \`make' in that directory to run these through makeinfo" \
140	      "(use \`make info' here to do that automatically)."
141
142info:
143	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
144	@echo "Running Texinfo files through makeinfo..."
145	make -C $(BUILDDIR)/texinfo info
146	@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
147
148gettext:
149	$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
150	@echo
151	@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
152
153changes:
154	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
155	@echo
156	@echo "The overview file is in $(BUILDDIR)/changes."
157
158linkcheck:
159	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
160	@echo
161	@echo "Link check complete; look for any errors in the above output " \
162	      "or in $(BUILDDIR)/linkcheck/output.txt."
163
164doctest:
165	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
166	@echo "Testing of doctests in the sources finished, look at the " \
167	      "results in $(BUILDDIR)/doctest/output.txt."
168
169section1_manpages =
170section7_manpages =
171manpages =
172texinfodocs =
173
174if ENABLE_MANUAL
175
176section1_manpages += abipkgdiff.1 abidiff.1 abidw.1 abilint.1 abicompat.1
177section7_manpages += libabigail.7
178manpages +=  $(section1_manpages) $(section7_manpages)
179texinfodocs += abigail.info
180
181install-html-doc: html-doc
182	test -d "$(DESTDIR)$(docdir)/manual" || $(mkinstalldirs) "$(DESTDIR)$(docdir)/manual"
183	cp -r "$(DESTDIR)$(BUILDDIR)/html" "$(DESTDIR)$(docdir)/manual"
184else
185
186install-html-doc:
187
188endif
189
190clean-local:
191	-rm -rf $(BUILDDIR)/html
192	-rm -rf $(BUILDDIR)/doctrees
193
194install-man-and-info-doc:
195	-test -f $(BUILDDIR)/man/abidiff.1 && $(mkinstalldirs) $(DESTDIR)$(mandir)/man1
196	-test -f $(BUILDDIR)/man/libabigail.7 && $(mkinstalldirs) $(DESTDIR)$(mandir)/man7
197	-for m in $(section1_manpages); do test -f $(BUILDDIR)/man/$$m && $(install_sh_DATA) $(BUILDDIR)/man/$$m $(DESTDIR)$(mandir)/man1; done;
198	-for m in $(section7_manpages); do test -f $(BUILDDIR)/man/$$m && $(install_sh_DATA) $(BUILDDIR)/man/$$m $(DESTDIR)$(mandir)/man7; done;
199
200	-test -f $(BUILDDIR)/texinfo/abigail.info && $(mkinstalldirs) $(DESTDIR)$(infodir)
201	-for i in $(texinfodocs); do test -f $(BUILDDIR)/texinfo/$$i && $(install_sh_DATA) $(BUILDDIR)/texinfo/$$i $(DESTDIR)$(infodir)/$$i; gzip -f $(DESTDIR)$(infodir)/$$i; done;
202
203uninstall-local: clean-local
204	-for i in $(section1_manpages); do rm -f $(DESTDIR)$(mandir)/man1/$$i; done
205	-for i in $(section7_manpages); do rm -f $(DESTDIR)$(mandir)/man7/$$i; done
206	-for i in $(texinfodocs); do rm -f $(DESTDIR)$(infodir)/$$i; done
207	-rm -rf $(DESTDIR)$(docdir)/manual/html
208