1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
|
# This Makefile started with the default Makefile produced by the Sphinx
# initialization process, which we then modified over time. During the
# Automake-ification, I stripped out most of the boilderplate and left only
# the targets that we use.
# We turn off parallel build in doc:
#
# 1. Sphinx handles building the whole documentation internally already, as
# a unit, so we shouldn't call sphinx-build more than once for different
# output files at all, let alone in parallel.
#
# 2. Serial build is plenty fast.
#
# 3. There is a race condition in Sphinx < 1.6.6 that's triggered when two
# instances (e.g., for html and man targets) try to "mkdir doctrees"
# simultaneously. See issue #115.
#
# This special target was introduced in GNU Make 3.79, in April 2000.
.NOTPARALLEL:
EXTRA_DIST = \
_loc.rst \
best_practices.rst \
bugs.rst \
cdi-cray-libfabric.json \
cdi-nvidia.json \
charliecloud.rst \
ch-checkns.rst \
ch-completion.bash.rst \
ch-convert.rst \
ch-fromhost.rst \
ch-image.rst \
ch-run.rst \
ch-run-oci.rst \
ch-test.rst \
code-of-conduct.rst \
conf.py \
dev.rst \
faq.rst \
favicon.ico \
governance.rst \
index.rst \
install.rst \
logo-sidebar.png \
make-deps-overview \
man/README \
py_env.rst \
rd100-winner.png \
releases \
see_also.rst \
tutorial.rst
if ENABLE_MAN
man_MANS = \
man/charliecloud.7 \
man/ch-checkns.1 \
man/ch-completion.bash.7 \
man/ch-convert.1 \
man/ch-fromhost.1 \
man/ch-image.1 \
man/ch-run.1 \
man/ch-run-oci.1 \
man/ch-test.1
endif
if ENABLE_HTML
nobase_html_DATA = \
html/searchindex.js \
html/_images/rd100-winner.png \
html/best_practices.html \
html/ch-checkns.html \
html/ch-completion.bash.html \
html/ch-convert.html \
html/ch-fromhost.html \
html/ch-image.html \
html/ch-run.html \
html/ch-run-oci.html \
html/ch-test.html \
html/command-usage.html \
html/dev.html \
html/faq.html \
html/index.html \
html/install.html \
html/search.html \
html/tutorial.html
endif
# NOTE: ./html might be a Git checkout to support "make web", so make sure not
# to delete it.
CLEANFILES = $(man_MANS) $(nobase_html_DATA) \
_deps.rst html/.buildinfo html/.nojekyll
if ENABLE_HTML
# Automake can't remove directories.
clean-local:
rm -Rf doctrees html/_sources html/_static html/_images
endif
# Automake can't install and uninstall directories. _static contains around
# one hundred files in several directories, and I'm pretty sure the contents
# change depending on Sphinx version and other details, so we can't just list
# the files. These targets deal with it as an opaque directory. The _sources
# directory is another generated directory that contains references to the
# input .rst files which we need for searching to work so we give it a similar
# treatment.
if ENABLE_HTML
install-data-hook:
cp -r html/_sources $(DESTDIR)$(htmldir)/html
cp -r html/_static $(DESTDIR)$(htmldir)/html
find $(DESTDIR)$(htmldir)/html/_sources -type f -exec chmod 644 {} \;
find $(DESTDIR)$(htmldir)/html/_static -type d -exec chmod 755 {} \;
find $(DESTDIR)$(htmldir)/html/_static -type f -exec chmod 644 {} \;
uninstall-hook:
test -d $(DESTDIR)$(htmldir)/html/_sources \
&& rm -Rf $(DESTDIR)$(htmldir)/html/_sources \;
test -d $(DESTDIR)$(htmldir)/html/_static \
&& rm -Rf $(DESTDIR)$(htmldir)/html/_static \;
test -d $(DESTDIR)$(htmldir)/html/_images \
&& rm -Rf $(DESTDIR)$(htmldir)/html/_images \;
endif
# You can set these variables from the command line.
SPHINXOPTS = -W
SPHINXBUILD = @SPHINX@
PAPER =
BUILDDIR = .
# Internal variables.
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(SPHINXOPTS) .
_deps.rst: ../config.log make-deps-overview
cat $< | ./make-deps-overview > $@
# Since we're not doing anything in parallel anyway, just put the HTML and the
# man pages in the same target, with conditionals. Gotchas:
#
# 1. If we build both, the HTML needs to go first otherwise it doesn't get
# curly quotes. ¯\_(ツ)_/¯
#
# 2. This not a "grouped target" but rather an "independent target" [1],
# because the former came in GNU Make 4.3 which is quite new. However it
# does seem to get run only once.
#
# [1]: https://www.gnu.org/software/make/manual/html_node/Multiple-Targets.html
$(nobase_html_DATA) $(man_MANS): ../lib/version.txt ../README.rst _deps.rst $(EXTRA_DIST)
if ENABLE_HTML
# Create dummy file in case the redirect is disabled for EPEL.
mkdir -p html
touch html/command-usage.html
# Build.
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
# Some output files are copies with same timestamp as source; fix. Note
# we need all the HTML output files, not just the one picked in $@.
touch --no-create $(nobase_html_DATA)
# remove unused files that Sphinx made
rm -f $(BUILDDIR)/html/_deps.html \
$(BUILDDIR)/html/charliecloud.html \
$(BUILDDIR)/html/bugs.html \
$(BUILDDIR)/html/_loc.html \
$(BUILDDIR)/html/objects.inv \
$(BUILDDIR)/html/see_also.html
endif
if ENABLE_MAN
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
endif
|