Skip to content

Commit

Permalink
mk: only build PDFs of the manual and tutorial.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
huonw committed Mar 9, 2014
1 parent bb8ac21 commit b4815ad
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions mk/docs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand All @@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand All @@ -171,13 +179,15 @@ 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: $$@)
$$(Q)$$(CFG_PDFLATEX) \
-interaction=batchmode \
-output-directory=doc \
$$<
endif # SHOULD_BUILD_PDF_DOCS_$(1)
endif # NO_PDF_DOCS

endif # ONLY_HTML_DOCS
Expand Down

0 comments on commit b4815ad

Please sign in to comment.