mirror of
https://github.com/panpaul/tiny_os
synced 2024-09-20 17:55:20 +08:00
feat: switch to cargo-make
This commit is contained in:
parent
daaea9d158
commit
e7c1a7a656
24
.github/workflows/rust.yml
vendored
24
.github/workflows/rust.yml
vendored
@ -10,17 +10,21 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: dtolnay/rust-toolchain@master
|
|
||||||
|
- name: Install Qemu
|
||||||
|
uses: ConorMacBride/install-package@v1
|
||||||
|
with:
|
||||||
|
apt: qemu-system
|
||||||
|
|
||||||
|
- name: Install Rust
|
||||||
|
uses: dtolnay/rust-toolchain@master
|
||||||
with:
|
with:
|
||||||
toolchain: nightly
|
toolchain: nightly
|
||||||
targets: riscv64imac-unknown-none-elf
|
targets: riscv64imac-unknown-none-elf
|
||||||
components: clippy
|
components: clippy
|
||||||
- uses: ConorMacBride/install-package@v1
|
|
||||||
with:
|
- name: Install cargo-make
|
||||||
apt: qemu-system
|
run: cargo install cargo-make
|
||||||
- name: Clippy
|
|
||||||
run: cargo clippy
|
- name: Run CI Flow
|
||||||
- name: Build
|
run: cargo make ci-flow
|
||||||
run: cargo build --verbose
|
|
||||||
- name: Test
|
|
||||||
run: cargo test
|
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
|
/.idea
|
||||||
/target
|
/target
|
||||||
|
8
.idea/.gitignore
vendored
8
.idea/.gitignore
vendored
@ -1,8 +0,0 @@
|
|||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
# Editor-based HTTP Client requests
|
|
||||||
/httpRequests/
|
|
||||||
# Datasource local storage ignored files
|
|
||||||
/dataSources/
|
|
||||||
/dataSources.local.xml
|
|
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="CompilerExplorerSettingsProvider">
|
|
||||||
<option name="enabled" value="false" />
|
|
||||||
<option name="url" value="https://godbolt.org" />
|
|
||||||
<option name="initialNoticeShown" value="true" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="JavaScriptLibraryMappings">
|
|
||||||
<includedPredefinedLibrary name="Node.js Core" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="RsVcsConfiguration">
|
|
||||||
<option name="rustFmt" value="true" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
@ -1,9 +1,9 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<module type="CPP_MODULE" version="4">
|
<module type="EMPTY_MODULE" version="4">
|
||||||
<component name="NewModuleRootManager">
|
<component name="NewModuleRootManager">
|
||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
<sourceFolder url="file://$MODULE_DIR$/kernel/src" isTestSource="false" />
|
<sourceFolder url="file://$MODULE_DIR$/kernel/src" isTestSource="false" />
|
||||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
<excludeFolder url="file://$MODULE_DIR$/kernel/target" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
|
@ -2,6 +2,5 @@
|
|||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="VcsDirectoryMappings">
|
<component name="VcsDirectoryMappings">
|
||||||
<mapping directory="" vcs="Git" />
|
<mapping directory="" vcs="Git" />
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
@ -1,3 +0,0 @@
|
|||||||
[workspace]
|
|
||||||
resolver = "2"
|
|
||||||
members = ["kernel"]
|
|
18
Makefile.toml
Normal file
18
Makefile.toml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
[env]
|
||||||
|
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
|
||||||
|
CARGO_MAKE_WORKSPACE_EMULATION = true
|
||||||
|
CARGO_MAKE_CRATE_WORKSPACE_MEMBERS = [
|
||||||
|
"kernel"
|
||||||
|
]
|
||||||
|
|
||||||
|
[tasks.clipppy]
|
||||||
|
install_crate = "clippy"
|
||||||
|
command = "cargo"
|
||||||
|
args = ["clippy"]
|
||||||
|
dependencies = ["fmt"]
|
||||||
|
|
||||||
|
[tasks.build]
|
||||||
|
args = ["build"]
|
||||||
|
|
||||||
|
[tasks.test]
|
||||||
|
args = ["test"]
|
2
kernel/.gitignore
vendored
Normal file
2
kernel/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
/.idea
|
||||||
|
/target
|
23
Cargo.lock → kernel/Cargo.lock
generated
23
Cargo.lock → kernel/Cargo.lock
generated
@ -26,6 +26,12 @@ version = "2.4.2"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf"
|
checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cfg-if"
|
||||||
|
version = "1.0.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "critical-section"
|
name = "critical-section"
|
||||||
version = "1.1.2"
|
version = "1.1.2"
|
||||||
@ -42,14 +48,15 @@ checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89"
|
|||||||
name = "kernel"
|
name = "kernel"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.4.2",
|
"bitflags 2.4.2",
|
||||||
"lazy_static",
|
"cfg-if",
|
||||||
"log",
|
"lazy_static",
|
||||||
"riscv",
|
"log",
|
||||||
"sbi-rt",
|
"riscv",
|
||||||
"spin 0.9.8",
|
"sbi-rt",
|
||||||
"static_assertions",
|
"spin 0.9.8",
|
||||||
"uart_16550",
|
"static_assertions",
|
||||||
|
"uart_16550",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
@ -13,7 +13,6 @@ arch_riscv32 = []
|
|||||||
|
|
||||||
board_default = []
|
board_default = []
|
||||||
board_virt = []
|
board_virt = []
|
||||||
board_thead = []
|
|
||||||
|
|
||||||
log_color = []
|
log_color = []
|
||||||
|
|
||||||
@ -25,9 +24,10 @@ panic = "abort"
|
|||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
|
lto = "thin"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bitflags = "2.4.1"
|
bitflags = "2.4.2"
|
||||||
lazy_static = { version = "1.4.0", features = ["spin_no_std"] }
|
lazy_static = { version = "1.4.0", features = ["spin_no_std"] }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
riscv = { version = "0.11.1", features = ["s-mode"] }
|
riscv = { version = "0.11.1", features = ["s-mode"] }
|
||||||
@ -35,3 +35,4 @@ sbi-rt = { version = "0.0.3", features = ["legacy"] }
|
|||||||
spin = "0.9.8"
|
spin = "0.9.8"
|
||||||
static_assertions = "1.1.0"
|
static_assertions = "1.1.0"
|
||||||
uart_16550 = "0.3"
|
uart_16550 = "0.3"
|
||||||
|
cfg-if = "1.0.0"
|
||||||
|
@ -9,11 +9,11 @@ fn main() {
|
|||||||
const TARGET_LDS: &[TargetConfig] = &[
|
const TARGET_LDS: &[TargetConfig] = &[
|
||||||
TargetConfig {
|
TargetConfig {
|
||||||
target: "riscv64",
|
target: "riscv64",
|
||||||
lds: "kernel/src/arch/riscv/linker.ld",
|
lds: "src/arch/riscv/linker.ld",
|
||||||
},
|
},
|
||||||
TargetConfig {
|
TargetConfig {
|
||||||
target: "riscv32",
|
target: "riscv32",
|
||||||
lds: "kernel/src/arch/riscv/linker.ld",
|
lds: "src/arch/riscv/linker.ld",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user