rewrite Makefile

This commit is contained in:
Martin Zimmermann 2014-03-19 15:58:40 +01:00
parent b19084b3e2
commit 5df4b40a1f

View File

@ -1,22 +1,40 @@
all: css js
ISSO_SRC := $(shell find isso/js/app -type f) $(shell ls isso/js/*.js | grep -vE "(min|dev)")
ISSO_DST := isso/js/embed.min.js isso/js/embed.dev.js isso/js/count.min.js isso/js/count.dev.js
RST := $(shell find docs/ -type f -name '*.rst')
MAN := man/man1/isso.1 man/man5/isso.conf.5
WWW := docs/index.html docs/isso.example.cfg $(wildcard docs/_static/*)
CSS := docs/_static/css/site.css
all: man js site
init:
(cd isso/js; bower install almond requirejs requirejs-text)
css:
scss isso/css/isso.scss isso/css/isso.css
isso/js/%.min.js: $(ISSO_SRC)
r.js -o isso/js/build.$*.js out=$@
js:
r.js -o isso/js/build.embed.js
r.js -o isso/js/build.embed.js optimize="none" out="isso/js/embed.dev.js"
r.js -o isso/js/build.count.js
r.js -o isso/js/build.count.js optimize="none" out="isso/js/count.dev.js"
isso/js/%.dev.js: $(ISSO_SRC)
r.js -o isso/js/build.$*.js optimize="none" out=$@
site:
cd docs/ && sphinx-build -E -b dirhtml -a . _build
scss docs/_static/css/site.scss docs/_build/_static/css/site.css
js: $(ISSO_DST)
man: $(RST)
sphinx-build -b man docs/ man/
${CSS}: docs/_static/css/site.scss
scss --no-cache $< $@
site: $(RST) $(WWW) $(CSS)
cd docs && sphinx-build -b dirhtml . _build/html
coverage:
nosetests --with-doctest --with-doctest-ignore-unicode --with-coverage \
--cover-package=isso --cover-html isso/ specs/
clean:
rm -f $(MAN) $(CSS) $(ISSO_DST)
.PHONY: clean site man init js