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 doc/news.rst doc/readme.md 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
25 doc/readme.md: README.md
26 ln -s ../README.md doc/readme.md
29 ln -s ../NEWS doc/news.rst
32 fakeroot $(PYTHON) ./setup.py sdist
35 @for ver in $(PYVERS); do \
36 for flavour in "" "-dbg"; do \
37 if type python$$ver$$flavour >/dev/null; then \
38 echo Testing with python$$ver$$flavour; \
39 python$$ver$$flavour ./setup.py test -q; \
43 @if type pypy >/dev/null; then \
44 echo Testing with pypy; \
45 pypy ./setup.py test -q; \
51 trap 'rm $$TESTFILE' EXIT; \
52 for ver in $(PYVERS) ; do \
53 if type python$$ver >/dev/null; then \
54 echo Benchmarking with python$$ver; \
55 python$$ver ./setup.py build -q; \
56 echo " - set (with override)"; \
57 python$$ver -m timeit -r $(REPS) -s 'import xattr' "xattr.set('$$TESTFILE', 'user.comment', 'hello')"; \
59 python$$ver -m timeit -r $(REPS) -s 'import xattr' "xattr.list('$$TESTFILE')"; \
61 python$$ver -m timeit -r $(REPS) -s 'import xattr' "xattr.get('$$TESTFILE', 'user.comment')"; \
62 echo " - set + remove"; \
63 python$$ver -m timeit -r $(REPS) -s 'import xattr' "xattr.set('$$TESTFILE', 'user.comment', 'hello'); xattr.remove('$$TESTFILE', 'user.comment')"; \
69 $(MAKE) test CFLAGS="-coverage"
70 lcov --capture --directory . --output-file coverage.info
71 genhtml coverage.info --output-directory out
74 rm -rf $(DOCHTML) $(DOCTREES)
75 rm -f doc/readme.md doc/news.rst
80 .PHONY: doc test clean dist coverage