-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
411 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,2 @@ | ||
[unstable] | ||
build-std = ["core", "alloc"] | ||
build-std-features = ["compiler-builtins-mem"] | ||
|
||
[target.x86_64-unknown-hermit-loader] | ||
rustflags = [ | ||
"-C", "link-arg=-Tsrc/arch/x86_64/link.ld" | ||
] | ||
|
||
[target.aarch64-unknown-hermit-loader] | ||
rustflags = [ | ||
"-C", "link-arg=-Tsrc/arch/aarch64/link.ld" | ||
] | ||
|
||
[build] | ||
target = "targets/x86_64-unknown-hermit-loader.json" | ||
[alias] | ||
xtask = "run --package xtask --" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
[package] | ||
name = "xtask" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
[dependencies] | ||
anyhow = "1.0" | ||
rustc_version = "0.4" | ||
xflags = "0.2" | ||
xshell = "0.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
use std::path::PathBuf; | ||
|
||
xflags::xflags! { | ||
src "./src/flags.rs" | ||
|
||
/// Run custom build command. | ||
cmd xtask { | ||
default cmd help { | ||
/// Print help information. | ||
optional -h, --help | ||
} | ||
|
||
/// Build the kernel. | ||
cmd build | ||
{ | ||
/// Build for the architecture. | ||
required --arch arch: String | ||
/// Directory for all generated artifacts. | ||
optional --target-dir target_dir: PathBuf | ||
/// Build artifacts in release mode, with optimizations. | ||
optional -r, --release | ||
/// Build artifacts with the specified profile. | ||
optional --profile profile: String | ||
} | ||
|
||
/// Run clippy for all targets. | ||
cmd clippy {} | ||
} | ||
} | ||
|
||
// generated start | ||
// The following code is generated by `xflags` macro. | ||
// Run `env UPDATE_XFLAGS=1 cargo build` to regenerate. | ||
#[derive(Debug)] | ||
pub struct Xtask { | ||
pub subcommand: XtaskCmd, | ||
} | ||
|
||
#[derive(Debug)] | ||
pub enum XtaskCmd { | ||
Help(Help), | ||
Build(Build), | ||
Clippy(Clippy), | ||
} | ||
|
||
#[derive(Debug)] | ||
pub struct Help { | ||
pub help: bool, | ||
} | ||
|
||
#[derive(Debug)] | ||
pub struct Build { | ||
pub arch: String, | ||
pub target_dir: Option<PathBuf>, | ||
pub release: bool, | ||
pub profile: Option<String>, | ||
} | ||
|
||
#[derive(Debug)] | ||
pub struct Clippy; | ||
|
||
impl Xtask { | ||
pub const HELP: &'static str = Self::HELP_; | ||
|
||
#[allow(dead_code)] | ||
pub fn from_env() -> xflags::Result<Self> { | ||
Self::from_env_() | ||
} | ||
|
||
#[allow(dead_code)] | ||
pub fn from_vec(args: Vec<std::ffi::OsString>) -> xflags::Result<Self> { | ||
Self::from_vec_(args) | ||
} | ||
} | ||
// generated end |
Oops, something went wrong.