mirror of
https://github.com/panpaul/tiny_os
synced 2024-09-20 09:45:19 +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
|
||||
steps:
|
||||
- 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:
|
||||
toolchain: nightly
|
||||
targets: riscv64imac-unknown-none-elf
|
||||
components: clippy
|
||||
- uses: ConorMacBride/install-package@v1
|
||||
with:
|
||||
apt: qemu-system
|
||||
- name: Clippy
|
||||
run: cargo clippy
|
||||
- name: Build
|
||||
run: cargo build --verbose
|
||||
- name: Test
|
||||
run: cargo test
|
||||
|
||||
- name: Install cargo-make
|
||||
run: cargo install cargo-make
|
||||
|
||||
- name: Run CI Flow
|
||||
run: cargo make ci-flow
|
||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
||||
/.idea
|
||||
/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"?>
|
||||
<module type="CPP_MODULE" version="4">
|
||||
<module type="EMPTY_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/kernel/src" isTestSource="false" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/target" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/kernel/target" />
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
|
@ -2,6 +2,5 @@
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</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"
|
||||
checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf"
|
||||
|
||||
[[package]]
|
||||
name = "cfg-if"
|
||||
version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
|
||||
[[package]]
|
||||
name = "critical-section"
|
||||
version = "1.1.2"
|
||||
@ -42,14 +48,15 @@ checksum = "361a90feb7004eca4019fb28352a9465666b24f840f5c3cddf0ff13920590b89"
|
||||
name = "kernel"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"bitflags 2.4.2",
|
||||
"lazy_static",
|
||||
"log",
|
||||
"riscv",
|
||||
"sbi-rt",
|
||||
"spin 0.9.8",
|
||||
"static_assertions",
|
||||
"uart_16550",
|
||||
"bitflags 2.4.2",
|
||||
"cfg-if",
|
||||
"lazy_static",
|
||||
"log",
|
||||
"riscv",
|
||||
"sbi-rt",
|
||||
"spin 0.9.8",
|
||||
"static_assertions",
|
||||
"uart_16550",
|
||||
]
|
||||
|
||||
[[package]]
|
@ -13,7 +13,6 @@ arch_riscv32 = []
|
||||
|
||||
board_default = []
|
||||
board_virt = []
|
||||
board_thead = []
|
||||
|
||||
log_color = []
|
||||
|
||||
@ -25,9 +24,10 @@ panic = "abort"
|
||||
|
||||
[profile.release]
|
||||
panic = "abort"
|
||||
lto = "thin"
|
||||
|
||||
[dependencies]
|
||||
bitflags = "2.4.1"
|
||||
bitflags = "2.4.2"
|
||||
lazy_static = { version = "1.4.0", features = ["spin_no_std"] }
|
||||
log = "0.4"
|
||||
riscv = { version = "0.11.1", features = ["s-mode"] }
|
||||
@ -35,3 +35,4 @@ sbi-rt = { version = "0.0.3", features = ["legacy"] }
|
||||
spin = "0.9.8"
|
||||
static_assertions = "1.1.0"
|
||||
uart_16550 = "0.3"
|
||||
cfg-if = "1.0.0"
|
||||
|
@ -9,11 +9,11 @@ fn main() {
|
||||
const TARGET_LDS: &[TargetConfig] = &[
|
||||
TargetConfig {
|
||||
target: "riscv64",
|
||||
lds: "kernel/src/arch/riscv/linker.ld",
|
||||
lds: "src/arch/riscv/linker.ld",
|
||||
},
|
||||
TargetConfig {
|
||||
target: "riscv32",
|
||||
lds: "kernel/src/arch/riscv/linker.ld",
|
||||
lds: "src/arch/riscv/linker.ld",
|
||||
},
|
||||
];
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user