]> git.k1024.org Git - pylibacl.git/blob - Makefile
Badge-ify the README
[pylibacl.git] / Makefile
1 PYTHON        = python3
2 SPHINXOPTS    = -W
3 SPHINXBUILD   = $(PYTHON) -m sphinx
4 DOCDIR        = doc
5 DOCHTML       = $(DOCDIR)/html
6 DOCTREES      = $(DOCDIR)/doctrees
7 ALLSPHINXOPTS = -d $(DOCTREES) $(SPHINXOPTS) $(DOCDIR)
8
9 MODNAME = posix1e.so
10 RSTFILES = doc/index.rst doc/module.rst NEWS README.rst doc/conf.py
11
12 all: doc test
13
14 $(MODNAME): acl.c
15         $(PYTHON) ./setup.py build_ext --inplace
16
17 $(DOCHTML)/index.html: $(MODNAME) $(RSTFILES) acl.c
18         $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(DOCHTML)
19         touch $@
20
21 doc: $(DOCHTML)/index.html
22
23 dist:
24         fakeroot $(PYTHON) ./setup.py sdist
25
26 test:
27         @for ver in 2.7 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7; 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; \
32             fi; \
33           done; \
34         done; \
35         for pp in pypy pypy3; do \
36           if type $$pp >/dev/null; then \
37             echo Testing with $$pp; \
38             $$pp ./setup.py test -q; \
39           fi; \
40         done
41
42 coverage:
43         $(MAKE) clean
44         $(MAKE) test CFLAGS="-coverage"
45         lcov --capture --directory . --output-file coverage.info
46         genhtml coverage.info --output-directory out
47
48 clean:
49         rm -rf $(DOCHTML) $(DOCTREES)
50         rm -f $(MODNAME)
51         rm -f *.so
52         rm -rf build
53
54 .PHONY: doc test clean dist coverage