1
0
Fork 0
mirror of https://github.com/Oreolek/gamebookformat.git synced 2024-05-18 08:58:22 +03:00
gamebookformat/Makefile

91 lines
2.2 KiB
Makefile
Raw Normal View History

examples=$(wildcard examples/*.gamebook)
2013-06-11 00:58:33 +03:00
all: rtf pdf html debug png txt
rtf: $(examples:.gamebook=.rtf)
pdf: $(examples:.gamebook=.pdf)
html: $(examples:.gamebook=.html) examples/gamebookformatplay.js \
examples/gamebookformat.css
debug: $(examples:.gamebook=.debug)
png: $(examples:.gamebook=.png)
txt: $(examples:.gamebook=.txt)
2013-06-11 22:56:21 +03:00
uploadto=$(shell cat .uploadto)
readme.html: readme.org
emacs -Q --batch --visit=readme.org --funcall org-export-as-html-batch
examples/gamebookformatplay.js:
cp gamebookformatplay.js $@
examples/gamebookformat.css:
cp gamebookformat.css $@
%.rtf: %.gamebook *.py templates/rtf/*.rtf
./formatgamebook.py --no-shuffle $< $@
%.html: %.gamebook *.py templates/html/*.html
./formatgamebook.py --no-shuffle $< $@
%.tex: %.gamebook *.py templates/tex/*.tex
./formatgamebook.py --no-shuffle $< $@
%.dot: %.gamebook *.py templates/dot/*.dot
./formatgamebook.py --no-shuffle $< $@
%.debug: %.gamebook *.py templates/debug/*.debug
./formatgamebook.py --no-shuffle $< $@
%.txt: %.gamebook *.py templates/txt/*.txt
./formatgamebook.py --no-shuffle $< $@
%.pdf: %.tex
cd $(dir $<) && pdflatex $(notdir $<) && pdflatex $(notdir $<)
%.png: %.dot
dot -Tpng $< > $@
test: unittest checkexpected templatejstest
2013-06-14 00:35:51 +03:00
expected: all
$(RM) expected/* && \
cp examples/*.{rtf,tex,html,debug,txt,dot,map} \
expected
checkexpected: clean all
diff -r -x "*.aux" -x "*.gamebook" -x "*.log" -x "*.out" -x "*.png" \
-x "*.pdf" -x .gitignore -x "*.js" -x "*.css" \
-q examples expected
unittests=$(wildcard test_*.py)
2013-06-14 00:35:51 +03:00
unittest: *.py
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 \
scp examples/*.html examples/*.png examples/*.pdf examples/*.rtf \
$(uploadto);\
2013-06-11 22:56:21 +03:00
fi
templatejstest:
node test/templatejs/testhtmlscripts.js
clean:
$(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) \
examples/*.map templates/*~ templates/*/*~ \
$(examples:.gamebook=.png) readme.html \
examples/*.js examples/*.css
2013-06-04 01:02:02 +03:00
fixmes:
grep FIXME *.py
.PHONY: all clean fixmes uploadto expected checkexpected test unittest \
templatejstest
.PRECIOUS: %.tex %.dot