File: generate_documentation.sh

package info (click to toggle)
wolfssl 5.8.4-1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 117,604 kB
  • sloc: ansic: 1,584,954; asm: 481,206; sh: 11,586; cs: 6,596; xml: 3,878; perl: 3,291; makefile: 2,058; ada: 1,891; javascript: 748; python: 636; cpp: 131; ruby: 118; objc: 80; tcl: 73
file content (89 lines) | stat: -rwxr-xr-x 1,878 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/sh
# This script depends on g++, cmake, git, and make to be installed

POSIXLY_CORRECT=1

CHECK_API=false
GEN_HTML=false
GEN_PDF=false
GEN_ALL=false
INSTALL_DOX=false

# Checking arguments and setting appropriate option variables

for var in "$@"
do
    case $var in
    -install)
        INSTALL_DOX=true
        ;;
    -html)
        CHECK_API=true
        GEN_HTML=true
        ;;
    -pdf)
        CHECK_API=true
        GEN_PDF=true
        ;;
    -all)
        CHECK_API=true
        GEN_ALL=true
        ;;
    esac
done

# Checking if doxygen is already installed
# True - doxygen from "which doxygen" is used to generate documentation
# False - clones doxygen Release_1_8_13 and ./build/bin/ added to PATH

if [ $INSTALL_DOX = true ] && [ ! "$(which doxygen)" ]; then
mkdir -p build
cd build
echo "cloning doxygen 1.8.13..."
git clone --depth 1 --branch Release_1_8_13 https://github.com/doxygen/doxygen
cmake -G "Unix Makefiles" doxygen/
make
cd ..
export PATH="./build/bin/:$PATH"
fi

# Runs script to check that all API with documentation match wolfSSL API
if [ $CHECK_API = true ]; then
./check_api.sh
fi

if [ $? = 1 ]; then
echo "Not all API match"
exit 1
fi

#HTML GENERATION
if [ $GEN_HTML = true ] || [ $GEN_ALL = true ]; then
cp -r formats/html/* ./
echo "generating html..."
doxygen Doxyfile
cp html_changes/search/* html/search/
cp html_changes/*.css html/
cp html_changes/*.js html/
rm footer.html header.html
rm -rf html_changes
rm mainpage.dox
rm Doxyfile
echo "finished generating html..."
echo "To view the html files use a browser to open the index.html file located at doc/html/index.html"
fi

#PDF GENERATION
if [ $GEN_PDF = true ] || [ $GEN_ALL = true ]; then
cp -r formats/pdf/* ./
echo "generating pdf..."
doxygen Doxyfile
cd latex/
make
mv refman.pdf ../
cd ..
rm -rf latex/
rm Doxyfile
rm header.tex
echo "finished generating pdf..."
fi