forked from DragonOS-Community/NovaShell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (35 loc) · 1.29 KB
/
Makefile
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
50
# The toolchain we use.
# You can get it by running DragonOS' `tools/bootstrap.sh`
# TOOLCHAIN="+nightly-2023-08-15-x86_64-unknown-linux_dragonos-gnu"
# RUSTFLAGS+="-C target-feature=+crt-static -C link-arg=-no-pie"
# 如果是在dadk中编译,那么安装到dadk的安装目录中
INSTALL_DIR?=$(DADK_CURRENT_BUILD_DIR)
# 如果是在本地编译,那么安装到当前目录下的install目录中
INSTALL_DIR?=./install
run:
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) run
build:
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) build
check:
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) check --all-features
clean:
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) clean
test:
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) test
doc:
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) doc
fmt:
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) fmt
fmt-check:
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) fmt --check
run-release:
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) run --release
build-release:
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) build --release
clean-release:
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) clean --release
test-release:
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) test --release
.PHONY: install
install:
RUSTFLAGS=$(RUSTFLAGS) cargo $(TOOLCHAIN) install --path . --no-track --root $(INSTALL_DIR) --force