diff options
author | Hubert Chathi <hubert@uhoreg.ca> | 2018-10-19 11:34:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-19 11:34:11 -0400 |
commit | 1d880f9711e0f1b084e63221899f7da2e1087e28 (patch) | |
tree | 69ccb82241fa1c007b621c1bb687788138484d2c /python/Makefile | |
parent | 6e6facba3b4e2beb4e708271f0f23c7bf3840835 (diff) | |
parent | 0ec6a658583ae4d8b8463b20a640a0769b2ac630 (diff) |
Merge pull request #68 from matrix-org/poljar-python
Poljar's improved python bindings
Diffstat (limited to 'python/Makefile')
-rw-r--r-- | python/Makefile | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/python/Makefile b/python/Makefile new file mode 100644 index 0000000..5da703a --- /dev/null +++ b/python/Makefile @@ -0,0 +1,43 @@ +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 +# add memset to the header so that we can use it to clear buffers + echo 'void *memset(void *s, int c, size_t n);' >> include/olm/olm.h + +olm-python2: include/olm/olm.h + DEVELOP=$(DEVELOP) python2 setup.py build + +olm-python3: include/olm/olm.h + DEVELOP=$(DEVELOP) python3 setup.py build + +install: install-python2 install-python3 + +install-python2: olm-python2 + python2 setup.py install --skip-build -O1 --root=$(DESTDIR) + +install-python3: olm-python3 + python3 setup.py install --skip-build -O1 --root=$(DESTDIR) + +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 + +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 |