-
Notifications
You must be signed in to change notification settings - Fork 29
/
Makefile
61 lines (43 loc) · 1.05 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
.PHONY: example
# setup development environment
setup: update-venv
install-svd2rust-form-rustfmt:
rustup component add rustfmt
cargo install svd2rust form
# 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:
venv/bin/black --check svdtools/
apply-black:
venv/bin/black svdtools/
apply-isort:
venv/bin/isort svdtools/
check-isort:
venv/bin/isort --check-only 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