isso/Makefile

72 lines
1.8 KiB
Makefile
Raw Normal View History

2014-05-26 13:57:37 +00:00
ISSO_JS_SRC := $(shell find isso/js/app -type f) \
$(shell ls isso/js/*.js | grep -vE "(min|dev)") \
isso/js/lib/requirejs-jade/jade.js
ISSO_JS_DST := isso/js/embed.min.js isso/js/embed.dev.js \
isso/js/count.min.js isso/js/count.dev.js
2014-03-20 10:19:37 +00:00
ISSO_CSS := isso/css/isso.css
2014-03-19 14:58:40 +00:00
2014-11-09 20:18:05 +00:00
ISSO_PY_SRC := $(shell git ls-files | grep -E "^isso/.+.py$$")
2014-03-28 11:18:44 +00:00
2014-05-29 12:04:11 +00:00
DOCS_RST_SRC := $(shell find docs/ -type f -name '*.rst') \
$(wildcard docs/_isso/*) \
docs/index.html docs/conf.py docs/docutils.conf \
share/isso.conf
2014-03-19 14:58:40 +00:00
2014-05-29 12:04:11 +00:00
DOCS_CSS_SRC := docs/_static/css/site.scss
DOCS_CSS_DEP := $(shell find docs/_static/css/neat -type f) \
$(shell find docs/_static/css/bourbon -type f)
DOCS_CSS_DST := docs/_static/css/site.css
DOCS_MAN_DST := man/man1/isso.1 man/man5/isso.conf.5
DOCS_HTML_DST := docs/_build/html
2014-03-19 14:58:40 +00:00
all: man js site
2014-02-03 10:00:11 +00:00
init:
(cd isso/js; bower --allow-root install almond requirejs requirejs-text jade)
2014-02-03 10:00:11 +00:00
2014-11-09 20:18:05 +00:00
check:
@echo "Python 2.x"
-@python2 -m pyflakes $(ISSO_PY_SRC)
@echo "Python 3.x"
-@python3 -m pyflakes $(ISSO_PY_SRC)
isso/js/%.min.js: $(ISSO_JS_SRC) $(ISSO_CSS)
2014-03-19 14:58:40 +00:00
r.js -o isso/js/build.$*.js out=$@
isso/js/%.dev.js: $(ISSO_JS_SRC) $(ISSO_CSS)
2014-03-19 14:58:40 +00:00
r.js -o isso/js/build.$*.js optimize="none" out=$@
2014-03-20 10:19:37 +00:00
js: $(ISSO_JS_DST)
2014-02-03 10:00:11 +00:00
2014-05-29 12:04:11 +00:00
man: $(DOCS_RST_SRC)
2014-03-19 14:58:40 +00:00
sphinx-build -b man docs/ man/
2014-03-28 12:34:24 +00:00
mv man/isso.1 man/man1/isso.1
mv man/isso.conf.5 man/man5/isso.conf.5
2014-03-19 14:58:40 +00:00
2014-05-29 12:04:11 +00:00
${DOCS_CSS_DST}: $(DOCS_CSS_SRC) $(DOCS_CSS_DEP)
scss --no-cache $(DOCS_CSS_SRC) $@
${DOCS_HTML_DST}: $(DOCS_RST_SRC) $(DOCS_CSS_DST)
sphinx-build -b dirhtml docs/ $@
2014-03-19 14:58:40 +00:00
2014-05-29 12:04:11 +00:00
site: $(DOCS_HTML_DST)
2013-11-24 20:43:57 +00:00
2014-03-28 11:18:44 +00:00
coverage: $(ISSO_PY_SRC)
2014-03-28 12:20:55 +00:00
nosetests --with-doctest --with-coverage --cover-package=isso --cover-html isso/
2013-12-18 11:51:34 +00:00
2014-03-28 11:28:52 +00:00
test: $($ISSO_PY_SRC)
python setup.py nosetests
2014-03-19 14:58:40 +00:00
clean:
2014-05-29 12:04:11 +00:00
rm -f $(DOCS_MAN_DST) $(DOCS_CSS_DST) $(ISSO_JS_DST)
rm -rf $(DOCS_HTML_DST)
2014-03-19 14:58:40 +00:00
.PHONY: clean site man init js coverage test
2014-03-19 14:58:40 +00:00