-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
32 lines (21 loc) · 725 Bytes
/
Makefile
File metadata and controls
32 lines (21 loc) · 725 Bytes
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
HOST_TARGET := $(shell rustc -vV | sed -n 's|host: ||p')
TARGET := riscv64gc-unknown-none-elf
BINARY_NAME := riscmon
DEBUG_DIR := target/$(TARGET)/debug
RELEASE_DIR := target/$(TARGET)/release
QEMU := qemu-system-riscv64
QEMU_FLAGS := -machine virt -nographic -bios none
.PHONY: all debug release clean run run.release test.integration
all: debug
debug:
cargo build --target $(TARGET)
release:
cargo build --target $(TARGET) --release
clean:
cargo clean
run: debug
$(QEMU) $(QEMU_FLAGS) -kernel $(DEBUG_DIR)/$(BINARY_NAME)
run.release: release
$(QEMU) $(QEMU_FLAGS) -kernel $(RELEASE_DIR)/$(BINARY_NAME)
test.integration: debug
cargo test --manifest-path tests/integration/Cargo.toml --target $(HOST_TARGET)