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
16 ./setup.py build_ext --inplace
18 $(DOCHTML)/index.html: $(MODNAME) $(RSTFILES)
19 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(DOCHTML)
22 doc: $(DOCHTML)/index.html
25 fakeroot ./setup.py sdist
28 @for ver in $(PYVERS); do \
29 for flavour in "" "-dbg"; do \
30 if type python$$ver$$flavour >/dev/null; then \
31 echo Testing with python$$ver$$flavour; \
32 python$$ver$$flavour ./setup.py test -q; \
36 @if type pypy >/dev/null; then \
37 echo Testing with pypy; \
38 pypy ./setup.py test -q; \
44 trap 'rm $$TESTFILE' EXIT; \
45 for ver in $(PYVERS) ; do \
46 if type python$$ver >/dev/null; then \
47 echo Benchmarking with python$$ver; \
48 python$$ver ./setup.py build -q; \
49 echo " - set (with override)"; \
50 python$$ver -m timeit -r $(REPS) -s 'import xattr' "xattr.set('$$TESTFILE', 'user.comment', 'hello')"; \
52 python$$ver -m timeit -r $(REPS) -s 'import xattr' "xattr.list('$$TESTFILE')"; \
54 python$$ver -m timeit -r $(REPS) -s 'import xattr' "xattr.get('$$TESTFILE', 'user.comment')"; \
55 echo " - set + remove"; \
56 python$$ver -m timeit -r $(REPS) -s 'import xattr' "xattr.set('$$TESTFILE', 'user.comment', 'hello'); xattr.remove('$$TESTFILE', 'user.comment')"; \
62 $(MAKE) test CFLAGS="-coverage"
63 lcov --capture --directory . --output-file coverage.info
64 genhtml coverage.info --output-directory out
67 rm -rf $(DOCHTML) $(DOCTREES)
72 .PHONY: doc test clean dist coverage