]> git.lizzy.rs Git - rust.git/blobdiff - mk/docs.mk
librustc: Don't try to perform the magical
[rust.git] / mk / docs.mk
index 91ff72ed2b53ee3cf3bc206b7e23f64e1da0bd66..8098a0682a5d0f719d31f4d5b07cab8182382db9 100644 (file)
@@ -26,9 +26,9 @@
 # L10N_LANGS are the languages for which the docs have been
 # translated.
 ######################################################################
-DOCS := index intro tutorial guide-ffi guide-macros guide-lifetimes \
+DOCS := index intro tutorial guide guide-ffi guide-macros guide-lifetimes \
        guide-tasks guide-container guide-pointers guide-testing \
-       guide-runtime complement-bugreport complement-cheatsheet \
+       guide-runtime complement-bugreport \
        complement-lang-faq complement-design-faq complement-project-faq rust \
     rustdoc guide-unsafe
 
@@ -43,7 +43,9 @@ L10N_LANGS := ja
 
 # The options are passed to the documentation generators.
 RUSTDOC_HTML_OPTS_NO_CSS = --markdown-before-content=doc/version_info.html \
-       --markdown-in-header=doc/favicon.inc --markdown-after-content=doc/footer.inc
+       --markdown-in-header=doc/favicon.inc \
+       --markdown-after-content=doc/footer.inc \
+       --markdown-playground-url='http://play.rust-lang.org/'
 
 RUSTDOC_HTML_OPTS = $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css rust.css
 
@@ -110,7 +112,7 @@ HTML_DEPS += doc/version_info.html
 doc/version_info.html: $(D)/version_info.html.template $(MKFILE_DEPS) \
                        $(wildcard $(D)/*.*) | doc/
        @$(call E, version-info: $@)
-       sed -e "s/VERSION/$(CFG_RELEASE)/; s/SHORT_HASH/$(shell echo \
+       $(Q)sed -e "s/VERSION/$(CFG_RELEASE)/; s/SHORT_HASH/$(shell echo \
                     $(CFG_VER_HASH) | head -c 8)/;\
                 s/STAMP/$(CFG_VER_HASH)/;" $< >$@
 
@@ -156,7 +158,9 @@ doc/footer.tex: $(D)/footer.inc | doc/
 # HTML (rustdoc)
 DOC_TARGETS += doc/not_found.html
 doc/not_found.html: $(D)/not_found.md $(HTML_DEPS) | doc/
-       $(RUSTDOC) $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css http://doc.rust-lang.org/rust.css $<
+       @$(call E, rustdoc: $@)
+       $(Q)$(RUSTDOC) $(RUSTDOC_HTML_OPTS_NO_CSS) \
+               --markdown-css http://doc.rust-lang.org/rust.css $<
 
 define DEF_DOC
 
@@ -164,7 +168,7 @@ define DEF_DOC
 DOC_TARGETS += doc/$(1).html
 doc/$(1).html: $$(D)/$(1).md $$(HTML_DEPS) $$(RUSTDOC_DEPS_$(1)) | doc/
        @$$(call E, rustdoc: $$@)
-       $$(RUSTDOC) $$(RUSTDOC_HTML_OPTS) $$(RUSTDOC_FLAGS_$(1)) $$<
+       $$(Q)$$(RUSTDOC) $$(RUSTDOC_HTML_OPTS) $$(RUSTDOC_FLAGS_$(1)) $$<
 
 ifneq ($(ONLY_HTML_DOCS),1)
 
@@ -269,14 +273,18 @@ LIB_DOC_DEP_$(1) = \
        $$(RSINPUTS_$(1)) \
        $$(RUSTDOC_EXE) \
        $$(foreach dep,$$(RUST_DEPS_$(1)), \
-               $$(TLIB2_T_$(CFG_BUILD)_H_$(CFG_BUILD))/stamp.$$(dep))
+               $$(TLIB2_T_$(CFG_BUILD)_H_$(CFG_BUILD))/stamp.$$(dep) \
+               doc/$$(dep)/)
 else
 LIB_DOC_DEP_$(1) = $$(CRATEFILE_$(1)) $$(RSINPUTS_$(1))
 endif
 
+doc/$(1)/:
+       $$(Q)mkdir -p $$@
+
 $(2) += doc/$(1)/index.html
 doc/$(1)/index.html: CFG_COMPILER_HOST_TRIPLE = $(CFG_TARGET)
-doc/$(1)/index.html: $$(LIB_DOC_DEP_$(1))
+doc/$(1)/index.html: $$(LIB_DOC_DEP_$(1)) doc/$(1)/
        @$$(call E, rustdoc $$@)
        $$(Q)$$(RUSTDOC) --cfg dox --cfg stage2 $$<
 endef
@@ -287,6 +295,7 @@ $(foreach crate,$(COMPILER_DOC_CRATES),$(eval $(call DEF_LIB_DOC,$(crate),COMPIL
 ifdef CFG_DISABLE_DOCS
   $(info cfg: disabling doc build (CFG_DISABLE_DOCS))
   DOC_TARGETS :=
+  COMPILER_DOC_TARGETS :=
 endif
 
 docs: $(DOC_TARGETS)