makefile: support the python binary being called something else

This commit is contained in:
William Pitcock 2016-07-05 13:38:55 -05:00 committed by Yury Selivanov
parent 6ebd07d88a
commit fa798e44e2
1 changed files with 13 additions and 10 deletions

View File

@ -2,6 +2,9 @@
.PHONY: release sdist-libuv docs
PYTHON ?= python
all: compile
@ -13,7 +16,7 @@ clean:
check-env:
python -c "import cython; (cython.__version__ < '0.24') and exit(1)"
$(PYTHON) -c "import cython; (cython.__version__ < '0.24') and exit(1)"
clean-libuv:
@ -30,32 +33,32 @@ distclean: clean clean-libuv
compile: check-env clean
echo "DEF DEBUG = 0" > uvloop/__debug.pxi
cython -3 uvloop/loop.pyx; rm uvloop/__debug.*
@echo "$$UVLOOP_BUILD_PATCH_SCRIPT" | python
python setup.py build_ext --inplace
@echo "$$UVLOOP_BUILD_PATCH_SCRIPT" | $(PYTHON)
$(PYTHON) setup.py build_ext --inplace
debug: check-env clean
echo "DEF DEBUG = 1" > uvloop/__debug.pxi
cython -3 -a -p uvloop/loop.pyx; rm uvloop/__debug.*
@echo "$$UVLOOP_BUILD_PATCH_SCRIPT" | python
python setup.py build_ext --inplace
@echo "$$UVLOOP_BUILD_PATCH_SCRIPT" | $(PYTHON)
$(PYTHON) setup.py build_ext --inplace
docs: compile
cd docs && python -m sphinx -a -b html . _build/html
cd docs && $(PYTHON) -m sphinx -a -b html . _build/html
test:
PYTHONASYNCIODEBUG=1 python -m unittest discover -s tests
python -m unittest discover -s tests
$(PYTHON)ASYNCIODEBUG=1 $(PYTHON) -m unittest discover -s tests
$(PYTHON) -m unittest discover -s tests
sdist: clean compile test sdist-libuv
python setup.py sdist
$(PYTHON) setup.py sdist
release: clean compile test sdist-libuv
python setup.py sdist bdist_wheel upload
$(PYTHON) setup.py sdist bdist_wheel upload
# Script to patch Cython 'async def' coroutines to have a 'tp_iter' slot,