-
Notifications
You must be signed in to change notification settings - Fork 96
/
gendox
150 lines (125 loc) · 4.25 KB
/
gendox
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#!/bin/bash
#
# Shell script to make doxygen documentation by specifying a target directory
# on the command line
#
# Gef ([email protected]) -- August 2001
# TODO:
# - Dynamic ChangeLog (page gets updated with each commit)
# - Have the ability to specify server dox or local dox, which will then
# change the content on the main page
# - Incorporate a scaled gtkradiant splash image into the pages
#------------------------------------------------------------------------
# Set some variables
#------------------------------------------------------------------------
# WORKINGDIR=`pwd`;
RETVAL=0;
TARGETSTRING='';
EXTRAS_PATH="./Doxygen_files";
CONFIG_OUTPUT="$EXTRAS_PATH/genConf";
DOXYCONFIG="./DoxyConfig";
DOXYFILE="$EXTRAS_PATH/Doxyfile";
NEWDOXYFILE="$EXTRAS_PATH/genDoxyfile";
declare -a TARGETLIST[$#];
COUNTER=0;
TARGETCOUNT=0;
QUIETMODE=0;
# added -k command line option to kill running doxygen procs
KILLON=0
#------------------------------------------------------------------------
# load the functions
#------------------------------------------------------------------------
if [ -f "$EXTRAS_PATH/gendoxfunctions" ] ; then
. $EXTRAS_PATH/gendoxfunctions
else
echo -e "Missing critical files...\n";
exit 1;
fi
#------------------------------------------------------------------------
# parse the command line options
#------------------------------------------------------------------------
COMLINE="$*";
OPTCOUNT="$#";
parse_commandline;
if [ $RETVAL -gt 0 ] ; then
echo -e "Exiting.";
exit $RETVAL;
fi
if [ $KILLON -gt 0 ] ; then
PIDOF_DOXYGEN=`pidof -x doxygen`
MYPID=$$
if [ -z "$PIDOF_DOXYGEN" ] ; then
[ $QUIETMODE -gt 0 ] || echo -e " * Killing other doxygen pids";
killall -q -9 doxygen
else
[ $QUIETMODE -gt 0 ] || echo -e " * Killing other doxygen pids";
kill -9 $PIDOF_DOXYGEN &> /dev/null
fi
[ $QUIETMODE -gt 0 ] || echo -e " * Cleaning up gendox pids";
killall -q -9 `pidof -x gendox | sed -e s/$MYPID//` &> /dev/null
fi
# If the output dir hasn't been set yet...
#if [ -z "$OUTPUTDIR" ] ; then
# OUTPUTDIR="../$(basename `pwd`)-doxygen";
#fi
#------------------------------------------------------------------------
# execute some functions to determine stuff(c)
# Get the perl path (either from the config file, or find it)
#------------------------------------------------------------------------
get_perlpath;
if [ X"$PERLPATH" == "X" ] ; then
echo -e "\nError: A working install of perl is needed to use doxygen";
exit 2;
fi
[ $QUIETMODE -gt 0 ] || echo -e " -> Set PERL_PATH to: $PERLPATH";
get_dotpath;
[ $QUIETMODE -gt 0 ] || echo -e " -> Set HAVE_DOT to: $HAVEDOT";
if [ X"$HAVEDOT" == "XYes" ] ; then
[ $QUIETMODE -gt 0 ] || echo -e " -> Set DOT_PATH to: $DOTPATH";
fi
get_language;
[ $QUIETMODE -gt 0 ] || echo -e " -> Set OUTPUT_LANGUAGE to: $OUPUTLANGUAGE";
get_projectname;
[ $QUIETMODE -gt 0 ] || echo -e " -> Set PROJECT_NAME to: $PROJECTNAME";
get_version;
[ $QUIETMODE -gt 0 ] || echo -e " -> Set PROJECT_NUMBER to: $VERSION";
#------------------------------------------------------------------------
# Got everything we need, now write the DoxyConfig file and run doxygen
#------------------------------------------------------------------------
# Clean up first
clean_up;
# Put the images & reference pages in the right place
move_stuff;
if [ $RETVAL -ge 666 ] ; then
exit 666;
fi
# Generate the config file
gen_doxyconfig;
if [ $RETVAL -gt 0 ] ; then
echo -e "Error: You are missing critical files."
exit RETVAL;
fi
# build the reference page and the index
build_extra_html;
# Generate documentation
RETVAL=0;
run_doxygen;
if [ $RETVAL -gt 0 ] ; then
echo -e "Doxygen error: returned $RETVAL";
echo -e " Check doxygen.log for details";
elif [ $RETVAL -lt 0 ] ; then
echo -e "Doxygen error: Doxygen returned $RETVAL";
fi
# if the log file is empty, remove it
if [ ! -s ./doxygen.log ] ; then
rm -f ./doxygen.log
fi
#------------------------------------------------------------------------
# Done.
#------------------------------------------------------------------------
[ $QUIETMODE -gt 0 ] || echo -e "Finished...";
[ $QUIETMODE -gt 0 ] || echo -e "Duration: $SECONDS seconds\n";
# echo -e "** Removing output while in debug mode **";
# echo -e "** Output dir: $OUTPUTDIR **\n";
# rm -rf $OUTPUTDIR
exit 0;