Skip to content

Commit b4815ad

Browse files
committed
mk: only build PDFs of the manual and tutorial.
This restores the old behaviour (as compared to building PDF versions of all standalone docs), because some of the guides use unicode characters, which seems to make pdftex unhappy.
1 parent bb8ac21 commit b4815ad

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

mk/docs.mk

+12-2
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@
1414
#
1515
# The DOCS variable is their names (with no file extension).
1616
#
17+
# PDF_DOCS lists the targets for which PDF documentation should be
18+
# build.
19+
#
1720
# RUSTDOC_FLAGS_xyz variables are extra arguments to pass to the
1821
# rustdoc invocation for xyz.
1922
#
@@ -28,6 +31,8 @@ DOCS := index tutorial guide-ffi guide-macros guide-lifetimes \
2831
complement-cheatsheet guide-runtime \
2932
rust rustdoc
3033

34+
PDF_DOCS := tutorial rust
35+
3136
RUSTDOC_DEPS_rust := doc/full-toc.inc
3237
RUSTDOC_FLAGS_rust := --markdown-in-header=doc/full-toc.inc
3338

@@ -45,8 +50,6 @@ PANDOC_TEX_OPTS = $(PANDOC_BASE_OPTS) --include-before-body=doc/version.md \
4550
--from=markdown --include-before-body=doc/footer.tex --to=latex
4651
PANDOC_EPUB_OPTS = $(PANDOC_BASE_OPTS) --to=epub
4752

48-
49-
5053
# The rustdoc executable...
5154
RUSTDOC_EXE = $(HBIN2_H_$(CFG_BUILD))/rustdoc$(X_$(CFG_BUILD))
5255
# ...with rpath included in case --disable-rpath was provided to
@@ -146,6 +149,11 @@ doc/footer.tex: $(D)/footer.tex | doc/
146149

147150
# The (english) documentation for each doc item.
148151

152+
define DEF_SHOULD_BUILD_PDF_DOC
153+
SHOULD_BUILD_PDF_DOC_$(1) = 1
154+
endef
155+
$(foreach docname,$(PDF_DOCS),$(eval $(call DEF_SHOULD_BUILD_PDF_DOC,$(docname))))
156+
149157
define DEF_DOC
150158

151159
# HTML (rustdoc)
@@ -171,13 +179,15 @@ doc/$(1).tex: $$(D)/$(1).md doc/footer.tex doc/version.md | doc/
171179
$$(CFG_PANDOC) $$(PANDOC_TEX_OPTS) --output=$$@
172180

173181
ifneq ($(NO_PDF_DOCS),1)
182+
ifeq ($$(SHOULD_BUILD_PDF_DOC_$(1)),1)
174183
DOC_TARGETS += doc/$(1).pdf
175184
doc/$(1).pdf: doc/$(1).tex
176185
@$$(call E, pdflatex: $$@)
177186
$$(Q)$$(CFG_PDFLATEX) \
178187
-interaction=batchmode \
179188
-output-directory=doc \
180189
$$<
190+
endif # SHOULD_BUILD_PDF_DOCS_$(1)
181191
endif # NO_PDF_DOCS
182192

183193
endif # ONLY_HTML_DOCS

0 commit comments

Comments
 (0)