From fa798e44e26fc8fd9dbb7ea2d10f5bc0c9e2e563 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Tue, 5 Jul 2016 13:38:55 -0500 Subject: [PATCH] makefile: support the python binary being called something else --- Makefile | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index cf31e0c..52bf787 100644 --- a/Makefile +++ b/Makefile @@ -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,