mirror of
https://github.com/DragonOS-Community/DragonOS.git
synced 2026-09-08 23:57:59 +08:00
- Update Docker images and Rust toolchain to v1.23 and nightly-2026-02-24 - Update printf-compat dependency from git to crates.io v0.3.1 - Update xarray dependency to newer git revision - Add DragonReach to app blocklist - Fix various code issues and improve code quality - Update target specification files for architecture consistency Signed-off-by: longjin <longjin@DragonOS.org>
58 lines
1.6 KiB
Makefile
58 lines
1.6 KiB
Makefile
TOOLCHAIN="+nightly-2026-02-24-x86_64-unknown-linux-gnu"
|
|
RUSTFLAGS+=""
|
|
|
|
ifdef DADK_CURRENT_BUILD_DIR
|
|
# 如果是在dadk中编译,那么安装到dadk的安装目录中
|
|
INSTALL_DIR = $(DADK_CURRENT_BUILD_DIR)
|
|
else
|
|
# 如果是在本地编译,那么安装到当前目录下的install目录中
|
|
INSTALL_DIR = ./install
|
|
endif
|
|
|
|
ifeq ($(ARCH), x86_64)
|
|
export RUST_TARGET=x86_64-unknown-linux-musl
|
|
export CC=x86_64-linux-musl-gcc
|
|
else ifeq ($(ARCH), riscv64)
|
|
export RUST_TARGET=riscv64gc-unknown-linux-musl
|
|
else
|
|
# 默认为x86_86,用于本地编译
|
|
export RUST_TARGET=x86_64-unknown-linux-musl
|
|
endif
|
|
|
|
run:
|
|
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) run --target $(RUST_TARGET)
|
|
|
|
build:
|
|
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) build --target $(RUST_TARGET)
|
|
|
|
clean:
|
|
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) clean --target $(RUST_TARGET)
|
|
|
|
test:
|
|
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) test --target $(RUST_TARGET)
|
|
|
|
doc:
|
|
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) doc --target $(RUST_TARGET)
|
|
|
|
fmt:
|
|
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) fmt
|
|
|
|
fmt-check:
|
|
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) fmt --check
|
|
|
|
run-release:
|
|
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) run --target $(RUST_TARGET) --release
|
|
|
|
build-release:
|
|
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) build -Zbuild-std --target $(RUST_TARGET) --release
|
|
|
|
clean-release:
|
|
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) clean --target $(RUST_TARGET) --release
|
|
|
|
test-release:
|
|
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) test --target $(RUST_TARGET) --release
|
|
|
|
.PHONY: install
|
|
install:
|
|
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) install --target $(RUST_TARGET) --path . --no-track --root $(INSTALL_DIR) --force
|