2013-10-11 20:21:46 +02:00
|
|
|
# Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
|
2012-12-11 02:32:48 +01:00
|
|
|
# file at the top-level directory of this distribution and at
|
|
|
|
# http://rust-lang.org/COPYRIGHT.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
# <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
# option. This file may not be copied, modified, or distributed
|
|
|
|
# except according to those terms.
|
|
|
|
|
2011-05-01 22:18:52 +02:00
|
|
|
######################################################################
|
|
|
|
# Doc variables and rules
|
|
|
|
######################################################################
|
|
|
|
|
2012-01-18 23:14:28 +01:00
|
|
|
DOCS :=
|
2013-12-29 06:13:19 +01:00
|
|
|
CDOCS :=
|
2013-08-08 15:38:33 +02:00
|
|
|
DOCS_L10N :=
|
2014-01-28 23:15:29 +01:00
|
|
|
HTML_DEPS := doc/
|
2011-05-01 22:18:52 +02:00
|
|
|
|
2014-01-17 19:38:48 +01:00
|
|
|
BASE_DOC_OPTS := --standalone --toc --number-sections
|
|
|
|
HTML_OPTS = $(BASE_DOC_OPTS) --to=html5 --section-divs --css=rust.css \
|
2014-02-07 20:46:39 +01:00
|
|
|
--include-before-body=doc/version_info.html \
|
|
|
|
--include-in-header=doc/favicon.inc --include-after-body=doc/footer.inc
|
|
|
|
TEX_OPTS = $(BASE_DOC_OPTS) --include-before-body=doc/version.md \
|
|
|
|
--from=markdown --include-before-body=doc/footer.tex --to=latex
|
2013-11-11 22:17:54 +01:00
|
|
|
EPUB_OPTS = $(BASE_DOC_OPTS) --to=epub
|
2012-01-13 04:10:30 +01:00
|
|
|
|
2014-01-28 23:15:29 +01:00
|
|
|
D := $(S)src/doc
|
|
|
|
|
2014-01-06 22:38:20 +01:00
|
|
|
######################################################################
|
|
|
|
# Rust version
|
|
|
|
######################################################################
|
2014-01-17 19:38:48 +01:00
|
|
|
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/version.md: $(MKFILE_DEPS) $(wildcard $(D)/*.*) | doc/
|
2014-01-06 22:38:20 +01:00
|
|
|
@$(call E, version-stamp: $@)
|
|
|
|
$(Q)echo "$(CFG_VERSION)" >$@
|
|
|
|
|
|
|
|
HTML_DEPS += doc/version_info.html
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/version_info.html: $(D)/version_info.html.template $(MKFILE_DEPS) \
|
|
|
|
$(wildcard $(D)/*.*) | doc/
|
2014-01-06 22:38:20 +01:00
|
|
|
@$(call E, version-info: $@)
|
|
|
|
sed -e "s/VERSION/$(CFG_RELEASE)/; s/SHORT_HASH/$(shell echo \
|
|
|
|
$(CFG_VER_HASH) | head -c 8)/;\
|
|
|
|
s/STAMP/$(CFG_VER_HASH)/;" $< >$@
|
|
|
|
|
|
|
|
GENERATED += doc/version.md doc/version_info.html
|
|
|
|
|
2012-01-18 23:14:28 +01:00
|
|
|
######################################################################
|
2013-04-24 07:51:48 +02:00
|
|
|
# Docs, from pandoc, rustdoc (which runs pandoc), and node
|
2012-01-18 23:14:28 +01:00
|
|
|
######################################################################
|
2012-03-21 01:50:32 +01:00
|
|
|
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/:
|
|
|
|
@mkdir -p $@
|
|
|
|
|
2013-12-23 03:21:45 +01:00
|
|
|
HTML_DEPS += doc/rust.css
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/rust.css: $(D)/rust.css | doc/
|
2012-03-27 02:59:09 +02:00
|
|
|
@$(call E, cp: $@)
|
|
|
|
$(Q)cp -a $< $@ 2> /dev/null
|
|
|
|
|
2014-02-07 20:46:39 +01:00
|
|
|
HTML_DEPS += doc/favicon.inc
|
|
|
|
doc/favicon.inc: $(D)/favicon.inc | doc/
|
|
|
|
@$(call E, cp: $@)
|
|
|
|
$(Q)cp -a $< $@ 2> /dev/null
|
|
|
|
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/full-toc.inc: $(D)/full-toc.inc | doc/
|
2012-12-15 03:06:11 +01:00
|
|
|
@$(call E, cp: $@)
|
|
|
|
$(Q)cp -a $< $@ 2> /dev/null
|
|
|
|
|
2014-02-07 20:46:39 +01:00
|
|
|
HTML_DEPS += doc/footer.inc
|
|
|
|
doc/footer.inc: $(D)/footer.inc | doc/
|
|
|
|
@$(call E, cp: $@)
|
|
|
|
$(Q)cp -a $< $@ 2> /dev/null
|
|
|
|
|
|
|
|
doc/footer.tex: $(D)/footer.tex | doc/
|
2013-11-11 16:13:56 +01:00
|
|
|
@$(call E, cp: $@)
|
|
|
|
$(Q)cp -a $< $@ 2> /dev/null
|
|
|
|
|
2013-04-24 07:51:48 +02:00
|
|
|
ifeq ($(CFG_PANDOC),)
|
|
|
|
$(info cfg: no pandoc found, omitting docs)
|
|
|
|
NO_DOCS = 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(CFG_NODE),)
|
|
|
|
$(info cfg: no node found, omitting docs)
|
|
|
|
NO_DOCS = 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(NO_DOCS),1)
|
|
|
|
|
2012-01-19 14:19:23 +01:00
|
|
|
DOCS += doc/rust.html
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/rust.html: $(D)/rust.md doc/full-toc.inc $(HTML_DEPS) | doc/
|
2012-01-13 04:10:30 +01:00
|
|
|
@$(call E, pandoc: $@)
|
2014-01-28 23:15:29 +01:00
|
|
|
$(Q)$(CFG_NODE) $(D)/prep.js --highlight $< | \
|
2013-12-23 03:21:45 +01:00
|
|
|
$(CFG_PANDOC) $(HTML_OPTS) --include-in-header=doc/full-toc.inc --output=$@
|
2012-01-13 04:10:30 +01:00
|
|
|
|
2013-05-01 02:45:08 +02:00
|
|
|
DOCS += doc/rust.tex
|
2014-02-07 20:46:39 +01:00
|
|
|
doc/rust.tex: $(D)/rust.md doc/footer.tex doc/version.md | doc/
|
2012-01-13 04:10:30 +01:00
|
|
|
@$(call E, pandoc: $@)
|
2014-01-28 23:15:29 +01:00
|
|
|
$(Q)$(CFG_NODE) $(D)/prep.js $< | \
|
2013-11-11 22:17:54 +01:00
|
|
|
$(CFG_PANDOC) $(TEX_OPTS) --output=$@
|
2013-10-11 20:21:46 +02:00
|
|
|
|
2013-11-01 20:13:00 +01:00
|
|
|
DOCS += doc/rust.epub
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/rust.epub: $(D)/rust.md | doc/
|
2013-11-01 20:13:00 +01:00
|
|
|
@$(call E, pandoc: $@)
|
2014-01-28 23:15:29 +01:00
|
|
|
$(Q)$(CFG_NODE) $(D)/prep.js --highlight $< | \
|
2013-11-11 22:17:54 +01:00
|
|
|
$(CFG_PANDOC) $(EPUB_OPTS) --output=$@
|
2013-11-01 20:13:00 +01:00
|
|
|
|
2013-12-06 17:29:58 +01:00
|
|
|
DOCS += doc/rustdoc.html
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/rustdoc.html: $(D)/rustdoc.md $(HTML_DEPS)
|
2013-12-06 17:29:58 +01:00
|
|
|
@$(call E, pandoc: $@)
|
2014-01-28 23:15:29 +01:00
|
|
|
$(Q)$(CFG_NODE) $(D)/prep.js --highlight $< | \
|
2013-12-06 17:29:58 +01:00
|
|
|
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
|
|
|
|
2012-01-19 12:51:20 +01:00
|
|
|
DOCS += doc/tutorial.html
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/tutorial.html: $(D)/tutorial.md $(HTML_DEPS)
|
2012-01-19 12:51:20 +01:00
|
|
|
@$(call E, pandoc: $@)
|
2014-01-28 23:15:29 +01:00
|
|
|
$(Q)$(CFG_NODE) $(D)/prep.js --highlight $< | \
|
2013-11-11 22:17:54 +01:00
|
|
|
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
2012-09-05 20:03:36 +02:00
|
|
|
|
2013-11-11 16:13:56 +01:00
|
|
|
DOCS += doc/tutorial.tex
|
2014-02-07 20:46:39 +01:00
|
|
|
doc/tutorial.tex: $(D)/tutorial.md doc/footer.tex doc/version.md
|
2013-11-11 16:13:56 +01:00
|
|
|
@$(call E, pandoc: $@)
|
2014-01-28 23:15:29 +01:00
|
|
|
$(Q)$(CFG_NODE) $(D)/prep.js $< | \
|
2013-11-11 22:17:54 +01:00
|
|
|
$(CFG_PANDOC) $(TEX_OPTS) --output=$@
|
2013-11-11 16:13:56 +01:00
|
|
|
|
2013-11-01 20:13:00 +01:00
|
|
|
DOCS += doc/tutorial.epub
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/tutorial.epub: $(D)/tutorial.md
|
2013-11-01 20:13:00 +01:00
|
|
|
@$(call E, pandoc: $@)
|
2014-01-28 23:15:29 +01:00
|
|
|
$(Q)$(CFG_NODE) $(D)/prep.js --highlight $< | \
|
2013-11-11 22:17:54 +01:00
|
|
|
$(CFG_PANDOC) $(EPUB_OPTS) --output=$@
|
2013-11-01 20:13:00 +01:00
|
|
|
|
|
|
|
|
2013-08-08 15:38:33 +02:00
|
|
|
DOCS_L10N += doc/l10n/ja/tutorial.html
|
|
|
|
doc/l10n/ja/tutorial.html: doc/l10n/ja/tutorial.md doc/version_info.html doc/rust.css
|
|
|
|
@$(call E, pandoc: $@)
|
2014-01-28 23:15:29 +01:00
|
|
|
$(Q)$(CFG_NODE) $(D)/prep.js --highlight doc/l10n/ja/tutorial.md | \
|
2013-08-08 15:38:33 +02:00
|
|
|
$(CFG_PANDOC) --standalone --toc \
|
|
|
|
--section-divs --number-sections \
|
2013-10-11 19:18:43 +02:00
|
|
|
--from=markdown --to=html5 --css=../../rust.css \
|
2013-10-11 20:21:46 +02:00
|
|
|
--include-before-body=doc/version_info.html \
|
2013-08-08 15:38:33 +02:00
|
|
|
--output=$@
|
|
|
|
|
2013-12-23 03:21:45 +01:00
|
|
|
# Complementary documentation
|
|
|
|
#
|
|
|
|
DOCS += doc/index.html
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/index.html: $(D)/index.md $(HTML_DEPS)
|
2013-12-23 03:21:45 +01:00
|
|
|
@$(call E, pandoc: $@)
|
2014-01-28 23:15:29 +01:00
|
|
|
$(Q)$(CFG_NODE) $(D)/prep.js --highlight $< | \
|
2013-12-23 03:21:45 +01:00
|
|
|
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
|
|
|
|
|
|
|
DOCS += doc/complement-lang-faq.html
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/complement-lang-faq.html: $(D)/complement-lang-faq.md doc/full-toc.inc $(HTML_DEPS)
|
2013-12-23 03:21:45 +01:00
|
|
|
@$(call E, pandoc: $@)
|
2014-01-28 23:15:29 +01:00
|
|
|
$(Q)$(CFG_NODE) $(D)/prep.js --highlight $< | \
|
2013-12-23 03:21:45 +01:00
|
|
|
$(CFG_PANDOC) $(HTML_OPTS) --include-in-header=doc/full-toc.inc --output=$@
|
|
|
|
|
|
|
|
DOCS += doc/complement-project-faq.html
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/complement-project-faq.html: $(D)/complement-project-faq.md $(HTML_DEPS)
|
2013-12-23 03:21:45 +01:00
|
|
|
@$(call E, pandoc: $@)
|
2014-01-28 23:15:29 +01:00
|
|
|
$(Q)$(CFG_NODE) $(D)/prep.js --highlight $< | \
|
2013-12-23 03:21:45 +01:00
|
|
|
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
|
|
|
|
|
|
|
DOCS += doc/complement-cheatsheet.html
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/complement-cheatsheet.html: $(D)/complement-cheatsheet.md doc/full-toc.inc $(HTML_DEPS)
|
2013-12-23 03:21:45 +01:00
|
|
|
@$(call E, pandoc: $@)
|
2014-01-28 23:15:29 +01:00
|
|
|
$(Q)$(CFG_NODE) $(D)/prep.js --highlight $< | \
|
2013-12-23 03:21:45 +01:00
|
|
|
$(CFG_PANDOC) $(HTML_OPTS) --include-in-header=doc/full-toc.inc --output=$@
|
|
|
|
|
|
|
|
DOCS += doc/complement-bugreport.html
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/complement-bugreport.html: $(D)/complement-bugreport.md $(HTML_DEPS)
|
2013-12-23 03:21:45 +01:00
|
|
|
@$(call E, pandoc: $@)
|
2014-01-28 23:15:29 +01:00
|
|
|
$(Q)$(CFG_NODE) $(D)/prep.js --highlight $< | \
|
2013-12-23 03:21:45 +01:00
|
|
|
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
|
|
|
|
2013-12-22 00:29:48 +01:00
|
|
|
# Guides
|
|
|
|
|
|
|
|
DOCS += doc/guide-macros.html
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/guide-macros.html: $(D)/guide-macros.md $(HTML_DEPS)
|
2012-09-05 20:03:36 +02:00
|
|
|
@$(call E, pandoc: $@)
|
2014-01-28 23:15:29 +01:00
|
|
|
$(Q)$(CFG_NODE) $(D)/prep.js --highlight $< | \
|
2013-11-11 22:17:54 +01:00
|
|
|
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
2012-09-05 20:20:04 +02:00
|
|
|
|
2013-12-22 00:29:48 +01:00
|
|
|
DOCS += doc/guide-container.html
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/guide-container.html: $(D)/guide-container.md $(HTML_DEPS)
|
2013-06-28 00:48:12 +02:00
|
|
|
@$(call E, pandoc: $@)
|
2014-01-28 23:15:29 +01:00
|
|
|
$(Q)$(CFG_NODE) $(D)/prep.js --highlight $< | \
|
2013-11-11 22:17:54 +01:00
|
|
|
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
2013-06-28 00:48:12 +02:00
|
|
|
|
2013-12-22 00:29:48 +01:00
|
|
|
DOCS += doc/guide-ffi.html
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/guide-ffi.html: $(D)/guide-ffi.md $(HTML_DEPS)
|
2012-09-05 20:20:04 +02:00
|
|
|
@$(call E, pandoc: $@)
|
2014-01-28 23:15:29 +01:00
|
|
|
$(Q)$(CFG_NODE) $(D)/prep.js --highlight $< | \
|
2013-11-11 22:17:54 +01:00
|
|
|
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
2012-09-16 02:09:21 +02:00
|
|
|
|
2013-12-22 00:29:48 +01:00
|
|
|
DOCS += doc/guide-testing.html
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/guide-testing.html: $(D)/guide-testing.md $(HTML_DEPS)
|
2013-12-18 18:38:14 +01:00
|
|
|
@$(call E, pandoc: $@)
|
2014-01-28 23:15:29 +01:00
|
|
|
$(Q)$(CFG_NODE) $(D)/prep.js --highlight $< | \
|
2013-12-18 18:38:14 +01:00
|
|
|
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
|
|
|
|
2013-09-28 02:03:34 +02:00
|
|
|
DOCS += doc/guide-lifetimes.html
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/guide-lifetimes.html: $(D)/guide-lifetimes.md $(HTML_DEPS)
|
2012-09-16 02:09:21 +02:00
|
|
|
@$(call E, pandoc: $@)
|
2014-01-28 23:15:29 +01:00
|
|
|
$(Q)$(CFG_NODE) $(D)/prep.js --highlight $< | \
|
2013-11-11 22:17:54 +01:00
|
|
|
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
2012-09-23 00:33:50 +02:00
|
|
|
|
2013-12-22 00:29:48 +01:00
|
|
|
DOCS += doc/guide-tasks.html
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/guide-tasks.html: $(D)/guide-tasks.md $(HTML_DEPS)
|
2012-09-23 00:33:50 +02:00
|
|
|
@$(call E, pandoc: $@)
|
2014-01-28 23:15:29 +01:00
|
|
|
$(Q)$(CFG_NODE) $(D)/prep.js --highlight $< | \
|
2013-11-11 22:17:54 +01:00
|
|
|
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
2012-01-19 12:51:20 +01:00
|
|
|
|
2013-09-28 02:03:34 +02:00
|
|
|
DOCS += doc/guide-pointers.html
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/guide-pointers.html: $(D)/guide-pointers.md $(HTML_DEPS)
|
2013-09-28 02:03:34 +02:00
|
|
|
@$(call E, pandoc: $@)
|
2014-01-28 23:15:29 +01:00
|
|
|
$(Q)$(CFG_NODE) $(D)/prep.js --highlight $< | \
|
2013-09-28 02:03:34 +02:00
|
|
|
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
|
|
|
|
2014-01-11 01:34:55 +01:00
|
|
|
DOCS += doc/guide-runtime.html
|
2014-01-28 23:15:29 +01:00
|
|
|
doc/guide-runtime.html: $(D)/guide-runtime.md $(HTML_DEPS)
|
2014-01-11 01:34:55 +01:00
|
|
|
@$(call E, pandoc: $@)
|
2014-01-28 23:15:29 +01:00
|
|
|
$(Q)$(CFG_NODE) $(D)/prep.js --highlight $< | \
|
2014-01-11 01:34:55 +01:00
|
|
|
$(CFG_PANDOC) $(HTML_OPTS) --output=$@
|
|
|
|
|
2013-04-24 07:51:48 +02:00
|
|
|
ifeq ($(CFG_PDFLATEX),)
|
|
|
|
$(info cfg: no pdflatex found, omitting doc/rust.pdf)
|
|
|
|
else
|
|
|
|
ifeq ($(CFG_XETEX),)
|
|
|
|
$(info cfg: no xetex found, disabling doc/rust.pdf)
|
|
|
|
else
|
|
|
|
ifeq ($(CFG_LUATEX),)
|
|
|
|
$(info cfg: lacking luatex, disabling pdflatex)
|
|
|
|
else
|
|
|
|
|
2013-05-01 02:45:08 +02:00
|
|
|
DOCS += doc/rust.pdf
|
2013-04-24 07:51:48 +02:00
|
|
|
doc/rust.pdf: doc/rust.tex
|
|
|
|
@$(call E, pdflatex: $@)
|
|
|
|
$(Q)$(CFG_PDFLATEX) \
|
|
|
|
-interaction=batchmode \
|
|
|
|
-output-directory=doc \
|
|
|
|
$<
|
|
|
|
|
2013-10-11 20:21:46 +02:00
|
|
|
DOCS += doc/tutorial.pdf
|
|
|
|
doc/tutorial.pdf: doc/tutorial.tex
|
|
|
|
@$(call E, pdflatex: $@)
|
|
|
|
$(Q)$(CFG_PDFLATEX) \
|
|
|
|
-interaction=batchmode \
|
|
|
|
-output-directory=doc \
|
|
|
|
$<
|
|
|
|
|
2013-04-24 07:51:48 +02:00
|
|
|
endif
|
|
|
|
endif
|
2012-01-19 12:51:20 +01:00
|
|
|
endif
|
2012-01-13 04:10:30 +01:00
|
|
|
|
2013-04-24 07:51:48 +02:00
|
|
|
endif # No pandoc / node
|
2012-01-18 23:14:28 +01:00
|
|
|
|
|
|
|
######################################################################
|
|
|
|
# LLnextgen (grammar analysis from refman)
|
|
|
|
######################################################################
|
2014-01-17 19:38:48 +01:00
|
|
|
|
2012-01-18 23:14:28 +01:00
|
|
|
ifeq ($(CFG_LLNEXTGEN),)
|
|
|
|
$(info cfg: no llnextgen found, omitting grammar-verification)
|
|
|
|
else
|
|
|
|
.PHONY: verify-grammar
|
|
|
|
|
|
|
|
doc/rust.g: rust.md $(S)src/etc/extract_grammar.py
|
|
|
|
@$(call E, extract_grammar: $@)
|
2013-01-03 08:53:05 +01:00
|
|
|
$(Q)$(CFG_PYTHON) $(S)src/etc/extract_grammar.py $< >$@
|
2012-01-18 23:14:28 +01:00
|
|
|
|
|
|
|
verify-grammar: doc/rust.g
|
|
|
|
@$(call E, LLnextgen: $<)
|
|
|
|
$(Q)$(CFG_LLNEXTGEN) --generate-lexer-wrapper=no $< >$@
|
|
|
|
$(Q)rm -f doc/rust.c doc/rust.h
|
2012-01-18 01:49:57 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
|
2012-01-18 23:14:28 +01:00
|
|
|
######################################################################
|
2013-05-17 19:45:09 +02:00
|
|
|
# Rustdoc (libstd/extra)
|
2012-01-18 23:14:28 +01:00
|
|
|
######################################################################
|
2011-05-01 22:18:52 +02:00
|
|
|
|
2014-01-28 23:15:29 +01:00
|
|
|
# The rustdoc executable, rpath included in case --disable-rpath was provided to
|
|
|
|
# ./configure
|
2014-02-07 00:43:27 +01:00
|
|
|
RUSTDOC = $(HBIN2_H_$(CFG_BUILD))/rustdoc$(X_$(CFG_BUILD))
|
2011-12-06 01:46:37 +01:00
|
|
|
|
2012-03-10 07:53:46 +01:00
|
|
|
# The library documenting macro
|
2014-01-25 04:27:22 +01:00
|
|
|
#
|
2013-09-22 08:25:48 +02:00
|
|
|
# $(1) - The crate name (std/extra)
|
2013-11-25 05:31:21 +01:00
|
|
|
#
|
|
|
|
# Passes --cfg stage2 to rustdoc because it uses the stage2 librustc.
|
2012-03-10 07:53:46 +01:00
|
|
|
define libdoc
|
2014-01-25 04:27:22 +01:00
|
|
|
doc/$(1)/index.html: \
|
|
|
|
$$(CRATEFILE_$(1)) \
|
|
|
|
$$(RSINPUTS_$(1)) \
|
|
|
|
$$(RUSTDOC) \
|
|
|
|
$$(foreach dep,$$(RUST_DEPS_$(1)), \
|
|
|
|
$$(TLIB2_T_$(CFG_BUILD)_H_$(CFG_BUILD))/stamp.$$(dep))
|
2013-12-29 06:13:19 +01:00
|
|
|
@$$(call E, rustdoc: $$@)
|
2014-02-07 00:43:27 +01:00
|
|
|
$$(Q)$$(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $$(RUSTDOC) \
|
|
|
|
--cfg stage2 $$<
|
|
|
|
|
2013-12-29 06:13:19 +01:00
|
|
|
endef
|
|
|
|
|
2014-01-25 04:27:22 +01:00
|
|
|
$(foreach crate,$(CRATES),$(eval $(call libdoc,$(crate))))
|
2013-12-29 06:13:19 +01:00
|
|
|
|
2014-01-25 04:27:22 +01:00
|
|
|
DOCS += $(DOC_CRATES:%=doc/%/index.html)
|
2012-01-18 23:14:28 +01:00
|
|
|
|
2014-01-25 04:27:22 +01:00
|
|
|
CDOCS += doc/rustc/index.html
|
|
|
|
CDOCS += doc/syntax/index.html
|
2012-01-18 23:14:28 +01:00
|
|
|
|
|
|
|
ifdef CFG_DISABLE_DOCS
|
|
|
|
$(info cfg: disabling doc build (CFG_DISABLE_DOCS))
|
|
|
|
DOCS :=
|
|
|
|
endif
|
|
|
|
|
2011-12-30 21:47:43 +01:00
|
|
|
docs: $(DOCS)
|
2013-12-29 06:13:19 +01:00
|
|
|
compiler-docs: $(CDOCS)
|
2013-07-07 21:12:00 +02:00
|
|
|
|
2013-08-08 15:38:33 +02:00
|
|
|
docs-l10n: $(DOCS_L10N)
|
|
|
|
|
|
|
|
doc/l10n/%.md: doc/po/%.md.po doc/po4a.conf
|
2013-07-17 00:18:42 +02:00
|
|
|
po4a --copyright-holder="The Rust Project Developers" \
|
|
|
|
--package-name="Rust" \
|
|
|
|
--package-version="$(CFG_RELEASE)" \
|
2013-07-30 00:05:47 +02:00
|
|
|
-M UTF-8 -L UTF-8 \
|
2013-07-17 00:18:42 +02:00
|
|
|
doc/po4a.conf
|
2013-07-07 21:12:00 +02:00
|
|
|
|
|
|
|
.PHONY: docs-l10n
|