summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIain McGinniss <iainmcgin@gmail.com>2013-02-21 23:16:12 +0000
committerIain McGinniss <iainmcgin@gmail.com>2013-02-21 23:16:12 +0000
commit9cee3832d2285c562c3aa88f9c0c847f6f9e1ef5 (patch)
treeb03e9cdbdb2084d8923448f345b71f44ed56abaf
parent3f339c884720b4f8c3b3cba38c694512d9f0f877 (diff)
downloadscala-9cee3832d2285c562c3aa88f9c0c847f6f9e1ef5.tar.gz
scala-9cee3832d2285c562c3aa88f9c0c847f6f9e1ef5.tar.bz2
scala-9cee3832d2285c562c3aa88f9c0c847f6f9e1ef5.zip
Replaced build script with make file
-rw-r--r--Makefile96
-rwxr-xr-xbuild.sh63
2 files changed, 96 insertions, 63 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000000..c42602c242
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,96 @@
+MD_SOURCES := 01-title.md \
+ 02-preface.md 03-lexical-syntax.md \
+ 04-identifiers-names-and-scopes.md \
+ 05-types.md \
+ 06-basic-declarations-and-definitions.md \
+ 07-classes-and-objects.md \
+ 08-expressions.md \
+ 09-implicit-parameters-and-views.md \
+ 10-pattern-matching.md \
+ 11-top-level-definitions.md \
+ 12-xml-expressions-and-patterns.md \
+ 13-user-defined-annotations.md \
+ 14-the-scala-standard-library.md \
+ 15-scala-syntax-summary.md \
+ 16-references.md
+
+BUILD_DIR := build
+
+.PHONY: dirs all html pdf epub md clean
+
+
+all: html pdf epub md
+
+
+clean:
+ rm -rf $(BUILD_DIR)
+
+
+html: $(BUILD_DIR)/ScalaReference.html
+
+
+pdf: $(BUILD_DIR)/ScalaReference.pdf
+
+
+epub: $(BUILD_DIR)/ScalaReference.epub
+
+
+md: $(BUILD_DIR)/ScalaReference.md
+
+
+$(BUILD_DIR)/ScalaReference.epub: Scala.bib $(BUILD_DIR)/ScalaReference.md
+ @echo "building EPUB spec to $(BUILD_DIR)/ScalaReference.epub"
+ @pandoc -f markdown \
+ -t epub \
+ --standalone \
+ --toc \
+ --chapters \
+ --number-sections \
+ --bibliography=Scala.bib \
+ --self-contained \
+ -o build/ScalaReference.epub \
+ build/ScalaReference.md
+
+
+$(BUILD_DIR)/ScalaReference.pdf: Scala.bib $(BUILD_DIR)/ScalaReference.md
+ @echo "building PDF spec to $(BUILD_DIR)/ScalaReference.pdf"
+ @pandoc -f markdown \
+ --standalone \
+ --toc \
+ --chapters \
+ --number-sections \
+ --bibliography=Scala.bib \
+ --self-contained \
+ --latex-engine=xelatex \
+ --template=resources/scala-ref-template.latex \
+ -o build/ScalaReference.pdf \
+ build/ScalaReference.md
+
+
+$(BUILD_DIR)/ScalaReference.html: Scala.bib $(BUILD_DIR)/ScalaReference.md
+ @echo "building HTML spec to $(BUILD_DIR)/ScalaReference.html"
+ @pandoc -f markdown \
+ -t html5 \
+ --standalone \
+ --toc \
+ --chapters \
+ --number-sections \
+ --bibliography=Scala.bib \
+ --template=resources/scala-ref-template.html5 \
+ --mathjax='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' \
+ -o build/ScalaReference.html \
+ build/ScalaReference.md
+
+
+$(BUILD_DIR)/ScalaReference.md: dirs $(MD_SOURCES)
+ @echo "building Markdown source to $(BUILD_DIR)/ScalaReference.md"
+ @cat $(MD_SOURCES) > $(BUILD_DIR)/ScalaReference.md
+
+
+dirs: $(BUILD_DIR)
+
+
+$(BUILD_DIR):
+ mkdir -p $(BUILD_DIR)
+ cp -R resources $(BUILD_DIR)/resources
+
diff --git a/build.sh b/build.sh
deleted file mode 100755
index 38944f02f2..0000000000
--- a/build.sh
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/bin/sh
-
-if [ ! -d build ]; then
- mkdir -p build
-fi
-
-echo "building Markdown source to build/ScalaReference.md"
-cat 01-title.md \
- 02-preface.md \
- 03-lexical-syntax.md \
- 04-identifiers-names-and-scopes.md \
- 05-types.md \
- 06-basic-declarations-and-definitions.md \
- 07-classes-and-objects.md \
- 08-expressions.md \
- 09-implicit-parameters-and-views.md \
- 10-pattern-matching.md \
- 11-top-level-definitions.md \
- 12-xml-expressions-and-patterns.md \
- 13-user-defined-annotations.md \
- 14-the-scala-standard-library.md \
- 15-scala-syntax-summary.md \
- 16-references.md > build/ScalaReference.md
-
-echo "building HTML spec to build/ScalaReference.html"
-pandoc -f markdown \
- -t html5 \
- --standalone \
- --toc \
- --chapters \
- --number-sections \
- --bibliography=Scala.bib \
- --template=resources/scala-ref-template.html5 \
- --mathjax='http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' \
- -o build/ScalaReference.html \
- build/ScalaReference.md
-
-cp -Rf resources build/
-
-echo "building PDF spec to build/ScalaReference.pdf"
-pandoc -f markdown \
- --standalone \
- --toc \
- --chapters \
- --number-sections \
- --bibliography=Scala.bib \
- --self-contained \
- --latex-engine=xelatex \
- --template=resources/scala-ref-template.latex \
- -o build/ScalaReference.pdf \
- build/ScalaReference.md
-
-echo "building ebook to build/ScalaReference.epub"
-pandoc -f markdown \
- -t epub \
- --standalone \
- --toc \
- --chapters \
- --number-sections \
- --bibliography=Scala.bib \
- --self-contained \
- -o build/ScalaReference.epub \
- build/ScalaReference.md \ No newline at end of file