Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
164 lines (117 loc) · 4.24 KB
/
Copy pathMakefile
File metadata and controls
164 lines (117 loc) · 4.24 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
SHELL := /bin/bash
.DEFAULT_GOAL := all
LLVM_PREFIX ?= /opt/homebrew/opt/llvm
CLANG ?= $(if $(wildcard $(LLVM_PREFIX)/bin/clang),$(LLVM_PREFIX)/bin/clang,clang)
PYTHON ?= python3
QEMU ?= qemu-system-x86_64
OVMF ?=
CPUS ?= 4
MEMORY ?= 256M
LEDGER_PORT ?=
STATE_DISK ?= var/stratum-data.img
export SOURCE_DATE_EPOCH := 1700000000
export CLANG QEMU OVMF
BUILD_DIR := build
BOOT_DISK := $(BUILD_DIR)/images/stratum-boot.img
DATA_DISK := $(BUILD_DIR)/images/stratum-data.img
.PHONY: all bootstrap doctor build image run debug test smoke test-boot test-mm test-smp \
test-sched test-abi test-drivers test-storage test-storage-crash test-net test-net-wrap test-tcp-campaign test-net-reject test-service test-faults fuzz fuzz-production soak bench \
docs scope-check demo evidence acceptance verify test-acceptance-controls release clean
all: image
bootstrap: doctor
doctor:
@$(PYTHON) scripts/doctor.py
build:
@$(MAKE) -f scripts/build_subsystems.mk PYTHON="$(PYTHON)" build-all
image: build
@$(PYTHON) scripts/build_image.py --boot-img "$(BOOT_DISK)" --data-img "$(DATA_DISK)" \
--loader "$(BUILD_DIR)/BOOTX64.EFI" --kernel "$(BUILD_DIR)/stratum.elf" \
--initramfs "$(BUILD_DIR)/initramfs.cpio"
VM_ARGS = --boot-img "$(BOOT_DISK)" --data-img "$(STATE_DISK)" --data-template "$(DATA_DISK)" \
--cpus "$(CPUS)" --mem "$(MEMORY)" $(if $(LEDGER_PORT),--ledger-port "$(LEDGER_PORT)")
run: image
@$(PYTHON) scripts/run_vm.py $(VM_ARGS)
debug: image
@$(PYTHON) scripts/run_vm.py $(VM_ARGS) --gdb 1234
test:
@$(PYTHON) scripts/run_tests.py
smoke: image
@$(PYTHON) scripts/test_smoke.py
@$(PYTHON) scripts/test_recovery.py
@$(PYTHON) scripts/test_ledger.py
@$(PYTHON) scripts/test_replication.py
test-boot: image
@$(PYTHON) scripts/test_boot.py
@$(PYTHON) scripts/test_smoke.py --matrix
test-mm test-smp test-sched test-abi test-faults: image
@$(PYTHON) scripts/test_diagnostics.py $(patsubst test-%,%,$@)
test-drivers: image
@$(PYTHON) scripts/test_block_wrap.py
@$(PYTHON) scripts/test_block_errors.py
test-storage: image
@$(PYTHON) scripts/test_diagnostics.py storage
@$(PYTHON) scripts/test_recovery.py
test-storage-crash: image
@$(PYTHON) scripts/test_wal_crash.py --repeats 10
.PHONY: test-boot-campaign test-exec test-threads test-tlb test-ipc test-storage-mixed test-storage-namespace test-shared
test-boot-campaign: image
@$(PYTHON) scripts/test_boot_campaign.py
test-exec: image
@$(PYTHON) scripts/test_exec.py
test-threads: image
@$(PYTHON) scripts/test_threads.py
test-tlb: image
@$(PYTHON) scripts/test_tlb.py
test-shared: image
@$(PYTHON) scripts/test_shared.py
test-ipc: image
@$(PYTHON) scripts/test_ipc.py
test-storage-namespace: image
@$(PYTHON) scripts/test_storage_namespace.py
test-storage-mixed: image
@$(PYTHON) tests/host/wal_model.py
@$(PYTHON) scripts/test_storage_mixed.py
test-net demo: image
@$(PYTHON) scripts/test_ledger.py
@$(PYTHON) scripts/test_replication.py
test-net-wrap: image
@$(PYTHON) scripts/test_net_wrap.py
test-tcp-campaign: image
@$(PYTHON) scripts/test_tcp_campaign.py
test-net-reject: image
@$(PYTHON) scripts/test_net_reject.py
test-service: image
@$(PYTHON) scripts/test_ledger_load.py
EXTRA_GUEST_TESTS = cancel block-timeout storage-cache tmpfs trace framebuffer tcp-reference tcp-recovery icmp supervision entry-stacks resource-limits deadlines
.PHONY: $(addprefix test-,$(EXTRA_GUEST_TESTS))
$(addprefix test-,$(EXTRA_GUEST_TESTS)): image
@$(PYTHON) scripts/test_$(subst -,_,$(patsubst test-%,%,$@)).py
fuzz-production:
@$(PYTHON) scripts/fuzz_production.py
fuzz:
@$(PYTHON) scripts/run_fuzz.py
soak: image
@$(PYTHON) scripts/test_soak.py
.PHONY: bench-guest bench-compare
bench-compare:
@$(PYTHON) scripts/compare_benchmarks.py "$(BASELINE)"
bench-guest: image
@$(PYTHON) scripts/test_guest_bench.py
bench:
@$(PYTHON) scripts/run_benchmarks.py
docs:
@$(PYTHON) scripts/check_docs.py
scope-check:
@$(PYTHON) scripts/scope_check.py
evidence:
@$(PYTHON) scripts/run_acceptance.py --smoke
acceptance:
@$(PYTHON) scripts/run_acceptance.py
verify:
@$(PYTHON) scripts/verify_evidence.py $(if $(EVIDENCE),"$(EVIDENCE)")
test-acceptance-controls:
@$(PYTHON) scripts/test_acceptance_controls.py "$(EVIDENCE)"
release:
@$(PYTHON) scripts/package_release.py "$(EVIDENCE)"
clean:
@rm -rf "$(BUILD_DIR)"