-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
132 lines (111 loc) · 3.4 KB
/
Copy pathMakefile
File metadata and controls
132 lines (111 loc) · 3.4 KB
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
.PHONY: clean-pyc clean-build docs clean
DATE_STRING:=$(shell /bin/date +"%Y-%m-%d")
help:
@echo "clean - remove all build, test, coverage and Python artifacts"
@echo "clean-build - remove build artifacts"
@echo "clean-pyc - remove Python file artifacts"
@echo "clean-test - remove test and coverage artifacts"
@echo "clean-doc - remove documentation artifacts"
@echo "lint - check style with flake8"
@echo "test - run tests suitable for an embedded Linux machine"
@echo "test-graphical - run tests for graphical components (requires dependencies, see docs)"
@echo "test-all - run all tests"
@echo "vcan - Start Linux virtual CAN bus vcan0"
@echo "coverage - check code coverage quickly with the default Python"
@echo "docs - generate Sphinx HTML documentation, including API docs"
@echo "pdf - generate PDF documentation, including API docs"
@echo "release - package and upload a release"
@echo "dist - package TODO!!!"
@echo "install - install the package to the active Python's site-packages"
@echo "develop - install the package as symlinks, for development"
@echo "undevelop - uninstall the package as symlinks (for development)"
clean: clean-build clean-pyc clean-test clean-doc
clean-build:
rm -fr build/
rm -fr dist/
rm -fr .eggs/
find . -name '*.egg-info' -exec rm -fr {} +
find . -name '*.egg' -exec rm -f {} +
clean-pyc:
rm -fr .idea/
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
clean-test:
rm -fr .tox/
rm -f .coverage
rm -f .coverage.*
rm -fr htmlcov/
find . -name 'temporary-*.txt' -exec rm -fr {} +
clean-doc:
rm -fr docs/_build
rm -f .coverage
rm -f .coverage.*
rm -fr htmlcov/
-$(MAKE) -C docs clean
lint:
flake8 sgframework tests
test:
python3 setup.py test # tests.suites.embedded
test-graphical:
python3 tests/suites.py -s graphical
test-all:
python3 tests/suites.py -s alltests
coverage:
@echo " "
@echo "NOTE: In order to measure coverage also for programs started via subprocess,"
@echo "you need to modify your sitecustomize.py file (typically in /etc/pythonX.Y)."
@echo " "
rm -f .coverage
rm -f .coverage.*
coverage run --rcfile=tests/coveragerc tests/suites.py -s alltests
coverage combine
coverage report -m
coverage html
@echo " "
@echo " "
@echo " "
@echo "Opening web browser ..."
xdg-open htmlcov/index.html
docs: clean-doc
$(MAKE) -C docs html
@echo " "
@echo " "
@echo " "
@echo "Opening web browser ..."
xdg-open docs/_build/html/index.html
pdf: docs
$(MAKE) -C docs latexpdf
cp -f docs/_build/latex/sgframework.pdf docs/_build/sgframework_$(DATE_STRING).pdf;
@echo " "
@echo " "
@echo " "
@echo "Opening PDF reader ..."
xdg-open docs/_build/latex/sgframework.pdf
vcan:
modprobe vcan
ip link add dev vcan0 type vcan
ifconfig vcan0 up
release: clean
python3 setup.py sdist upload
python3 setup.py bdist_wheel upload
dist: clean
python3 setup.py sdist
python3 setup.py bdist_wheel
ls -l dist
install: clean
python3 setup.py install
subscribe:
@echo " "
@echo " "
mosquitto_sub -v -t +/#
develop: clean
python3 setup.py develop
undevelop: clean
python3 setup.py develop --uninstall
@echo " "
@echo " "
@echo "You need to manually uninstall any scripts (see setup.py). For example:"
@echo " sudo rm /usr/local/bin/canadapter "
@echo " sudo rm /usr/local/bin/servicemanager "