[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 | |
---|
| 39 | # Checking for doxygen |
---|
| 40 | if type -t doxygen; then |
---|
| 41 | |
---|
| 42 | # Removing old documentation |
---|
| 43 | if [[ -d $PALM_BIN/../../documentation ]];then |
---|
| 44 | echo "Remove old documentation" |
---|
| 45 | rm -r $PALM_BIN/../../documentation |
---|
| 46 | fi |
---|
| 47 | # Generating HTML documentation |
---|
| 48 | echo "found doxygen. Continuing..." |
---|
| 49 | cd $PALM_BIN/../DOC |
---|
| 50 | doxygen palm2doxygen.config |
---|
| 51 | if [[ $? -ne 0 ]];then |
---|
| 52 | echo "doxygen detected an error." |
---|
| 53 | exit 1 |
---|
| 54 | fi |
---|
| 55 | cd $PALM_BIN/../../documentation |
---|
| 56 | ln -s $(pwd)/html/index.html PALM_doc.html |
---|
| 57 | echo "HTML source code documentation generated." |
---|
| 58 | |
---|
| 59 | # Checking for pdflatex |
---|
| 60 | if type -t pdflatex; then |
---|
| 61 | |
---|
| 62 | # Generating PDF documentation |
---|
| 63 | cd $PALM_BIN/../../documentation/latex |
---|
| 64 | make pdf |
---|
| 65 | cd $PALM_BIN/../../documentation |
---|
| 66 | ln -s $(pwd)/latex/refman.pdf PALM_doc.pdf |
---|
| 67 | echo "PDF source code documentation generated." |
---|
| 68 | |
---|
| 69 | else |
---|
| 70 | echo "ERROR: pdflatex not found." |
---|
| 71 | echo "Skipping PDF documentation generation. Terminating!" |
---|
| 72 | exit 1 |
---|
| 73 | fi |
---|
| 74 | else |
---|
| 75 | echo "ERROR: doxygen not found." |
---|
| 76 | echo "Skipping PALM documentation generation. Terminating!" |
---|
| 77 | exit 1 |
---|
| 78 | fi |
---|
| 79 | |
---|
| 80 | echo "PALM source code documentation generated." |
---|
| 81 | echo "You will find ." |
---|