-
Notifications
You must be signed in to change notification settings - Fork 108
/
Copy pathMakefile
65 lines (50 loc) · 1.55 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
help:
@echo 'Make options:'
@echo 'firsttime -- for the first time you run make'
@echo 'update -- to update the install'
@echo 'format -- to format all files'
# NOTE: These are the host utilities, requiring their own recent Rust version.
RUST_VER := 1.85
BINUTILS_VER := 0.3.6
DPRINT_VER := 0.49.1
CARGOINST := rustup run --install $(RUST_VER) cargo install
.PHONY: firsttime
firsttime:
$(CARGOINST) $(if $(BINUTILS_VER),--version $(BINUTILS_VER),) cargo-binutils
$(CARGOINST) $(if $(DPRINT_VER),--version $(DPRINT_VER),) dprint
.PHONY: nexttime
nexttime:
$(CARGOINST) --force $(if $(BINUTILS_VER),--version $(BINUTILS_VER),) cargo-binutils
$(CARGOINST) --force $(if $(DPRINT_VER),--version $(DPRINT_VER),) dprint
.PHONY: debiansysprepare
debiansysprepare: rustprepare
# -y makes the install command non-interactive.
sudo apt-get install -y device-tree-compiler qemu-system
.PHONY: rustprepare
rustprepare:
# -y makes the installation non-interactive.
curl https://sh.rustup.rs -sSf | sh -s -- -y
.PHONY: update
update:
rustup update
rustup toolchain install
.PHONY: ciprepare
ciprepare: debiansysprepare firsttime update
.PHONY: format
format:
dprint fmt
.PHONY: checkformat
checkformat:
dprint check
clippy:
cargo clippy -- -D warnings
MAINBOARDS := $(wildcard src/mainboard/*/*/Makefile)
.PHONY: $(MAINBOARDS)
mainboards: $(MAINBOARDS)
$(MAINBOARDS):
make --no-print-directory -C $(dir $@)
# convenience target: this should be the full ci flow
checkandbuildall: ciprepare clippy checkformat mainboards
echo "Done CI!"
clean:
rm -rf $(TOP)/target