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