1 Star 0 Fork 0

rcore-os/RVM1.5

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Makefile 1.75 KB
一键复制 编辑 原始数据 按行查看 历史
equation314 提交于 2022-01-30 16:49 +08:00 . Update rust-toolchain to 2021-12-05
# Commands:
# make build Build
# make test Run `cargo test`
# make fmt Run `cargo fmt`
# make clippy Run `cargo clippy`
# make disasm Open the disassemble file of the last build
# make clean Clean
#
# Arguments:
# LOG = off | error | warn | info | debug | trace
# ARCH = x86_64
# VENDOR = intel | amd [ x86_64 only ] Build for Intel or AMD CPUs.
# STATS = on | off Given performance statistics.
ARCH ?= x86_64
VENDOR ?= intel
LOG ?=
STATS ?= off
PORT ?= 2333
# do not support debug mode
MODE := release
export MODE
export LOG
export ARCH
export VENDOR
export STATS
OBJDUMP ?= objdump
OBJCOPY ?= objcopy
build_path := target/$(ARCH)/$(MODE)
target_elf := $(build_path)/rvm
target_bin := $(build_path)/rvm-$(VENDOR).bin
ifeq ($(ARCH), x86_64)
features := $(VENDOR)
else
features :=
endif
ifeq ($(STATS), on)
features += --features stats
endif
build_args := --features "$(features)" --target $(ARCH).json -Z build-std=core,alloc -Z build-std-features=compiler-builtins-mem
ifeq ($(MODE), release)
build_args += --release
endif
.PHONY: all
all: $(target_bin)
.PHONY: elf
elf:
cargo build $(build_args)
$(target_bin): elf
$(OBJCOPY) $(target_elf) --strip-all -O binary $@
.PHONY: disasm
disasm:
$(OBJDUMP) -d $(target_elf) -M intel | less
.PHONY: clippy
clippy:
cargo clippy $(build_args)
.PHONY: test
test:
cargo test --features "$(features)" --release -- --nocapture
.PHONY: fmt
fmt:
cargo fmt
.PHONY: clean
clean:
cargo clean
.PHONY: install
install:
sudo cp $(target_bin) /lib/firmware
.PHONY: scp
scp:
scp -P $(PORT) -r $(target_bin) ubuntu@localhost:/home/ubuntu
.PHONY: ssh
ssh:
ssh -p $(PORT) ubuntu@localhost
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/rcore-os/RVM1.5.git
git@gitee.com:rcore-os/RVM1.5.git
rcore-os
RVM1.5
RVM1.5
main

搜索帮助