2 SPHINXBUILD = sphinx-build
4 DOCHTML = $(DOCDIR)/html
5 DOCTREES = $(DOCDIR)/doctrees
6 ALLSPHINXOPTS = -d $(DOCTREES) $(SPHINXOPTS) $(DOCDIR)
9 RSTFILES = doc/index.rst doc/module.rst NEWS README.rst doc/conf.py
10 PYVERS = 2.4 2.5 2.6 2.7 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7
15 ./setup.py build_ext --inplace
17 $(DOCHTML)/index.html: $(MODNAME) $(RSTFILES)
18 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(DOCHTML)
21 doc: $(DOCHTML)/index.html
24 fakeroot ./setup.py sdist
27 @for ver in $(PYVERS); do \
28 for flavour in "" "-dbg"; do \
29 if type python$$ver$$flavour >/dev/null; then \
30 echo Testing with python$$ver$$flavour; \
31 python$$ver$$flavour ./setup.py test -q; \
35 @if type pypy >/dev/null; then \
36 echo Testing with pypy; \
37 pypy ./setup.py test -q; \
43 trap 'rm $$TESTFILE' EXIT; \
44 for ver in $(PYVERS) ; do \
45 if type python$$ver >/dev/null; then \
46 echo Benchmarking with python$$ver; \
47 python$$ver ./setup.py build -q; \
48 echo " - set (with override)"; \
49 python$$ver -m timeit -s 'import xattr' "xattr.set('$$TESTFILE', 'user.comment', 'hello')"; \
51 python$$ver -m timeit -s 'import xattr' "xattr.list('$$TESTFILE')"; \
53 python$$ver -m timeit -s 'import xattr' "xattr.get('$$TESTFILE', 'user.comment')"; \
54 echo " - set + remove"; \
55 python$$ver -m timeit -s 'import xattr' "xattr.set('$$TESTFILE', 'user.comment', 'hello'); xattr.remove('$$TESTFILE', 'user.comment')"; \
61 $(MAKE) test CFLAGS="-coverage"
62 lcov --capture --directory . --output-file coverage.info
63 genhtml coverage.info --output-directory out
66 rm -rf $(DOCHTML) $(DOCTREES)
71 .PHONY: doc test clean dist coverage