2013-06-04 23:36:09 +03:00
|
|
|
examples=$(wildcard examples/*.gamebook)
|
|
|
|
|
2014-09-24 23:01:02 +03:00
|
|
|
all: rtf pdf html json png txt
|
2013-06-08 20:59:55 +03:00
|
|
|
|
|
|
|
rtf: $(examples:.gamebook=.rtf)
|
2013-06-18 21:38:32 +03:00
|
|
|
tex: $(examples:.gamebook=.tex)
|
2013-06-08 20:59:55 +03:00
|
|
|
pdf: $(examples:.gamebook=.pdf)
|
2013-06-16 23:12:53 +03:00
|
|
|
html: $(examples:.gamebook=.html) examples/gamebookformatplay.js \
|
|
|
|
examples/gamebookformat.css
|
2014-09-24 23:01:02 +03:00
|
|
|
json: $(examples:.gamebook=.json)
|
2014-12-22 17:55:12 +02:00
|
|
|
twine2: $(examples:.gamebook=.twine2)
|
2014-09-24 00:51:51 +03:00
|
|
|
check: $(examples:.gamebook=.check)
|
|
|
|
vcheck: $(examples:.gamebook=.vcheck)
|
2013-06-18 21:38:32 +03:00
|
|
|
dot: $(examples:.gamebook=.dot)
|
2013-06-08 20:59:55 +03:00
|
|
|
png: $(examples:.gamebook=.png)
|
2013-06-10 23:15:54 +03:00
|
|
|
txt: $(examples:.gamebook=.txt)
|
2013-06-23 23:51:09 +03:00
|
|
|
map: $(examples:.gamebook=.map)
|
2013-06-03 22:48:28 +03:00
|
|
|
|
2013-06-11 22:56:21 +03:00
|
|
|
uploadto=$(shell cat .uploadto)
|
|
|
|
|
2013-06-15 19:45:31 +03:00
|
|
|
readme.html: readme.org
|
|
|
|
emacs -Q --batch --visit=readme.org --funcall org-export-as-html-batch
|
|
|
|
|
2013-06-18 23:21:29 +03:00
|
|
|
examples/gamebookformatplay.js: gamebookformatplay.js
|
2013-06-16 23:12:53 +03:00
|
|
|
cp gamebookformatplay.js $@
|
|
|
|
|
2013-06-18 23:21:29 +03:00
|
|
|
examples/gamebookformat.css: gamebookformat.css
|
2013-06-16 23:12:53 +03:00
|
|
|
cp gamebookformat.css $@
|
|
|
|
|
2013-06-10 23:15:54 +03:00
|
|
|
%.rtf: %.gamebook *.py templates/rtf/*.rtf
|
2013-06-19 00:39:07 +03:00
|
|
|
python2.7 ./buildexamplegamebook.py $< $@
|
2013-06-03 22:48:28 +03:00
|
|
|
|
2013-06-10 23:15:54 +03:00
|
|
|
%.html: %.gamebook *.py templates/html/*.html
|
2013-06-19 00:39:07 +03:00
|
|
|
python2.7 ./buildexamplegamebook.py $< $@
|
2013-06-03 22:48:28 +03:00
|
|
|
|
2014-12-22 17:55:12 +02:00
|
|
|
%.twine2: %.gamebook *.py templates/twine2/*.twine2
|
|
|
|
python2.7 ./buildexamplegamebook.py $< $@
|
|
|
|
|
2013-06-10 23:15:54 +03:00
|
|
|
%.tex: %.gamebook *.py templates/tex/*.tex
|
2013-06-19 00:39:07 +03:00
|
|
|
python2.7 ./buildexamplegamebook.py $< $@
|
2013-06-03 22:48:28 +03:00
|
|
|
|
2013-06-10 23:15:54 +03:00
|
|
|
%.dot: %.gamebook *.py templates/dot/*.dot
|
2013-06-19 00:39:07 +03:00
|
|
|
python2.7 ./buildexamplegamebook.py $< $@
|
2013-06-03 22:48:28 +03:00
|
|
|
|
2014-09-24 23:01:02 +03:00
|
|
|
%.json: %.gamebook *.py templates/json/*.json
|
2013-06-19 00:39:07 +03:00
|
|
|
python2.7 ./buildexamplegamebook.py $< $@
|
2013-06-10 23:15:54 +03:00
|
|
|
|
2014-09-24 23:01:02 +03:00
|
|
|
%.check: %.json
|
2014-09-24 00:51:51 +03:00
|
|
|
python2.7 ./checkgamebook.py $< > $@ || true
|
|
|
|
|
2014-09-24 23:01:02 +03:00
|
|
|
%.vcheck: %.json
|
2014-09-24 00:51:51 +03:00
|
|
|
python2.7 ./checkgamebook.py -v $< > $@ || true
|
|
|
|
|
2013-06-10 23:15:54 +03:00
|
|
|
%.txt: %.gamebook *.py templates/txt/*.txt
|
2013-06-19 00:39:07 +03:00
|
|
|
python2.7 ./buildexamplegamebook.py $< $@
|
2013-06-03 22:48:28 +03:00
|
|
|
|
|
|
|
%.pdf: %.tex
|
2013-06-04 23:36:09 +03:00
|
|
|
cd $(dir $<) && pdflatex $(notdir $<) && pdflatex $(notdir $<)
|
2013-06-03 22:48:28 +03:00
|
|
|
|
|
|
|
%.png: %.dot
|
|
|
|
dot -Tpng $< > $@
|
|
|
|
|
2013-06-16 10:41:32 +03:00
|
|
|
test: unittest checkexpected templatejstest
|
2013-06-14 00:35:51 +03:00
|
|
|
|
2014-12-22 17:55:12 +02:00
|
|
|
expected: rtf tex html json txt dot map check vcheck twine2
|
2013-06-16 23:12:53 +03:00
|
|
|
$(RM) expected/* && \
|
2014-12-22 17:55:12 +02:00
|
|
|
cp examples/*.{rtf,tex,html,json,txt,twine2,dot,map,check,vcheck} \
|
2013-06-14 00:21:34 +03:00
|
|
|
expected
|
|
|
|
|
2014-12-22 17:55:12 +02:00
|
|
|
checkexpected: clean rtf tex html json dot txt twine2 check vcheck
|
2013-06-14 00:21:34 +03:00
|
|
|
diff -r -x "*.aux" -x "*.gamebook" -x "*.log" -x "*.out" -x "*.png" \
|
2013-06-16 23:26:31 +03:00
|
|
|
-x "*.pdf" -x .gitignore -x "*.js" -x "*.css" \
|
2013-06-18 23:21:29 +03:00
|
|
|
-x "*.options" -q examples expected
|
2013-06-14 00:21:34 +03:00
|
|
|
|
2013-06-14 23:49:11 +03:00
|
|
|
unittests=$(wildcard test_*.py)
|
2013-06-14 00:35:51 +03:00
|
|
|
|
|
|
|
unittest: *.py
|
2013-06-14 23:49:11 +03:00
|
|
|
python2.7 -m unittest $(unittests:.py=)
|
2013-06-14 00:35:51 +03:00
|
|
|
|
2013-11-19 20:02:13 +02:00
|
|
|
xmllinthtmlbook: examples/htmlbook.html
|
|
|
|
xmllint --noout --schema ../HTMLBook/schema/htmlbook.xsd examples/htmlbook.html
|
|
|
|
|
2013-06-11 22:56:21 +03:00
|
|
|
upload: html png pdf rtf
|
|
|
|
if [ -n "$(uploadto)" ]; then \
|
2013-06-16 10:41:32 +03:00
|
|
|
scp examples/*.html examples/*.png examples/*.pdf examples/*.rtf \
|
2013-06-19 08:32:17 +03:00
|
|
|
*.js *.css \
|
2013-06-16 10:41:32 +03:00
|
|
|
$(uploadto);\
|
2013-06-11 22:56:21 +03:00
|
|
|
fi
|
|
|
|
|
2013-06-16 23:25:16 +03:00
|
|
|
templatejstest:
|
2013-06-16 10:41:32 +03:00
|
|
|
node test/templatejs/testhtmlscripts.js
|
|
|
|
|
2013-06-03 22:48:28 +03:00
|
|
|
clean:
|
2013-06-14 01:24:33 +03:00
|
|
|
$(RM) examples/*rtf examples/*.html examples/*.tex \
|
2014-12-22 17:55:12 +02:00
|
|
|
examples/*.txt examples/*.twine2 examples/*.json examples/*.check examples/*.log \
|
2014-09-24 00:51:51 +03:00
|
|
|
examples/*.pdf examples/*.out *~ examples/*~ *.pyc examples/*.vcheck \
|
2013-06-11 22:56:21 +03:00
|
|
|
examples/*.dot examples/*.aux examples/*.toc $(png) \
|
2013-08-15 22:55:17 +03:00
|
|
|
$(map) templates/*~ templates/*/*~ \
|
2013-06-16 23:12:53 +03:00
|
|
|
$(examples:.gamebook=.png) readme.html \
|
|
|
|
examples/*.js examples/*.css
|
2013-06-03 22:48:28 +03:00
|
|
|
|
2013-06-04 01:02:02 +03:00
|
|
|
fixmes:
|
|
|
|
grep FIXME *.py
|
|
|
|
|
2013-06-16 23:25:16 +03:00
|
|
|
.PHONY: all clean fixmes uploadto expected checkexpected test unittest \
|
2014-09-24 00:51:51 +03:00
|
|
|
templatejstest xmllinthtmlbook check vcheck
|
2013-06-03 22:48:28 +03:00
|
|
|
|
|
|
|
.PRECIOUS: %.tex %.dot
|
|
|
|
|