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