forked from rust-embedded/svdtools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (40 loc) · 977 Bytes
/
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
.PHONY: example
# setup development environment
setup: update-venv
# example usage
example:
venv/bin/svd patch example/incomplete-stm32l4x2.yaml
# ensure this passes before commiting
check: check-black check-isort
# automatic code fixes
fix: apply-black apply-isort
check-black:
black --check svdtools/
apply-black:
black svdtools/
apply-isort:
isort -y --recursive svdtools/
check-isort:
isort --check-only --recursive svdtools/
semi-clean:
rm -rf **/__pycache__
clean: semi-clean
rm -rf venv
rm -rf dist
# Package management
VERSION_FILE := "svdtools/VERSION"
VERSION := $(shell cat $(VERSION_FILE))
tag:
git tag -a $(VERSION) -m"v$(VERSION)"
build: check
flit build
publish: check
flit --repository pypi publish
venv:
python3 -m venv venv
# re-run if dev or runtime dependencies change,
# or when adding new scripts
update-venv: venv
venv/bin/pip install -U pip
venv/bin/pip install -U -r dev-requirements.txt
venv/bin/flit install --symlink