2013-06-04 23:36:09 +03:00
|
|
|
examples=$(wildcard examples/*.gamebook)
|
|
|
|
|
2013-06-11 00:58:33 +03:00
|
|
|
all: rtf pdf html debug png txt
|
2013-06-08 20:59:55 +03:00
|
|
|
|
|
|
|
rtf: $(examples:.gamebook=.rtf)
|
|
|
|
pdf: $(examples:.gamebook=.pdf)
|
|
|
|
html: $(examples:.gamebook=.html)
|
|
|
|
debug: $(examples:.gamebook=.debug)
|
|
|
|
png: $(examples:.gamebook=.png)
|
2013-06-10 23:15:54 +03:00
|
|
|
txt: $(examples:.gamebook=.txt)
|
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-10 23:15:54 +03:00
|
|
|
%.rtf: %.gamebook *.py templates/rtf/*.rtf
|
2013-06-16 22:25:50 +03:00
|
|
|
./formatgamebook.py --no-shuffle $< $@
|
2013-06-03 22:48:28 +03:00
|
|
|
|
2013-06-10 23:15:54 +03:00
|
|
|
%.html: %.gamebook *.py templates/html/*.html
|
2013-06-16 22:25:50 +03:00
|
|
|
./formatgamebook.py --no-shuffle $< $@
|
2013-06-03 22:48:28 +03:00
|
|
|
|
2013-06-10 23:15:54 +03:00
|
|
|
%.tex: %.gamebook *.py templates/tex/*.tex
|
2013-06-16 22:25:50 +03:00
|
|
|
./formatgamebook.py --no-shuffle $< $@
|
2013-06-03 22:48:28 +03:00
|
|
|
|
2013-06-10 23:15:54 +03:00
|
|
|
%.dot: %.gamebook *.py templates/dot/*.dot
|
2013-06-16 22:25:50 +03:00
|
|
|
./formatgamebook.py --no-shuffle $< $@
|
2013-06-03 22:48:28 +03:00
|
|
|
|
2013-06-10 23:15:54 +03:00
|
|
|
%.debug: %.gamebook *.py templates/debug/*.debug
|
2013-06-16 22:25:50 +03:00
|
|
|
./formatgamebook.py --no-shuffle $< $@
|
2013-06-10 23:15:54 +03:00
|
|
|
|
|
|
|
%.txt: %.gamebook *.py templates/txt/*.txt
|
2013-06-16 22:25:50 +03:00
|
|
|
./formatgamebook.py --no-shuffle $< $@
|
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
|
|
|
|
2013-06-14 00:21:34 +03:00
|
|
|
expected: all
|
|
|
|
$(RM) expected/* && cp examples/*.{rtf,tex,html,debug,txt,dot,map} \
|
|
|
|
expected
|
|
|
|
|
2013-06-14 01:24:33 +03:00
|
|
|
checkexpected: clean all
|
2013-06-14 00:21:34 +03:00
|
|
|
diff -r -x "*.aux" -x "*.gamebook" -x "*.log" -x "*.out" -x "*.png" \
|
|
|
|
-x "*.pdf" -x .gitignore -q examples expected
|
|
|
|
|
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-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 \
|
|
|
|
$(uploadto);\
|
2013-06-11 22:56:21 +03:00
|
|
|
fi
|
|
|
|
|
2013-06-16 10:41:32 +03:00
|
|
|
test/templatejs/htmlscripts.js: $(wildcard templates/html/*script.html)
|
|
|
|
./templates.py html script > $@
|
|
|
|
|
|
|
|
templatejstest: test/templatejs/htmlscripts.js \
|
|
|
|
test/templatejs/testhtmlscripts.js
|
|
|
|
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 \
|
|
|
|
examples/*.txt examples/*.debug examples/*.log \
|
|
|
|
examples/*.pdf examples/*.out *~ examples/*~ *.pyc \
|
2013-06-11 22:56:21 +03:00
|
|
|
examples/*.dot examples/*.aux examples/*.toc $(png) \
|
2013-06-14 01:24:33 +03:00
|
|
|
examples/*.map templates/*~ templates/*/*~ \
|
2013-06-15 19:45:31 +03:00
|
|
|
$(examples:.gamebook=.png) readme.html
|
2013-06-03 22:48:28 +03:00
|
|
|
|
2013-06-04 01:02:02 +03:00
|
|
|
fixmes:
|
|
|
|
grep FIXME *.py
|
|
|
|
|
2013-06-14 00:35:51 +03:00
|
|
|
.PHONY: all clean fixmes uploadto expected checkexpected test unittest
|
2013-06-03 22:48:28 +03:00
|
|
|
|
|
|
|
.PRECIOUS: %.tex %.dot
|
|
|
|
|