-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (37 loc) · 1.51 KB
/
Makefile
File metadata and controls
49 lines (37 loc) · 1.51 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
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
# option. This file may not be copied, modified, or distributed
# except according to those terms.
TARGET := --target aarch64-unknown-none
PAYLOAD ?= payload.bin
QEMU_BIN := target/ritm.qemu.bin
QEMU_RUSTFLAGS := "--cfg platform=\"qemu\""
.PHONY: all build.qemu clean clippy qemu test
all: $(QEMU_BIN)
clippy:
RITM_PAYLOAD=/dev/null RUSTFLAGS=$(QEMU_RUSTFLAGS) cargo clippy $(TARGET)
clippy-fix:
RITM_PAYLOAD=/dev/null RUSTFLAGS=$(QEMU_RUSTFLAGS) cargo clippy --fix $(TARGET)
build.qemu:
RITM_PAYLOAD=$(PAYLOAD) RUSTFLAGS=$(QEMU_RUSTFLAGS) cargo build $(TARGET)
$(QEMU_BIN): build.qemu
RITM_PAYLOAD=$(PAYLOAD) RUSTFLAGS=$(QEMU_RUSTFLAGS) cargo objcopy $(TARGET) -- -O binary $@
qemu: $(QEMU_BIN)
qemu-system-aarch64 -machine virt,virtualization=on,gic-version=3 -cpu cortex-a57 -display none -kernel $< -s \
-smp 4 -serial mon:stdio \
-global virtio-mmio.force-legacy=false \
-drive file=/dev/null,if=none,format=raw,id=x0 \
-device virtio-blk-device,drive=x0 \
-device virtio-serial,id=virtio-serial0 \
-chardev socket,path=/tmp/qemu-console,server=on,wait=off,id=char0,mux=on \
-device virtconsole,chardev=char0 \
-device vhost-vsock-device,id=virtiosocket0,guest-cid=102 \
-append "ritm.boot_mode=el1"
test:
tests/integration_test.py
clean:
cargo clean
rm -f target/*.bin