-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
45 lines (35 loc) · 805 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
.PHONY: default
default: all;
.PHONY: clean
clean:
rm -rf src
.PHONY: setup
setup:
cargo install --force svd2rust form
rustup target add thumbv7em-none-eabihf
rustup component add rustfmt
.PHONY: generate
generate: clean
svd2rust -i MK64F12.svd
form -i lib.rs -o src/ && rm lib.rs
cargo fmt
.PHONY: package
package:
cargo package
.PHONY: examples
examples:
(cd examples/flash_led_lptmr; cargo build)
check_master:
@echo "check if on master"
git branch | grep \* | cut -d ' ' -f2 | grep -q master
no_diff:
@echo "check if master is even with origin"
git diff -s --exit-code origin/master
check_tag:
@echo "check if HEAD is tagged"
git describe --tags --exact-match HEAD
.PHONY: publish
publish: check_master no_diff check_tag
cargo publish
.PHONY: all
all: setup generate package