source: git/doxy

spielwiese
Last change on this file was 75f460, checked in by Hans Schoenemann <hannes@…>, 8 years ago
format
  • Property mode set to 100755
File size: 1.8 KB
Line 
1#!/usr/bin/env bash
2
3#!/bin/sh
4if [ "$#" -le 0 ]; then
5  echo "Usage: $0 input_file(s)" >&2
6  exit 1
7fi
8
9INPUT="$@"
10
11P=`pwd`
12
13# basename $0
14C="$0"
15C=`dirname "$C"`
16C=`ls -d1 "$C"`
17
18TARGET_FILE="$C"
19
20cd `dirname "$TARGET_FILE"`
21TARGET_FILE=`basename "$TARGET_FILE"`
22
23# Iterate down a (possible) chain of symlinks
24while [ -L "$TARGET_FILE" ]
25do
26    TARGET_FILE=`readlink "$TARGET_FILE"`
27    cd `dirname "$TARGET_FILE"`
28    TARGET_FILE=`basename "$TARGET_FILE"`
29done
30
31SRCDIR=`pwd -P`
32SRCDIR="$SRCDIR/$TARGET_FILE"
33# echo $SRCDIR
34
35
36if [ -z "$DOXYGEN" ]; then
37        DOXYGEN=`which doxygen`
38
39        if [ $? -ne 0 ]; then
40                echo Please add 'doxygen' to your PATH
41                exit 1
42        fi
43
44        export DOXYGEN
45fi
46
47if [ ! -x "$DOXYGEN" ]; then
48        echo Please make "$DOXYGEN" - executable!;
49        exit 1;
50fi
51
52if [ -z "$DOXYGEN_CONFIG" ]; then
53        export DOXYGEN_CONFIG="$SRCDIR/dox/Doxyfile.in1"
54fi
55
56if [ ! -r "$DOXYGEN_CONFIG" ]; then
57        echo Please make the doxygen configuration readable: "$DOXYGEN_CONFIG"!;
58        exit 1;
59fi
60
61cd "$P"
62
63INPUTTXT=`echo "$INPUT" | sed -e 's@[ :]@_@g' -e 's@[\\\/]@__@g'`
64
65OUTPUT="./DOXY.$INPUTTXT"
66# `mktemp -d -q "./DOXY.$INPUTTXT.XXX"`
67#if [ $? -ne 0 ]; then
68#    echo "$0: Can't create temp dir name, exiting..."
69#    exit 1
70#fi
71
72if [ -d "$OUTPUT" ]; then
73    echo "Directory '$OUTPUT' exists! Deleting..."
74    rm -Rf "$OUTPUT/*"
75else
76    mkdir -p "$OUTPUT/"
77fi
78
79export OUTPUT
80
81export INPUT
82
83export GENERATE_HTML=YES GENERATE_LATEX=YES GENERATE_RTF=YES GENERATE_MAN=YES GENERATE_XML=YES \
84       HTML_OUTPUT=htm  LATEX_OUTPUT=tex   RTF_OUTPUT=rtf   MAN_OUTPUT=man   XML_OUTPUT=xml
85
86export abs_top_srcdir="$SRCDIR" abs_top_builddir="$SRCDIR"
87
88echo Running "$DOXYGEN" "$DOXYGEN_CONFIG" with a bunch of exported variables
89
90$DOXYGEN $DOXYGEN_CONFIG
91
92echo Result for "$INPUT" is in "[$OUTPUT/]", under "[$P/]"...
Note: See TracBrowser for help on using the repository browser.