summaryrefslogtreecommitdiff
path: root/docs/Makefile
diff options
context:
space:
mode:
authorPeter Ward <peteraward@gmail.com>2012-07-29 23:43:29 +1000
committerPeter Ward <peteraward@gmail.com>2012-07-29 23:43:29 +1000
commitc35db75eba1f67c6d6bbca9fefe7aaefb6b6d6e9 (patch)
treed32b851da74ed9b053248351f308a734b8c2a8b6 /docs/Makefile
parentb62e033801895ad633f702685e50cf367ae0adee (diff)
Add start of tutorial.
Diffstat (limited to 'docs/Makefile')
-rw-r--r--docs/Makefile27
1 files changed, 27 insertions, 0 deletions
diff --git a/docs/Makefile b/docs/Makefile
new file mode 100644
index 0000000..8ea7df2
--- /dev/null
+++ b/docs/Makefile
@@ -0,0 +1,27 @@
+BUILD_DIR = build
+
+FILES = $(wildcard *.tex *.py)
+BUILD_FILES = $(patsubst %,${BUILD_DIR}/%,${FILES})
+
+LATEX=xelatex
+LATEX_FLAGS=-shell-escape
+
+.PHONY: all
+
+all: tutorial.pdf
+
+${BUILD_DIR}:
+ mkdir -p ${BUILD_DIR}
+
+${BUILD_DIR}/%.tex: %.tex ${BUILD_DIR}
+ ./jinja2 --latex < $< > $@
+
+${BUILD_DIR}/%.py: %.py
+ ln $< $@
+
+tutorial.pdf: ${BUILD_DIR}/tutorial.tex ${BUILD_FILES}
+ cd "${BUILD_DIR}" && \
+ ${LATEX} ${LATEX_FLAGS} tutorial
+ mv -f "${BUILD_DIR}/tutorial.pdf" tutorial.pdf
+# ${LATEX} ${LATEX_FLAGS} tutorial && \
+# ${LATEX} ${LATEX_FLAGS} tutorial && \