-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
115 lines (85 loc) · 2.89 KB
/
Copy pathMakefile
File metadata and controls
115 lines (85 loc) · 2.89 KB
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# SETTINGS
ADA_NODE := ada.local
help:
@grep -E '^[a-zA-Z_-].+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-18s\033[0m %s\n", $$1, $$2}'
.PHONY: help
# DEV TOOLCHAIN
all: dev.setup rpi0.burn ## Installs tools and dependencies, produces a firmware file
.PHONY: all
dev.setup: dev.base dev.deps-get ## Installs tools and dependencies
.PHONY: dev.setup
dev.base: ## Installs base requirements
mix local.rebar --force
mix local.hex --force
mix archive.install hex nerves_bootstrap --force
.PHONY: dev.base
dev.deps-get: ## Fetches dependencies
MIX_TARGET=rpi0 mix deps.get
MIX_TARGET=host mix deps.get
.PHONY: dev.deps-get
dev.deps-outdated: ## Show outdated dependencies
MIX_TARGET=rpi0 mix hex.outdated || true
MIX_TARGET=host mix hex.outdated || true
.PHONY: dev.deps-outdated
dev.deps-update: ## Updates all dependencies
MIX_TARGET=rpi0 mix deps.update --all
MIX_TARGET=host mix deps.update --all
.PHONY: dev.deps-update
# FIRMWARE MANAGEMENT
rpi0.firmware: ## Produces the firmware file
MIX_TARGET=rpi0 mix firmware
.PHONY: rpi0.firmware
rpi0.burn: ## Produces the firmware file and burns it on a SD card
MIX_TARGET=rpi0 mix do firmware, firmware.burn
.PHONY: rpi0.burn
rpi0.push: ## Updates the firmware on the device over-the-air
MIX_TARGET=rpi0 mix firmware
./script/upload.sh $(ADA_NODE) _build/rpi0_dev/nerves/images/ada.fw
.PHONY: rpi0.push
rpi0.ssh: ## Connects to the running Ada instance via SSH
ssh $(ADA_NODE)
.PHONY: rpi0.ssh
# HOST TASKS
host.cli: ## Produces the ada CLI remote control executable
MIX_TARGET=host mix escript.build
.PHONY: host.cli
host.test: ## Runs the test suite
MIX_TARGET=host MIX_ENV=test mix test
.PHONY: host.test
host.dialyzer: ## Runs Dialyzer on host
MIX_TARGET=host mix dialyzer
.PHONY: host.dialyzer
host.docs: ## Produces documentation on host
mix docs
.PHONY: host.docs
host.shell: ## Opens a local, interactive shell
MIX_TARGET=host iex -S mix
.PHONY: host.shell
host.ci-build: ## Uses CircleCI to simulate a CI run locally
circleci build
.PHONY: host.ci-build
# CI
ci.base: dev.base ## Installs needed tools for CI
.PHONY: ci.base
ci.setup: ci.base ## Installs needed tools and deps for CI
MIX_TARGET=host mix deps.get
MIX_TARGET=host MIX_ENV=test mix deps.get
.PHONY: ci.setup
ci.compile: ## Compiles the codebase
MIX_TARGET=host mix compile
.PHONY: ci.compile
ci.test: test/reports/ex_unit ## Runs tests on CI
MIX_TARGET=host MIX_ENV=test mix test
.PHONY: ci.test
test/reports/ex_unit:
mkdir -p $@
ci.dialyzer: ## Runs Dialyzer on CI
MIX_TARGET=host mix dialyzer --halt-exit-status
.PHONY: ci.dialyzer
ci.docs-build: ## Produces documentation suitable for CI deployment
mkdir -p doc/_ci_build
mix docs -o doc/_ci_build
.PHONY: ci.docs-build
ci.docs-deploy: ## Deploys documentation built on CI
gh-pages --dotfiles --dist doc/_ci_build --message 'Updates deriving from commit $(COMMIT_SHA)'
.PHONY: ci.docs-deploy