1
+ # Makefile from https://github.com/snstac/pytak
2
+ # PyTAK Makefile
1
3
#
2
- # Copyright Sensors & Signals LLC https://www.snstac.com
4
+ # Copyright Sensors & Signals LLC https://www.snstac.com/
3
5
#
4
6
# Licensed under the Apache License, Version 2.0 (the "License");
5
7
# you may not use this file except in compliance with the License.
6
- # You may obtain a copy of the License at
7
- #
8
- # http://www.apache.org/licenses/LICENSE-2.0
8
+ # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
9
9
#
10
10
# Unless required by applicable law or agreed to in writing, software
11
11
# distributed under the License is distributed on an "AS IS" BASIS,
14
14
# limitations under the License.
15
15
#
16
16
17
- this_app = adsbcot
18
- .DEFAULT_GOAL := all
17
+ REPO_NAME ?= $(shell echo $(wildcard * /__init__.py) | awk -F'/' '{print $$1}')
18
+ SHELL := /bin/bash
19
+ .DEFAULT_GOAL := editable
20
+ # postinst = $(wildcard debian/*.postinst.sh)
21
+ # service = $(wildcard debian/*.service)
19
22
20
- all : editable
23
+ prepare :
24
+ mkdir -p build/
21
25
22
26
develop :
23
27
python3 setup.py develop
@@ -26,13 +30,13 @@ editable:
26
30
python3 -m pip install -e .
27
31
28
32
install_test_requirements :
29
- python3 -m pip install -r requirements_test.txt
33
+ python3 -m pip install -r requirements_test.txt
30
34
31
35
install :
32
36
python3 setup.py install
33
37
34
38
uninstall :
35
- python3 -m pip uninstall -y $(this_app )
39
+ python3 -m pip uninstall -y $(REPO_NAME )
36
40
37
41
reinstall : uninstall install
38
42
@@ -43,16 +47,16 @@ clean:
43
47
@rm -rf * .egg* build dist * .py[oc] * /* .py[co] cover doctest_pypi.cfg \
44
48
nosetests.xml pylint.log output.xml flake8.log tests.log \
45
49
test-result.xml htmlcov fab.log .coverage __pycache__ \
46
- * /__pycache__
50
+ * /__pycache__ deb_dist .mypy_cache
47
51
48
52
pep8 :
49
- flake8 --max-line-length=88 --extend-ignore=E203 --exit-zero $(this_app ) /* .py
53
+ flake8 --max-line-length=88 --extend-ignore=E203 --exit-zero $(REPO_NAME ) /* .py
50
54
51
55
flake8 : pep8
52
56
53
57
lint :
54
58
pylint --msg-template=" {path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
55
- --max-line-length=88 -r n $(this_app ) /* .py || exit 0
59
+ --max-line-length=88 -r n $(REPO_NAME ) /* .py || exit 0
56
60
57
61
pylint : lint
58
62
@@ -68,11 +72,32 @@ pytest:
68
72
test : editable install_test_requirements pytest
69
73
70
74
test_cov :
71
- pytest --cov=$(this_app ) --cov-report term-missing
75
+ pytest --cov=$(REPO_NAME ) --cov-report term-missing
72
76
73
77
black :
74
78
black .
75
79
76
80
mkdocs :
77
81
pip install -r docs/requirements.txt
78
- mkdocs serve
82
+ mkdocs serve
83
+
84
+ deb_dist :
85
+ python3 setup.py --command-packages=stdeb.command sdist_dsc
86
+
87
+ deb_custom :
88
+ cp debian/$(REPO_NAME ) .conf $(wildcard deb_dist/* /debian) /$(REPO_NAME ) .default
89
+ cp debian/$(REPO_NAME ) .postinst $(wildcard deb_dist/* /debian) /$(REPO_NAME ) .postinst
90
+ cp debian/$(REPO_NAME ) .service $(wildcard deb_dist/* /debian) /$(REPO_NAME ) .service
91
+
92
+ bdist_deb : deb_dist deb_custom
93
+ cd deb_dist/$(REPO_NAME ) -* / && dpkg-buildpackage -rfakeroot -uc -us
94
+
95
+ faux_latest :
96
+ cp deb_dist/$(REPO_NAME ) _* -1_all.deb deb_dist/$(REPO_NAME ) _latest_all.deb
97
+ cp deb_dist/$(REPO_NAME ) _* -1_all.deb deb_dist/python3-$(REPO_NAME ) _latest_all.deb
98
+
99
+ package : bdist_deb faux_latest
100
+
101
+ extract :
102
+ dpkg-deb -e $(wildcard deb_dist/* latest_all.deb) deb_dist/extract
103
+ dpkg-deb -x $(wildcard deb_dist/* latest_all.deb) deb_dist/extract
0 commit comments