forked from openpaperwork/pyocr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
95 lines (75 loc) · 1.56 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
VERSION_FILE = src/pyocr/_version.py
PYTHON = python3
build: build_c build_py
install: install_py install_c
uninstall: uninstall_py
build_py: ${VERSION_FILE}
${PYTHON} ./setup.py build
build_c:
${VERSION_FILE}:
echo -n "version = \"" >| $@
echo -n $(shell git describe --always) >> $@
echo "\"" >> $@
version: ${VERSION_FILE}
doc: install_py
(cd doc && make html)
cp doc/index.html doc/build/index.html
check:
flake8
# pydocstyle src/pyocr
test: ${VERSION_FILE}
tox
linux_exe:
windows_exe:
release:
ifeq (${RELEASE}, )
@echo "You must specify a release version (make release RELEASE=1.2.3)"
else
@echo "Will release: ${RELEASE}"
@echo "Checking release is in ChangeLog ..."
grep ${RELEASE} ChangeLog | grep -v "/xx"
@echo "Releasing ..."
git tag -a ${RELEASE} -m ${RELEASE}
git push origin ${RELEASE}
make clean
make version
${PYTHON} ./setup.py sdist upload
@echo "All done"
endif
clean:
rm -rf doc/build
rm -rf build dist *.egg-info
rm -rf src/pyocr/__pycache__
rm -f ${VERSION_FILE}
install_py: ${VERSION_FILE}
${PYTHON} ./setup.py install ${PIP_ARGS}
install_c:
uninstall_py:
pip3 uninstall -y pyocr
uninstall_c:
help:
@echo "make build || make build_py"
@echo "make check"
@echo "make doc"
@echo "make help: display this message"
@echo "make install || make install_py"
@echo "make release"
@echo "make test"
@echo "make uninstall || make uninstall_py"
.PHONY: \
build \
build_c \
build_py \
check \
doc \
linux_exe \
windows_exe \
help \
install \
install_c \
install_py \
release \
test \
uninstall \
uninstall_c \
version