about summary refs log tree commit diff
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2014-03-09 15:54:16 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2014-03-09 20:59:43 +1100
commitb4815ad1baffb2603f7580cbdf1ac1b01879b767 (patch)
treea178bd283545d0876d001e5adc58e26b32868019
parentbb8ac2159feb1739992b1b511a0a9afeaab10a8e (diff)
downloadrust-b4815ad1baffb2603f7580cbdf1ac1b01879b767.tar.gz
rust-b4815ad1baffb2603f7580cbdf1ac1b01879b767.zip
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.
-rw-r--r--mk/docs.mk14
1 files changed, 12 insertions, 2 deletions
diff --git a/mk/docs.mk b/mk/docs.mk
index 72ef088704c..00832e08216 100644
--- a/mk/docs.mk
+++ b/mk/docs.mk
@@ -14,6 +14,9 @@
 #
 # The DOCS variable is their names (with no file extension).
 #
+# PDF_DOCS lists the targets for which PDF documentation should be
+# build.
+#
 # RUSTDOC_FLAGS_xyz variables are extra arguments to pass to the
 # rustdoc invocation for xyz.
 #
@@ -28,6 +31,8 @@ DOCS := index tutorial guide-ffi guide-macros guide-lifetimes \
 	complement-cheatsheet guide-runtime \
 	rust rustdoc
 
+PDF_DOCS := tutorial rust
+
 RUSTDOC_DEPS_rust := doc/full-toc.inc
 RUSTDOC_FLAGS_rust := --markdown-in-header=doc/full-toc.inc
 
@@ -45,8 +50,6 @@ PANDOC_TEX_OPTS = $(PANDOC_BASE_OPTS) --include-before-body=doc/version.md \
 	--from=markdown --include-before-body=doc/footer.tex --to=latex
 PANDOC_EPUB_OPTS = $(PANDOC_BASE_OPTS) --to=epub
 
-
-
 # The rustdoc executable...
 RUSTDOC_EXE = $(HBIN2_H_$(CFG_BUILD))/rustdoc$(X_$(CFG_BUILD))
 # ...with rpath included in case --disable-rpath was provided to
@@ -146,6 +149,11 @@ doc/footer.tex: $(D)/footer.tex | doc/
 
 # The (english) documentation for each doc item.
 
+define DEF_SHOULD_BUILD_PDF_DOC
+SHOULD_BUILD_PDF_DOC_$(1) = 1
+endef
+$(foreach docname,$(PDF_DOCS),$(eval $(call DEF_SHOULD_BUILD_PDF_DOC,$(docname))))
+
 define DEF_DOC
 
 # HTML (rustdoc)
@@ -171,6 +179,7 @@ doc/$(1).tex: $$(D)/$(1).md doc/footer.tex doc/version.md | doc/
 	$$(CFG_PANDOC) $$(PANDOC_TEX_OPTS) --output=$$@
 
 ifneq ($(NO_PDF_DOCS),1)
+ifeq ($$(SHOULD_BUILD_PDF_DOC_$(1)),1)
 DOC_TARGETS += doc/$(1).pdf
 doc/$(1).pdf: doc/$(1).tex
 	@$$(call E, pdflatex: $$@)
@@ -178,6 +187,7 @@ doc/$(1).pdf: doc/$(1).tex
 	-interaction=batchmode \
 	-output-directory=doc \
 	$$<
+endif # SHOULD_BUILD_PDF_DOCS_$(1)
 endif # NO_PDF_DOCS
 
 endif # ONLY_HTML_DOCS