diff --git a/ci/dox.sh b/ci/dox.sh index 5450088cc60c5e0b288f97c9ed22ecd5958abcba..a003dc389d06c6a425cd45b4035f1103d32233e9 100644 --- a/ci/dox.sh +++ b/ci/dox.sh @@ -7,29 +7,17 @@ mkdir -p target/doc cp ci/landing-page-head.html target/doc/index.html -doc() { - local _target=$1 - echo documenting $_target - rustdoc -o target/doc/$_target --target $_target src/lib.rs --cfg dox \ +TARGETS=`grep html_root_url src/lib.rs | sed 's/.*".*\/\(.*\)"/\1/'` + +for target in $TARGETS; do + echo documenting $target + + rustdoc -o target/doc/$target --target $target src/lib.rs --cfg dox \ --crate-name libc - echo "<li><a href="$_target/libc/index.html">$_target</a></li>" \ + echo "<li><a href="$target/libc/index.html">$target</a></li>" \ >> target/doc/index.html -} - -doc x86_64-unknown-linux-gnu -doc i686-unknown-linux-gnu -doc x86_64-apple-darwin -doc i686-apple-darwin -doc x86_64-pc-windows-gnu -doc x86_64-pc-windows-msvc -doc i686-pc-windows-gnu -doc i686-pc-windows-msvc - -doc arm-unknown-linux-gnueabihf -doc mips-unknown-linux-gnu -doc arm-linux-androideabi -doc x86_64-unknown-linux-musl +done cat ci/landing-page-footer.html >> target/doc/index.html diff --git a/src/lib.rs b/src/lib.rs index cf2ba526bd4b8dbca30c8e638032b60f4ede02f4..4ae6ac5a764cab6ef3cff4d639fe9fb1e1f6a97f 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,8 +14,42 @@ #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", html_favicon_url = "https://doc.rust-lang.org/favicon.ico")] -#![cfg_attr(all(target_os = "linux", target_arch = "x86_64"), - doc(html_root_url = "http://alexcrichton.com/libc/x86_64-unknown-linux-gnu"))] +#![cfg_attr(all(target_os = "linux", target_arch = "x86_64"), doc( + html_root_url = "http://alexcrichton.com/libc/x86_64-unknown-linux-gnu" +))] +#![cfg_attr(all(target_os = "linux", target_arch = "x86"), doc( + html_root_url = "http://alexcrichton.com/libc/i686-unknown-linux-gnu" +))] +#![cfg_attr(all(target_os = "linux", target_arch = "arm"), doc( + html_root_url = "http://alexcrichton.com/libc/arm-unknown-linux-gnueabihf" +))] +#![cfg_attr(all(target_os = "linux", target_arch = "mips"), doc( + html_root_url = "http://alexcrichton.com/libc/mips-unknown-linux-gnu" +))] +#![cfg_attr(all(target_os = "linux", target_env = "musl"), doc( + html_root_url = "http://alexcrichton.com/libc/x86_64-unknown-linux-musl" +))] +#![cfg_attr(all(target_os = "macos", target_arch = "x86_64"), doc( + html_root_url = "http://alexcrichton.com/libc/x86_64-apple-darwin" +))] +#![cfg_attr(all(target_os = "macos", target_arch = "x86"), doc( + html_root_url = "http://alexcrichton.com/libc/i686-apple-darwin" +))] +#![cfg_attr(all(windows, target_arch = "x86_64", target_env = "gnu"), doc( + html_root_url = "http://alexcrichton.com/libc/x86_64-pc-windows-gnu" +))] +#![cfg_attr(all(windows, target_arch = "i686", target_env = "gnu"), doc( + html_root_url = "http://alexcrichton.com/libc/i686-pc-windows-gnu" +))] +#![cfg_attr(all(windows, target_arch = "x86_64", target_env = "msvc"), doc( + html_root_url = "http://alexcrichton.com/libc/x86_64-pc-windows-msvc" +))] +#![cfg_attr(all(windows, target_arch = "i686", target_env = "msvc"), doc( + html_root_url = "http://alexcrichton.com/libc/i686-pc-windows-msvc" +))] +#![cfg_attr(all(target_os = "android"), doc( + html_root_url = "http://alexcrichton.com/libc/arm-linux-androideabi" +))] #[macro_use] mod macros; mod dox;