2018-11-10 15:45:16 +01:00
|
|
|
#!/usr/bin/env bash
|
2017-09-25 13:13:01 -07:00
|
|
|
|
|
|
|
|
# Builds documentation for all target triples that we have a registered URL for
|
|
|
|
|
# in liblibc. This scrapes the list of triples to document from `src/lib.rs`
|
|
|
|
|
# which has a bunch of `html_root_url` directives we pick up.
|
|
|
|
|
|
2019-01-22 17:49:02 +01:00
|
|
|
set -ex
|
2017-09-25 13:13:01 -07:00
|
|
|
|
|
|
|
|
rm -rf target/doc
|
|
|
|
|
mkdir -p target/doc
|
|
|
|
|
|
|
|
|
|
dox() {
|
|
|
|
|
local arch=$1
|
|
|
|
|
local target=$2
|
|
|
|
|
|
2018-11-10 15:45:16 +01:00
|
|
|
echo "documenting ${arch}"
|
2017-09-25 13:13:01 -07:00
|
|
|
|
2017-09-25 13:15:32 -07:00
|
|
|
if [ "$CI" != "" ]; then
|
2018-11-10 15:45:16 +01:00
|
|
|
rustup target add "${target}" || true
|
2017-09-25 13:15:32 -07:00
|
|
|
fi
|
|
|
|
|
|
2018-11-10 15:45:16 +01:00
|
|
|
rm -rf "target/doc/${arch}"
|
|
|
|
|
mkdir "target/doc/${arch}"
|
2017-09-25 13:13:01 -07:00
|
|
|
|
2019-02-11 22:49:54 +01:00
|
|
|
export RUSTFLAGS="--cfg core_arch_docs"
|
|
|
|
|
export RUSTDOCFLAGS="--cfg core_arch_docs"
|
|
|
|
|
|
2019-01-21 16:59:10 +01:00
|
|
|
cargo build --verbose --target "${target}" --manifest-path crates/core_arch/Cargo.toml
|
|
|
|
|
cargo build --verbose --target "${target}" --manifest-path crates/std_detect/Cargo.toml
|
2017-11-20 18:20:32 +01:00
|
|
|
|
2018-11-10 15:45:16 +01:00
|
|
|
rustdoc --verbose --target "${target}" \
|
2019-01-21 16:59:10 +01:00
|
|
|
-o "target/doc/${arch}" crates/core_arch/src/lib.rs \
|
2019-10-10 20:15:50 +09:00
|
|
|
--edition=2018 \
|
2019-01-21 16:59:10 +01:00
|
|
|
--crate-name core_arch \
|
2019-02-11 22:49:54 +01:00
|
|
|
--library-path "target/${target}/debug/deps" \
|
|
|
|
|
--cfg core_arch_docs
|
2018-11-10 15:45:16 +01:00
|
|
|
rustdoc --verbose --target "${target}" \
|
2019-01-21 16:59:10 +01:00
|
|
|
-o "target/doc/${arch}" crates/std_detect/src/lib.rs \
|
2019-10-10 20:15:50 +09:00
|
|
|
--edition=2018 \
|
2019-01-21 16:59:10 +01:00
|
|
|
--crate-name std_detect \
|
2018-11-10 15:45:16 +01:00
|
|
|
--library-path "target/${target}/debug/deps" \
|
|
|
|
|
--extern cfg_if="$(ls target/"${target}"/debug/deps/libcfg_if-*.rlib)" \
|
2019-02-11 22:49:54 +01:00
|
|
|
--extern libc="$(ls target/"${target}"/debug/deps/liblibc-*.rlib)" \
|
|
|
|
|
--cfg core_arch_docs
|
2017-09-25 13:13:01 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
dox i686 i686-unknown-linux-gnu
|
|
|
|
|
dox x86_64 x86_64-unknown-linux-gnu
|
|
|
|
|
dox arm armv7-unknown-linux-gnueabihf
|
2017-09-25 13:38:12 -07:00
|
|
|
dox aarch64 aarch64-unknown-linux-gnu
|
2019-01-22 17:49:02 +01:00
|
|
|
dox powerpc powerpc-unknown-linux-gnu
|
2018-07-10 23:38:52 +02:00
|
|
|
dox powerpc64le powerpc64le-unknown-linux-gnu
|
2018-03-10 19:22:54 +01:00
|
|
|
dox mips mips-unknown-linux-gnu
|
|
|
|
|
dox mips64 mips64-unknown-linux-gnuabi64
|
2018-08-15 18:20:33 +02:00
|
|
|
dox wasm32 wasm32-unknown-unknown
|