]> git.proxmox.com Git - rustc.git/blob - library/stdarch/ci/dox.sh
New upstream version 1.74.1+dfsg1
[rustc.git] / library / stdarch / ci / dox.sh
1 #!/usr/bin/env bash
2
3 # Builds documentation for all target triples that we have a registered URL for
4 # in liblibc. This scrapes the list of triples to document from `src/lib.rs`
5 # which has a bunch of `html_root_url` directives we pick up.
6
7 set -ex
8
9 rm -rf target/doc
10 mkdir -p target/doc
11
12 dox() {
13 local arch=$1
14 local target=$2
15
16 echo "documenting ${arch}"
17
18 if [ "$CI" != "" ]; then
19 rustup target add "${target}" || true
20 fi
21
22 rm -rf "target/doc/${arch}"
23 mkdir "target/doc/${arch}"
24
25 cargo build --verbose --target "${target}" --manifest-path crates/core_arch/Cargo.toml
26 cargo build --verbose --target "${target}" --manifest-path crates/std_detect/Cargo.toml
27
28 rustdoc --verbose --target "${target}" \
29 -o "target/doc/${arch}" crates/core_arch/src/lib.rs \
30 --edition=2018 \
31 --crate-name core_arch \
32 --library-path "target/${target}/debug/deps"
33 rustdoc --verbose --target "${target}" \
34 -o "target/doc/${arch}" crates/std_detect/src/lib.rs \
35 --edition=2018 \
36 --crate-name std_detect \
37 --library-path "target/${target}/debug/deps" \
38 --extern cfg_if="$(ls target/"${target}"/debug/deps/libcfg_if-*.rlib)" \
39 --extern libc="$(ls target/"${target}"/debug/deps/liblibc-*.rlib)"
40 }
41
42 dox i686 i686-unknown-linux-gnu
43 dox x86_64 x86_64-unknown-linux-gnu
44 dox arm armv7-unknown-linux-gnueabihf
45 dox aarch64 aarch64-unknown-linux-gnu
46 dox powerpc powerpc-unknown-linux-gnu
47 dox powerpc64le powerpc64le-unknown-linux-gnu
48 # MIPS targets disabled since they are dropped to tier 3.
49 # See https://github.com/rust-lang/compiler-team/issues/648
50 #dox mips mips-unknown-linux-gnu
51 #dox mips64 mips64-unknown-linux-gnuabi64
52 dox wasm32 wasm32-unknown-unknown