source: palm/trunk/SCRIPTS/generate_documentation @ 1723

Last change on this file since 1723 was 1715, checked in by knoop, 8 years ago

Bugfix for the source code documentation generation script

  • Property svn:executable set to *
File size: 2.5 KB
Line 
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
31echo "Generating PALM source code documentation..."
32
33# Checking if the environment variable PALM_BIN is set.
34if [[ -z $PALM_BIN ]]; then
35   echo "PALM_BIN is not set."
36   exit 1
37fi
38
39doc_dir=$PALM_BIN/../../documentation
40
41# Checking for doxygen
42if type -t doxygen; then
43
44   # Removing old documentation
45   if [[ -d $doc_dir ]];then
46      echo "Remove old documentation"
47      rm -r $doc_dir
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
57   cd $doc_dir
58   doc_dir=$(pwd)
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
66      cd $doc_dir/latex
67      make pdf
68      cd $doc_dir
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
77else
78   echo "ERROR: doxygen not found."
79   echo "Skipping PALM documentation generation. Terminating!"
80   exit 1
81fi
82
83echo "The PALM source code documentation is located in: $doc_dir"
84echo "Done."
Note: See TracBrowser for help on using the repository browser.