66
77set -ex
88
9- rm -rf target/doc
10- mkdir -p target/doc
11-
129dox () {
13- local arch=$1
14- local target=$2
15-
16- echo " documenting ${arch} "
17-
1810 if [ " $CI " != " " ]; then
19- rustup target add " ${target } " || true
11+ rustup target add " ${1 } " || true
2012 fi
2113
22- rm -rf " target/doc/${arch} "
23- mkdir " target/doc/${arch} "
14+ cargo clean --target " ${1} "
2415
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
16+ cargo build --verbose --target " ${1 } " --manifest-path crates/core_arch/Cargo.toml
17+ cargo build --verbose --target " ${1 } " --manifest-path crates/std_detect/Cargo.toml
2718
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) "
19+ cargo doc --verbose --target " ${1} " --manifest-path crates/core_arch/Cargo.toml
20+ cargo doc --verbose --target " ${1} " --manifest-path crates/std_detect/Cargo.toml
4021}
4122
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
23+ if [ -z " $1 " ]; then
24+ dox i686-unknown-linux-gnu
25+ dox x86_64-unknown-linux-gnu
26+ dox armv7-unknown-linux-gnueabihf
27+ dox aarch64-unknown-linux-gnu
28+ dox powerpc-unknown-linux-gnu
29+ dox powerpc64le-unknown-linux-gnu
30+ dox loongarch64-unknown-linux-gnu
31+ # MIPS targets disabled since they are dropped to tier 3.
32+ # See https://github.com/rust-lang/compiler-team/issues/648
33+ # dox mips-unknown-linux-gnu
34+ # dox mips64-unknown-linux-gnuabi64
35+ dox wasm32-unknown-unknown
36+ dox nvptx64-nvidia-cuda
37+ else
38+ dox " ${1} "
39+ fi
0 commit comments