Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Replaced build script with make file

  • Loading branch information...
commit 9cee3832d2285c562c3aa88f9c0c847f6f9e1ef5 1 parent 3f339c8
@iainmcgin iainmcgin authored
Showing with 96 additions and 63 deletions.
  1. +96 −0 Makefile
  2. +0 −63 build.sh
View
96 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
+
View
63 build.sh
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.