aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHubert Chathi <hubert@uhoreg.ca>2018-10-12 19:06:46 -0400
committerHubert Chathi <hubert@uhoreg.ca>2018-10-12 19:11:19 -0400
commit718763f8fc8c0650fd880b32fe9bbf931d7e2183 (patch)
treef6edc32895d016a0ab88275ee4d2d06de9f2734a
parent29b021b1835e0cd048e5837e189e1385725fafea (diff)
build and test improvements
- build both Python2 and Python3 libs by default, and add separate rules building Python2 and Python. - use the libraries as built by setuptools, rather than building again separately
-rw-r--r--python/Makefile60
1 files changed, 30 insertions, 30 deletions
diff --git a/python/Makefile b/python/Makefile
index ad2621c..a19c4f8 100644
--- a/python/Makefile
+++ b/python/Makefile
@@ -1,41 +1,41 @@
-PYTHON ?= python
-
-all: olm
+all: olm-python2 olm-python3
include/olm/olm.h: ../include/olm/olm.h ../include/olm/inbound_group_session.h ../include/olm/outbound_group_session.h
mkdir -p include/olm
$(CPP) -I dummy -I ../include ../include/olm/olm.h -o include/olm/olm.h
-olm: include/olm/olm.h
- DEVELOP=$(DEVELOP) $(PYTHON) setup.py build
-
-install: olm
- $(PYTHON) setup.py install --skip-build -O1 --root=$(DESTDIR)
+olm-python2: include/olm/olm.h
+ DEVELOP=$(DEVELOP) python2 setup.py build
-test: develop py2develop
- python3 -m pytest
- python2 -m pytest
- python3 -m pytest --flake8 --benchmark-disable
- python3 -m pytest --isort --benchmark-disable
- python3 -m pytest --cov --cov-branch --benchmark-disable
+olm-python3: include/olm/olm.h
+ DEVELOP=$(DEVELOP) python3 setup.py build
-clean:
- -rm -r python_olm.egg-info/ dist/ __pycache__/
- -rm *.so _libolm.o
- -rm -r packages/
- -rm -r build/
+install: install-python2 install-python3
-develop: _libolm.o
-py2develop: _libolm.so
+install-python2: olm-python2
+ python2 setup.py install --skip-build -O1 --root=$(DESTDIR)
-_libolm.so: DEVELOP ?= 1
-_libolm.so: include/olm/olm.h olm_build.py
- DEVELOP=$(DEVELOP) python2 olm_build.py
- -rm _libolm.c
+install-python3: olm-python3
+ python3 setup.py install --skip-build -O1 --root=$(DESTDIR)
-_libolm.o: DEVELOP ?= 1
-_libolm.o: include/olm/olm.h olm_build.py
- DEVELOP=$(DEVELOP) python3 olm_build.py
- -rm _libolm.c
+test: olm-python2 olm-python3
+ rm -rf install-temp
+ mkdir -p install-temp/2 install-temp/3
+ PYTHONPATH=install-temp/2 python2 setup.py install --skip-build --install-lib install-temp/2 --install-script install-temp/bin
+ PYTHONPATH=install-temp/3 python3 setup.py install --skip-build --install-lib install-temp/3 --install-script install-temp/bin
+ PYTHONPATH=install-temp/3 python3 -m pytest
+ PYTHONPATH=install-temp/2 python2 -m pytest
+ PYTHONPATH=install-temp/3 python3 -m pytest --flake8 --benchmark-disable
+ PYTHONPATH=install-temp/3 python3 -m pytest --isort --benchmark-disable
+ PYTHONPATH=install-temp/3 python3 -m pytest --cov --cov-branch --benchmark-disable
+ rm -rf install-temp
-.PHONY: all olm install clean test develop
+clean:
+ rm -rf python_olm.egg-info/ dist/ __pycache__/
+ rm -rf *.so _libolm.o
+ rm -rf packages/
+ rm -rf build/
+ rm -rf install-temp/
+ rm -rf include/
+
+.PHONY: all olm-python2 olm-python3 install install-python2 install-python3 clean test