xref: /NovaShell/Makefile (revision dcc611d712e5611c796226bef3694bd991c34356)
181c61261SMemoryShore# The toolchain we use.
281c61261SMemoryShore# You can get it by running DragonOS' `tools/bootstrap.sh`
3*dcc611d7STTaq# TOOLCHAIN="+nightly-2023-08-15-x86_64-unknown-linux_dragonos-gnu"
4*dcc611d7STTaq# RUSTFLAGS+="-C target-feature=+crt-static -C link-arg=-no-pie"
56f50094aSMemoryShore
681c61261SMemoryShore# 如果是在dadk中编译,那么安装到dadk的安装目录中
781c61261SMemoryShoreINSTALL_DIR?=$(DADK_CURRENT_BUILD_DIR)
881c61261SMemoryShore# 如果是在本地编译,那么安装到当前目录下的install目录中
981c61261SMemoryShoreINSTALL_DIR?=./install
106f50094aSMemoryShore
1181c61261SMemoryShore
1281c61261SMemoryShorerun:
1381c61261SMemoryShore	RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) run
146f50094aSMemoryShore
156f50094aSMemoryShorebuild:
1681c61261SMemoryShore	RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) build
176f50094aSMemoryShore
18*dcc611d7STTaqcheck:
19*dcc611d7STTaq	RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) check --all-features
20*dcc611d7STTaq
216f50094aSMemoryShoreclean:
2281c61261SMemoryShore	RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) clean
236f50094aSMemoryShore
2481c61261SMemoryShoretest:
2581c61261SMemoryShore	RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) test
266f50094aSMemoryShore
2781c61261SMemoryShoredoc:
2881c61261SMemoryShore	RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) doc
296f50094aSMemoryShore
30*dcc611d7STTaqfmt:
31*dcc611d7STTaq	RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) fmt
32*dcc611d7STTaq
33*dcc611d7STTaqfmt-check:
34*dcc611d7STTaq	RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) fmt --check
35*dcc611d7STTaq
3681c61261SMemoryShorerun-release:
3781c61261SMemoryShore	RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) run --release
3881c61261SMemoryShore
3981c61261SMemoryShorebuild-release:
4081c61261SMemoryShore	RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) build --release
4181c61261SMemoryShore
4281c61261SMemoryShoreclean-release:
4381c61261SMemoryShore	RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) clean --release
4481c61261SMemoryShore
4581c61261SMemoryShoretest-release:
4681c61261SMemoryShore	RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) test --release
4781c61261SMemoryShore
4881c61261SMemoryShore.PHONY: install
4981c61261SMemoryShoreinstall:
5081c61261SMemoryShore	RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) install --path . --no-track --root $(INSTALL_DIR) --force
51