Makefile 2 KB
Newer Older
Hubert Chathi's avatar
Hubert Chathi committed
1
all: olm-python2 olm-python3
2

poljar's avatar
poljar committed
3
4
5
6
OLM_HEADERS = ../include/olm/olm.h ../include/olm/inbound_group_session.h \
	      ../include/olm/outbound_group_session.h \

include/olm/olm.h: $(OLM_HEADERS)
7
	mkdir -p include/olm
8
	$(CPP) -I dummy -I ../include -o include/olm/olm.h ../include/olm/olm.h
9
10
# 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
11

poljar's avatar
poljar committed
12
include/olm/pk.h: include/olm/olm.h ../include/olm/pk.h
13
	$(CPP) -I dummy -I ../include -o include/olm/pk.h ../include/olm/pk.h
poljar's avatar
poljar committed
14

15
include/olm/sas.h: include/olm/olm.h ../include/olm/sas.h
16
	$(CPP) -I dummy -I ../include -o include/olm/sas.h ../include/olm/sas.h
17

18
headers: include/olm/olm.h include/olm/pk.h include/olm/sas.h
19
20

olm-python2: headers
Hubert Chathi's avatar
Hubert Chathi committed
21
	DEVELOP=$(DEVELOP) python2 setup.py build
22

23
olm-python3: headers
Hubert Chathi's avatar
Hubert Chathi committed
24
	DEVELOP=$(DEVELOP) python3 setup.py build
25

Hubert Chathi's avatar
Hubert Chathi committed
26
install: install-python2 install-python3
27

Hubert Chathi's avatar
Hubert Chathi committed
28
29
install-python2: olm-python2
	python2 setup.py install --skip-build -O1 --root=$(DESTDIR)
30

Hubert Chathi's avatar
Hubert Chathi committed
31
32
install-python3: olm-python3
	python3 setup.py install --skip-build -O1 --root=$(DESTDIR)
33

Hubert Chathi's avatar
Hubert Chathi committed
34
35
36
37
38
39
40
41
42
43
44
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
45

poljar's avatar
poljar committed
46
47
48
isort:
	isort -y -p olm

Hubert Chathi's avatar
Hubert Chathi committed
49
50
51
52
53
54
55
56
57
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