Browse Source

Move crt0 and platform into src folder
Add cargo fmt script

Jeremy Soller 7 years ago
parent
commit
543526cb85

+ 2 - 2
Cargo.toml

@@ -8,11 +8,11 @@ name = "c"
 crate-type = ["staticlib"]
 
 [workspace]
-members = ["crt0"]
+members = ["src/crt0"]
 
 [dependencies]
 compiler_builtins = { git = "https://github.com/rust-lang-nursery/compiler-builtins.git", default-features = false, features = ["mem"] }
-platform = { path = "platform" }
+platform = { path = "src/platform" }
 ctype = { path = "src/ctype" }
 fcntl = { path = "src/fcntl" }
 grp = { path = "src/grp" }

+ 8 - 0
fmt.sh

@@ -0,0 +1,8 @@
+ARGS=()
+
+for crate in relibc $(find src -name Cargo.toml | cut -d '/' -f2 | grep -v template)
+do
+    ARGS+=("--package" "$crate")
+done
+
+cargo fmt "${ARGS[@]}" "$@"

+ 0 - 0
crt0/Cargo.toml → src/crt0/Cargo.toml


+ 0 - 0
crt0/src/lib.rs → src/crt0/src/lib.rs


+ 1 - 1
src/ctype/Cargo.toml

@@ -8,4 +8,4 @@ build = "build.rs"
 cbindgen = { path = "../../cbindgen" }
 
 [dependencies]
-platform = { path = "../../platform" }
+platform = { path = "../platform" }

+ 1 - 1
src/fcntl/Cargo.toml

@@ -8,4 +8,4 @@ build = "build.rs"
 cbindgen = { path = "../../cbindgen" }
 
 [dependencies]
-platform = { path = "../../platform" }
+platform = { path = "../platform" }

+ 1 - 1
src/grp/Cargo.toml

@@ -8,4 +8,4 @@ build = "build.rs"
 cbindgen = { path = "../../cbindgen" }
 
 [dependencies]
-platform = { path = "../../platform" }
+platform = { path = "../platform" }

+ 1 - 1
src/mman/Cargo.toml

@@ -8,4 +8,4 @@ build = "build.rs"
 cbindgen = { path = "../../cbindgen" }
 
 [dependencies]
-platform = { path = "../../platform" }
+platform = { path = "../platform" }

+ 0 - 0
platform/Cargo.toml → src/platform/Cargo.toml


+ 0 - 0
platform/src/lib.rs → src/platform/src/lib.rs


+ 0 - 0
platform/src/linux/mod.rs → src/platform/src/linux/mod.rs


+ 0 - 0
platform/src/rawfile.rs → src/platform/src/rawfile.rs


+ 0 - 0
platform/src/redox/mod.rs → src/platform/src/redox/mod.rs


+ 0 - 0
platform/src/types.rs → src/platform/src/types.rs


+ 1 - 1
src/semaphore/Cargo.toml

@@ -8,4 +8,4 @@ build = "build.rs"
 cbindgen = { path = "../../cbindgen" }
 
 [dependencies]
-platform = { path = "../../platform" }
+platform = { path = "../platform" }

+ 1 - 1
src/stdio/Cargo.toml

@@ -8,5 +8,5 @@ build = "build.rs"
 cbindgen = { path = "../../cbindgen" }
 
 [dependencies]
-platform = { path = "../../platform" }
+platform = { path = "../platform" }
 va_list = { path = "../../va_list", features = ["no_std"] }

+ 1 - 1
src/stdlib/Cargo.toml

@@ -8,5 +8,5 @@ build = "build.rs"
 cbindgen = { path = "../../cbindgen" }
 
 [dependencies]
-platform = { path = "../../platform" }
+platform = { path = "../platform" }
 ralloc = { path = "../../ralloc", default-features = false }

+ 1 - 1
src/string/Cargo.toml

@@ -8,4 +8,4 @@ build = "build.rs"
 cbindgen = { path = "../../cbindgen" }
 
 [dependencies]
-platform = { path = "../../platform" }
+platform = { path = "../platform" }

+ 1 - 1
src/template/Cargo.toml

@@ -8,4 +8,4 @@ build = "build.rs"
 cbindgen = { path = "../../cbindgen" }
 
 [dependencies]
-platform = { path = "../../platform" }
+platform = { path = "../platform" }

+ 1 - 1
src/unistd/Cargo.toml

@@ -8,4 +8,4 @@ build = "build.rs"
 cbindgen = { path = "../../cbindgen" }
 
 [dependencies]
-platform = { path = "../../platform" }
+platform = { path = "../platform" }

+ 1 - 1
test.sh

@@ -1,7 +1,7 @@
 set -ex
 
 cargo build
-cargo build --manifest-path crt0/Cargo.toml
+cargo build --manifest-path src/crt0/Cargo.toml
 
 cd openlibm
 make