2 #===-- build-docs.sh - Tag the LLVM release candidates ---------------------===#
4 # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 # See https://llvm.org/LICENSE.txt for license information.
6 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 #===------------------------------------------------------------------------===#
10 # Build documentation for LLVM releases.
14 # * dnf install doxygen python3-sphinx texlive-epstopdf ghostscript \
16 # * pip install sphinx-markdown-tables
18 # * apt-get install doxygen sphinx-common python3-recommonmark \
19 # ninja-build graphviz texlive-font-utils
20 # * pip install sphinx-markdown-tables
21 #===------------------------------------------------------------------------===#
26 srcdir
=$
(readlink
-f $
(dirname "$(readlink -f "$0")")/..
/..
)
29 echo "Build the documentation for an LLVM release. This only needs to be "
30 echo "done for -final releases."
31 echo "usage: `basename $0`"
33 echo " -release <num> Fetch the tarball for release <num> and build the "
34 echo " documentation from that source."
35 echo " -srcdir <dir> Path to llvm source directory with CMakeLists.txt"
36 echo " (optional) default: $srcdir"
43 output
=${project}_doxygen-
$release
45 mv $builddir/$proj_dir/docs
/doxygen
/html
$output
46 tar -cJf $output.
tar.xz
$output
50 while [ $# -gt 0 ]; do
61 echo "unknown option: $1"
69 if [ -n "$release" -a -n "$custom_srcdir" ]; then
70 echo "error: Cannot specify both -srcdir and -release options"
74 if [ -n "$custom_srcdir" ]; then
75 srcdir
="$custom_srcdir"
78 # Set default source directory if one is not supplied
79 if [ -n "$release" ]; then
80 git_ref
=llvmorg-
$release
81 if [ -d llvm-project
]; then
82 echo "error llvm-project directory already exists"
87 curl
-L https
://github.com
/llvm
/llvm-project
/archive
/$git_ref.
tar.gz |
tar --strip-components=1 -xzf -
89 srcdir
="./llvm-project/llvm"
92 cmake
-G Ninja
$srcdir -B $builddir \
93 -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra;lld;libcxx;polly;flang" \
94 -DCMAKE_BUILD_TYPE=Release \
95 -DLLVM_ENABLE_DOXYGEN=ON \
96 -DLLVM_ENABLE_SPHINX=ON \
97 -DLLVM_BUILD_DOCS=ON \
98 -DLLVM_DOXYGEN_SVG=ON \
99 -DSPHINX_WARNINGS_AS_ERRORS=OFF
103 docs-clang-tools-html \
110 doxygen-clang-tools \
117 package_doxygen llvm .
118 package_doxygen clang tools
/clang
119 package_doxygen clang-tools-extra tools
/clang
/tools
/extra
120 package_doxygen flang tools
/flang
122 html_dir
=$builddir/html-export
/
124 for d
in docs
/ tools
/clang
/docs
/ tools
/lld
/docs
/ tools
/clang
/tools
/extra
/docs
/ projects
/libcxx
/docs
/ tools
/polly
/docs
/ tools
/flang
/docs
/; do
125 mkdir
-p $html_dir/$d
126 mv $builddir/$d/html
/* $html_dir/$d/