about summary refs log tree commit diff
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2013-04-23 22:51:48 -0700
committerBrian Anderson <banderson@mozilla.com>2013-04-23 23:52:58 -0700
commit34f7255afa4aa80ade1f98b99f0f54cb424b129e (patch)
treef23999082052cf62e7a84cbb85dd95adf0c8cf9e
parent354460e53b8de468db77433e97e7cdf809c68ccd (diff)
downloadrust-34f7255afa4aa80ade1f98b99f0f54cb424b129e.tar.gz
rust-34f7255afa4aa80ade1f98b99f0f54cb424b129e.zip
mk: reorganize doc build to fix dependencies. #6042
Most of our documentation requires both pandoc and node.js.
This simplifies the logic around those checks and fixes an
error when building without node.js but with pandoc.
-rw-r--r--mk/docs.mk71
1 files changed, 33 insertions, 38 deletions
diff --git a/mk/docs.mk b/mk/docs.mk
index 6873d433e95..252f62cf871 100644
--- a/mk/docs.mk
+++ b/mk/docs.mk
@@ -16,15 +16,8 @@ DOCS :=
 
 
 ######################################################################
-# Pandoc (reference-manual related)
+# Docs, from pandoc, rustdoc (which runs pandoc), and node
 ######################################################################
-ifeq ($(CFG_PANDOC),)
-  $(info cfg: no pandoc found, omitting doc/rust.pdf)
-else
-
-  ifeq ($(CFG_NODE),)
-    $(info cfg: no node found, omitting doc/tutorial.html)
-  else
 
 doc/rust.css: rust.css
 	@$(call E, cp: $@)
@@ -34,6 +27,18 @@ doc/manual.css: manual.css
 	@$(call E, cp: $@)
 	$(Q)cp -a $< $@ 2> /dev/null
 
+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)
+
 DOCS += doc/rust.html
 doc/rust.html: rust.md doc/version_info.html doc/rust.css doc/manual.css
 	@$(call E, pandoc: $@)
@@ -47,17 +52,6 @@ doc/rust.html: rust.md doc/version_info.html doc/rust.css doc/manual.css
          --css=manual.css \
 	     --include-before-body=doc/version_info.html \
          --output=$@
-  endif
-
-  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
 
 DOCS += doc/rust.pdf
 doc/rust.tex: rust.md doc/version.md
@@ -70,17 +64,6 @@ doc/rust.tex: rust.md doc/version.md
          --from=markdown --to=latex \
          --output=$@
 
-doc/rust.pdf: doc/rust.tex
-	@$(call E, pdflatex: $@)
-	$(Q)$(CFG_PDFLATEX) \
-        -interaction=batchmode \
-        -output-directory=doc \
-        $<
-
-      endif
-    endif
-  endif
-
 DOCS += doc/rustpkg.html
 doc/rustpkg.html: rustpkg.md doc/version_info.html doc/rust.css doc/manual.css
 	@$(call E, pandoc: $@)
@@ -95,13 +78,6 @@ doc/rustpkg.html: rustpkg.md doc/version_info.html doc/rust.css doc/manual.css
 	     --include-before-body=doc/version_info.html \
          --output=$@
 
-######################################################################
-# Node (tutorial related)
-######################################################################
-  ifeq ($(CFG_NODE),)
-    $(info cfg: no node found, omitting doc/tutorial.html)
-  else
-
 DOCS += doc/tutorial.html
 doc/tutorial.html: tutorial.md doc/version_info.html doc/rust.css
 	@$(call E, pandoc: $@)
@@ -153,9 +129,28 @@ doc/tutorial-tasks.html: tutorial-tasks.md doc/version_info.html doc/rust.css
 	   --include-before-body=doc/version_info.html \
            --output=$@
 
+  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
+
+doc/rust.pdf: doc/rust.tex
+	@$(call E, pdflatex: $@)
+	$(Q)$(CFG_PDFLATEX) \
+        -interaction=batchmode \
+        -output-directory=doc \
+        $<
+
+      endif
+    endif
   endif
-endif
 
+endif # No pandoc / node
 
 ######################################################################
 # LLnextgen (grammar analysis from refman)