3 SPHINXBUILD = $(PYTHON) -m sphinx
5 DOCHTML = $(DOCDIR)/html
6 DOCTREES = $(DOCDIR)/doctrees
7 ALLSPHINXOPTS = -d $(DOCTREES) $(SPHINXOPTS) $(DOCDIR)
10 RSTFILES = doc/index.rst doc/module.rst NEWS README.rst doc/conf.py
11 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
17 $(PYTHON) ./setup.py build_ext --inplace
19 $(DOCHTML)/index.html: $(MODNAME) $(RSTFILES)
20 $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(DOCHTML)
23 doc: $(DOCHTML)/index.html
26 fakeroot $(PYTHON) ./setup.py sdist
29 @for ver in $(PYVERS); do \
30 for flavour in "" "-dbg"; do \
31 if type python$$ver$$flavour >/dev/null; then \
32 echo Testing with python$$ver$$flavour; \
33 python$$ver$$flavour ./setup.py test -q; \
37 @if type pypy >/dev/null; then \
38 echo Testing with pypy; \
39 pypy ./setup.py test -q; \
45 trap 'rm $$TESTFILE' EXIT; \
46 for ver in $(PYVERS) ; do \
47 if type python$$ver >/dev/null; then \
48 echo Benchmarking with python$$ver; \
49 python$$ver ./setup.py build -q; \
50 echo " - set (with override)"; \
51 python$$ver -m timeit -r $(REPS) -s 'import xattr' "xattr.set('$$TESTFILE', 'user.comment', 'hello')"; \
53 python$$ver -m timeit -r $(REPS) -s 'import xattr' "xattr.list('$$TESTFILE')"; \
55 python$$ver -m timeit -r $(REPS) -s 'import xattr' "xattr.get('$$TESTFILE', 'user.comment')"; \
56 echo " - set + remove"; \
57 python$$ver -m timeit -r $(REPS) -s 'import xattr' "xattr.set('$$TESTFILE', 'user.comment', 'hello'); xattr.remove('$$TESTFILE', 'user.comment')"; \
63 $(MAKE) test CFLAGS="-coverage"
64 lcov --capture --directory . --output-file coverage.info
65 genhtml coverage.info --output-directory out
68 rm -rf $(DOCHTML) $(DOCTREES)
73 .PHONY: doc test clean dist coverage