forked from LudovicRousseau/PyKCS11
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (46 loc) · 1.19 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# give some default values
DESTDIR ?= /
ifeq (, $(PYTHON))
PYTHON=python
endif
PREFIX ?= $(shell $(PYTHON) -c 'import sys; print(sys.prefix)')
COVERAGE ?= coverage
build: build-stamp
build-stamp:
$(PYTHON) setup.py build
touch build-stamp
install: build
$(PYTHON) setup.py install --prefix=$(PREFIX) --root=$(DESTDIR)
clean distclean:
$(PYTHON) setup.py clean
rm -f src/pykcs11_wrap.cpp
rm -rf build
rm -f *.pyc PyKCS11/*.pyc
rm -f PyKCS11/LowLevel.py
rm -f PyKCS11/_LowLevel*
rm -f build-stamp
rm -f test/*.pyc
rebuild: clean build
src/pykcs11.i: src/opensc/pkcs11.h src/pkcs11lib.h src/pykcs11string.h src/ck_attribute_smart.h
touch $@
dist: clean
$(PYTHON) setup.py sdist bdist_wheel
pypi: clean
rm -rf dist
$(PYTHON) setup.py sdist bdist_wheel
$(PYTHON) -m twine upload dist/*
prepare4test: build
cd PyKCS11 ; ln -sf ../build/lib.*/PyKCS11/_LowLevel*.so
tests: prepare4test
$(PYTHON) run_test.py
coverage: prepare4test
$(COVERAGE) run run_test.py
$(COVERAGE) report
$(COVERAGE) html
doc:
cd docs ; ./generate.sh
doc-upload: doc
rm -r api
mv docs/_build/html api
scp -r api [email protected]:/home/project-web/pkcs11wrap/htdocs
.PHONY: build install clean rebuild dist doc