This repository has been archived by the owner on Jul 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
82 lines (69 loc) · 1.68 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
PROFILE ?= release
ifeq (${PROFILE},release)
PROFILE_FLAGS=--release
else ifeq (${PROFILE},debug)
PROFILE_FLAGS=
else
$(error Invalid profile: ${PROFILE})
endif
RSYNC ?= rsync -riP --compress-level=9
TARGET ?= armv7-unknown-linux-musleabihf
PI ?= blueberry-pie.zt
define i
@echo
@echo -e
endef
.PHONY: all
all: test
.PHONY: test
test: test-rust test-python
.PHONY: test-python
test-python:
$i "Checking version..."
cd puddle-python; ./setup.py --version
$i "Linting src..."
cd puddle-python; pyflakes puddle
$i "Linting tests..."
cd puddle-python; pyflakes tests
$i "Linting examples..."
cd puddle-python; pyflakes examples
$i "Testing..."
cd puddle-python; time ./setup.py test
$i "Checking formatting..."
cd puddle-python; yapf --recursive --diff .
.PHONY: test-rust
test-rust:
$i "Checking version..."
rustc --version
cargo --version
$i "Building..."
time cargo build
$i "Testing..."
time cargo test
$i "Linting..."
time cargo clippy --tests
$i "Formatting..."
cargo fmt -- --check
.PHONY: test-js
test-js:
$i "Checking version..."
npm --version
$i "Building..."
cd puddle-js; npm run build -- --mode development
.PHONY: sync
sync: sync-boards sync-server sync-pi-test
.PHONY: sync-boards
sync-boards:
${RSYNC} --relative tests/./arches/*.yaml ${PI}:
.PHONY: sync-server
sync-server:
cargo build ${PROFILE_FLAGS} --target ${TARGET} --bin puddle-server
${RSYNC} target/${TARGET}/${PROFILE}/puddle-server ${PI}:
.PHONY: sync-pi-test
sync-pi-test:
cargo build --target ${TARGET} --bin pi-test
${RSYNC} target/${TARGET}/debug/pi-test ${PI}:
.PHONY: sync-web-demo
sync-web-demo:
cd puddle-js; npm run build
${RSYNC} puddle-js/dist/ mwillsey.com:/var/www/stuff/puddle-demo/