[1714] | 1 | #!/bin/bash |
---|
| 2 | #--------------------------------------------------------------------------------# |
---|
| 3 | # This file is part of PALM. |
---|
| 4 | # |
---|
| 5 | # PALM is free software: you can redistribute it and/or modify it under the terms |
---|
| 6 | # of the GNU General Public License as published by the Free Software Foundation, |
---|
| 7 | # either version 3 of the License, or (at your option) any later version. |
---|
| 8 | # |
---|
| 9 | # PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
| 10 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
| 11 | # A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
| 12 | # |
---|
| 13 | # You should have received a copy of the GNU General Public License along with |
---|
| 14 | # PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
| 15 | # |
---|
| 16 | # Copyright 1997-2014 Leibniz Universitaet Hannover |
---|
| 17 | #--------------------------------------------------------------------------------# |
---|
| 18 | # |
---|
| 19 | # Current revisions: |
---|
| 20 | # ------------------ |
---|
| 21 | # Initial revision |
---|
| 22 | # |
---|
| 23 | # Former revisions: |
---|
| 24 | # ----------------- |
---|
| 25 | # $Id: $ |
---|
| 26 | # |
---|
| 27 | #--------------------------------------------------------------------------------# |
---|
| 28 | # generate_documentation - script for generating the PALM code documentation |
---|
| 29 | #--------------------------------------------------------------------------------# |
---|
| 30 | |
---|
| 31 | echo "Generating PALM source code documentation..." |
---|
| 32 | |
---|
| 33 | # Checking if the environment variable PALM_BIN is set. |
---|
| 34 | if [[ -z $PALM_BIN ]]; then |
---|
| 35 | echo "PALM_BIN is not set." |
---|
| 36 | exit 1 |
---|
| 37 | fi |
---|
| 38 | |
---|
[1715] | 39 | doc_dir=$PALM_BIN/../../documentation |
---|
| 40 | |
---|
[1714] | 41 | # Checking for doxygen |
---|
| 42 | if type -t doxygen; then |
---|
| 43 | |
---|
| 44 | # Removing old documentation |
---|
[1715] | 45 | if [[ -d $doc_dir ]];then |
---|
[1714] | 46 | echo "Remove old documentation" |
---|
[1715] | 47 | rm -r $doc_dir |
---|
[1714] | 48 | fi |
---|
| 49 | # Generating HTML documentation |
---|
| 50 | echo "found doxygen. Continuing..." |
---|
| 51 | cd $PALM_BIN/../DOC |
---|
| 52 | doxygen palm2doxygen.config |
---|
| 53 | if [[ $? -ne 0 ]];then |
---|
| 54 | echo "doxygen detected an error." |
---|
| 55 | exit 1 |
---|
| 56 | fi |
---|
[1715] | 57 | cd $doc_dir |
---|
| 58 | doc_dir=$(pwd) |
---|
[1714] | 59 | ln -s $(pwd)/html/index.html PALM_doc.html |
---|
| 60 | echo "HTML source code documentation generated." |
---|
| 61 | |
---|
| 62 | # Checking for pdflatex |
---|
| 63 | if type -t pdflatex; then |
---|
| 64 | |
---|
| 65 | # Generating PDF documentation |
---|
[1715] | 66 | cd $doc_dir/latex |
---|
[1714] | 67 | make pdf |
---|
[1715] | 68 | cd $doc_dir |
---|
[1714] | 69 | ln -s $(pwd)/latex/refman.pdf PALM_doc.pdf |
---|
| 70 | echo "PDF source code documentation generated." |
---|
| 71 | |
---|
| 72 | else |
---|
| 73 | echo "ERROR: pdflatex not found." |
---|
| 74 | echo "Skipping PDF documentation generation. Terminating!" |
---|
| 75 | exit 1 |
---|
| 76 | fi |
---|
| 77 | else |
---|
| 78 | echo "ERROR: doxygen not found." |
---|
| 79 | echo "Skipping PALM documentation generation. Terminating!" |
---|
| 80 | exit 1 |
---|
| 81 | fi |
---|
| 82 | |
---|
[1715] | 83 | echo "The PALM source code documentation is located in: $doc_dir" |
---|
| 84 | echo "Done." |
---|