-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
101 lines (84 loc) · 2.86 KB
/
Makefile
File metadata and controls
101 lines (84 loc) · 2.86 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
#
# Build and test everything.
#
pwd := $(shell pwd)
maybe-lenovo-build = $(if $(wildcard $(pwd)/oem/lenovo/*.xml),cargo build --features oem-lenovo)
space := $(empty) $(empty)
comma :=,
indent := $(empty) $(empty)
define new-line
$(empty)
$(empty)
endef
# We cannot use --all-features because they depends on oem files that
# are not distributed by the repo.
all-std-features = accounts \
assembly \
bios \
boot-options \
chassis \
computer-systems \
ethernet-interfaces \
log-services \
memory \
network-adapters \
power \
power-supplies \
processors \
secure-boot \
sensors \
session-service \
storages \
thermal \
update-service \
event-service
# Features that cannot be compiled standalone (no references from the tree).
std-not-standalone-features = assembly \
bios \
boot-options \
ethernet-interfaces \
log-services \
network-adapters \
processors \
power \
power-supplies \
secure-boot \
sensors \
storages
std-standalone-features = $(filter-out $(std-not-standalone-features),$(all-std-features))
ci-features-list := $(subst $(space),$(comma),$(all-std-features))
compile-one-feature = $(indent)cargo build -p nv-redfish --features $1$(new-line)
define build-and-test
cargo build -p nv-redfish --features managers,oem-hpe
cargo build -p nv-redfish --features managers,oem-supermicro
cargo build -p nv-redfish --features chassis,power-supplies,oem-liteon
cargo build
cargo build -p nv-redfish
cargo build -p nv-redfish-tests --tests
cargo build -p nv-redfish-bmc-mock
cargo test $1 -- --no-capture
cargo clippy $1
cargo build $1
cargo build -p nv-redfish --features computer-systems,bios,boot-options,storages,memory,processors
cargo build -p nv-redfish --features oem-hpe,accounts
$(maybe-lenovo-build)
cargo build -p nv-redfish --features oem-hpe
cargo build -p nv-redfish --features oem-nvidia
cargo build -p nv-redfish --features computer-systems,oem-nvidia-bluefield
cargo build -p nv-redfish --features oem-dell
cargo build -p nv-redfish --features oem-ami
cargo build -p nv-redfish --features managers,oem-dell-attributes
$(foreach f,$(std-standalone-features),$(call compile-one-feature,$f))
cargo build -p nv-redfish --features ""
cargo doc $1
cargo build
endef
all:
$(call build-and-test,--all-features)
ci: rust-install
$(call build-and-test,--features $(ci-features-list))
rust-install:
rustup component add clippy
clean:
rm -rf $(schema-dir)
rm -rf target