source: palm/trunk/SCRIPTS/generate_documentation @ 2846

Last change on this file since 2846 was 2718, checked in by maronga, 7 years ago

deleting of deprecated files; headers updated where needed

  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 2.7 KB
Line 
1#!/bin/bash
2#--------------------------------------------------------------------------------#
3# This file is part of the PALM model system.
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-2018  Leibniz Universitaet Hannover
17#--------------------------------------------------------------------------------#
18#
19# Current revisions:
20# ------------------
21#
22#
23# Former revisions:
24# -----------------
25# $Id: generate_documentation 2718 2018-01-02 08:49:38Z raasch $
26# Corrected "Former revisions" section
27# svn propset keyword
28#
29#
30#
31# 2696 2017-12-14 17:12:51Z kanani
32# Change in file header (GPL part)
33#
34# 1714 knoop
35# Initial revision
36#
37#--------------------------------------------------------------------------------#
38# generate_documentation - script for generating the PALM code documentation
39#--------------------------------------------------------------------------------#
40
41echo "Generating PALM source code documentation..."
42
43# Checking if the environment variable PALM_BIN is set.
44if [[ -z $PALM_BIN ]]; then
45   echo "PALM_BIN is not set."
46   exit 1
47fi
48
49doc_dir=$PALM_BIN/../../documentation
50
51# Checking for doxygen
52if type -t doxygen; then
53
54   # Removing old documentation
55   if [[ -d $doc_dir ]];then
56      echo "Remove old documentation"
57      rm -r $doc_dir
58   fi
59   # Generating HTML documentation
60   echo "found doxygen. Continuing..."
61   cd $PALM_BIN/../DOC
62   doxygen palm2doxygen.config
63   if [[ $? -ne 0 ]];then
64      echo "doxygen detected an error."
65      exit 1
66   fi
67   cd $doc_dir
68   doc_dir=$(pwd)
69   ln -s $(pwd)/html/index.html PALM_doc.html
70   echo "HTML source code documentation generated."
71   
72   # Checking for pdflatex
73   if type -t pdflatex; then
74   
75      # Generating PDF documentation
76      cd $doc_dir/latex
77      make pdf
78      cd $doc_dir
79      ln -s $(pwd)/latex/refman.pdf PALM_doc.pdf
80      echo "PDF source code documentation generated."
81   
82   else
83      echo "ERROR: pdflatex not found."
84      echo "Skipping PDF documentation generation. Terminating!"
85      exit 1
86   fi
87else
88   echo "ERROR: doxygen not found."
89   echo "Skipping PALM documentation generation. Terminating!"
90   exit 1
91fi
92
93echo "The PALM source code documentation is located in: $doc_dir"
94echo "Done."
Note: See TracBrowser for help on using the repository browser.