-
Notifications
You must be signed in to change notification settings - Fork 10
/
Makefile
69 lines (59 loc) · 1.54 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
#
# Copyright 2024 Oxide Computer Company
#
TOP = $(PWD)
HELIOS_BUILD = $(TOP)/tools/helios-build/target/debug/helios-build
.PHONY: welcome
welcome: gmakecheck
@printf '\n'
@printf 'Welcome to the Helios build system\n'
@printf '\n'
@printf '\n'
@if ! cargo --version >/dev/null 2>&1; then \
printf ' You must install Rust before continuing.\n'; \
else \
printf ' Try "gmake setup" to get started!\n'; \
fi
@printf '\n'
.PHONY: gmakecheck
gmakecheck:
@if [[ -z "$(.FEATURES)" ]]; then \
printf 'ERROR: This Makefile requires GNU Make (gmake)\n' >&2; \
exit 1; \
fi
.PHONY: cargocheck
cargocheck:
@if ! cargo --version >/dev/null 2>&1; then \
printf ' You must install Rust before continuing.\n' >&2; \
exit 1; \
fi
#
# Run a "quick" build of illumos for development:
#
.PHONY: illumos
illumos: gmakecheck $(HELIOS_BUILD)
$(HELIOS_BUILD) build-illumos -q
#
# Enter the "quick" build environment so that you can run dmake, etc:
#
.PHONY: bldenv
bldenv: gmakecheck $(HELIOS_BUILD)
$(HELIOS_BUILD) bldenv -q
.PHONY: setup
setup: gmakecheck $(HELIOS_BUILD)
@$(HELIOS_BUILD) setup
rm -f helios-build
ln -s tools/helios-build/target/debug/helios-build
@printf '\n'
@printf 'Setup complete! ./helios-build is now available.\n'
@printf '\n'
.PHONY: $(HELIOS_BUILD)
$(HELIOS_BUILD): cargocheck
@if [[ $$(/usr/bin/uname -o) != illumos ]]; then \
printf 'ERROR: must be built on illumos\n' >&2; \
exit 1; \
fi
cd tools/helios-build && cargo build --quiet
.PHONY: clean
clean:
cd tools/helios-build && cargo clean --quiet