From 81f27d064869da72045cacb2ee30f0675a0e344e Mon Sep 17 00:00:00 2001 From: Pelle Nilsson Date: Mon, 3 Jun 2013 21:48:28 +0200 Subject: [PATCH] Created GNU Makefile to help build files. --- Makefile | 31 +++++++++++++++++++++++++++++++ test.sh | 9 +++------ 2 files changed, 34 insertions(+), 6 deletions(-) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..342fd2b --- /dev/null +++ b/Makefile @@ -0,0 +1,31 @@ +all: test.rtf test.pdf test.html test.debug test.png + +%.rtf: %.gamebook formatgamebook.py + ./formatgamebook.py $< $@ + +%.html: %.gamebook formatgamebook.py + ./formatgamebook.py $< $@ + +%.tex: %.gamebook formatgamebook.py + ./formatgamebook.py $< $@ + +%.dot: %.gamebook formatgamebook.py + ./formatgamebook.py $< $@ + +%.debug: %.gamebook formatgamebook.py + ./formatgamebook.py $< $@ + +%.pdf: %.tex + pdflatex $< + +%.png: %.dot + dot -Tpng $< > $@ + +clean: + $(RM) *.rtf *.html *.tex *.debug *.pdf *~ *.pyc *.dot \ + *.aux *.toc *.png + +.PHONY: all clean + +.PRECIOUS: %.tex %.dot + diff --git a/test.sh b/test.sh index c38e141..ae3b04e 100755 --- a/test.sh +++ b/test.sh @@ -1,18 +1,15 @@ #!/bin/sh -./formatgamebook.py test.gamebook test.debug +make clean all + cat test.debug -./formatgamebook.py test.gamebook test.dot dot -Tpng test.dot > test.png && open test.png -./formatgamebook.py test.gamebook test.tex -pdflatex test.tex && open test.pdf +open test.pdf -./formatgamebook.py test.gamebook test.html open test.html -./formatgamebook.py test.gamebook test.rtf open test.rtf