📄 doxygen.sh
字号:
if test ! -f "Doxyfile" ; then echo "* Cannot create Doxyfile." exit 1 fi cat "$top_builddir/Doxyfile.in" >> Doxyfile echo "INPUT = $top_srcdir" >> Doxyfile echo "OUTPUT_DIRECTORY = $top_builddir" >> Doxyfile ; \ echo "FILE_PATTERNS = *.dox" >> Doxyfile ; \ echo "RECURSIVE = NO" >> Doxyfile ; \ echo "ALPHABETICAL_INDEX = NO" >> Doxyfile ; \ echo "HTML_OUTPUT = ." >> Doxyfile ; \ apidox_htmlfiles "main" # KDevelop has a top-level Makefile.am with settings. for i in "$top_srcdir/Makefile.am.in" "$top_srcdir/Makefile.am" do if test -f "$i" ; then grep '^DOXYGEN_SET_' "$i" | \ sed -e 's+DOXYGEN_SET_++' -e "s+@topdir@+$top_srcdir+" >> Doxyfile apidox_specials "$srcdir/Makefile.am" "$subdir/Doxyfile" break fi done apidox_local doxygen Doxyfile ( cd "$top_srcdir" && grep -l '^include.*Doxyfile.am' `find . -name Makefile.am` ) | sed -e 's+/Makefile.am$++' -e 's+^\./++' | sort > subdirs.in for i in `cat subdirs.in` do test "x." = "x$i" && continue; dir=`dirname "$i"` file=`basename "$i"` if test "x." = "x$dir" ; then dir="" else dir="$dir/" fi indent=`echo "$dir" | sed -e 's+[^/]*/+\ \ +g' | sed -e 's+&+\\\&+g'` entryname=`extract_line DOXYGEN_SET_PROJECT_NAME "$top_srcdir/$dir/$file/Makefile.am"` test -z "$entryname" && entryname="$file" if grep DOXYGEN_EMPTY "$top_srcdir/$dir/$file/Makefile.am" > /dev/null 2>&1 ; then echo "<li>$indent$file</li>" else echo "<li>$indent<a href=\"@topdir@/$dir$file/html/index.html\">$entryname</a></li>" fi done > subdirs doxyndex}### Handle the Doxygen processing of a non-toplevel directory.apidox_subdir(){ echo "" echo "*** Creating apidox in $subdir" echo "*" rm -f "$subdir/Doxyfile" if test ! -d "$top_srcdir/$subdir" ; then echo "* No source (sub)directory $subdir" return fi for i in "$top_srcdir/doc/api/Doxyfile.global" \ "$top_srcdir/admin/Doxyfile.global" \ "$DOXDATA/Doxyfile.global" do if test -f "$i" ; then cp "$i" "$subdir/Doxyfile" break fi done test -f "Doxyfile.in" || create_doxyfile_in cat "Doxyfile.in" >> "$subdir/Doxyfile" echo "PROJECT_NAME = \"$subdir\"" >> "$subdir/Doxyfile" echo "INPUT = $srcdir" >> "$subdir/Doxyfile" echo "OUTPUT_DIRECTORY = ." >> "$subdir/Doxyfile" if grep -l "$subdir/" subdirs.in > /dev/null 2>&1 ; then echo "RECURSIVE = NO" >> "$subdir/Doxyfile" fi echo "HTML_OUTPUT = $subdir/html" >> "$subdir/Doxyfile" echo "GENERATE_TAGFILE = $subdir/$subdirname.tag" >> "$subdir/Doxyfile" test -d "$top_srcdir/doc/api" && \ echo "IMAGE_PATH = $top_srcdir/doc/api" >> "$subdir/Doxyfile" apidox_htmlfiles "" # Makefile.ams may contain overrides to our settings, # so copy them in. grep '^DOXYGEN_SET_' "$srcdir/Makefile.am" | \ sed -e 's+DOXYGEN_SET_++' >> "$subdir/Doxyfile" apidox_specials "$srcdir/Makefile.am" "$subdir/Doxyfile" excludes=`extract_line DOXYGEN_EXCLUDE` if test -n "$excludes"; then patterns="" dirs="" for item in `echo "$excludes"`; do if test -d "$top_srcdir/$subdir/$item"; then dirs="$dirs $top_srcdir/$subdir/$item/" else patterns="$patterns $item" fi done echo "EXCLUDE_PATTERNS += $patterns" >> "$subdir/Doxyfile" echo "EXCLUDE += $dirs" >> "$subdir/Doxyfile" fi echo "TAGFILES = \\" >> "$subdir/Doxyfile" ## For now, don't support \ continued references lines tags=`extract_line DOXYGEN_REFERENCES` for i in $tags qt ; do tagsubdir=`dirname $i` ; tag=`basename $i` tagpath="" not_found="" if test "x$tagsubdir" = "x." ; then tagsubdir="" else tagsubdir="$tagsubdir/" fi # Find location of tag file if test -f "$tagsubdir$tag/$tag.tag" ; then file="$tagsubdir$tag/$tag.tag" loc="$tagsubdir$tag/html" else # This checks for dox built with_out_ --no-modulename # in the same build dir as this dox run was started in. file=`ls -1 ../*-apidocs/"$tagsubdir$tag/$tag.tag" 2> /dev/null` if test -n "$file" ; then loc=`echo "$file" | sed -e "s/$tag.tag\$/html/"` else # If the tag file doesn't exist yet, but should # because we have the right dirs here, queue # this directory for re-processing later. if test -d "$top_srcdir/$tagsubdir$tag" ; then echo "* Need to re-process $subdir for tag $i" echo "$subdir" >> "subdirs.later" else # Re-check in $PREFIX if needed. test -n "$PREFIX" && \ file=`cd "$PREFIX" && \ ls -1 *-apidocs/"$tagsubdir$tag/$tag.tag" 2> /dev/null` # If something is found, patch it up. The location must be # relative to the installed location of the dox and the # file must be absolute. if test -n "$file" ; then loc=`echo "../$file" | sed -e "s/$tag.tag\$/html/"` file="$PREFIX/$file" echo "* Tags for $tagsubdir$tag will only work when installed." not_found="YES" fi fi fi fi if test "$tag" = "qt" ; then if test -z "$QTDOCDIR" ; then echo " $file" >> "$subdir/Doxyfile" else if test -z "$file" ; then # Really no Qt tags echo "" >> "$subdir/Doxyfile" else echo " $file=$QTDOCDIR" >> "$subdir/Doxyfile" fi fi else if test -n "$file" ; then test -z "$not_found" && echo "* Found tag $file" echo " $file=../$top_builddir$loc \\" >> "$subdir/Doxyfile" fi fi done apidox_local if grep '^DOXYGEN_EMPTY' "$srcdir/Makefile.am" > /dev/null 2>&1 ; then # This directory is empty, so don't process it, but # *do* handle subdirs that might have dox. : else # Regular processing doxygen "$subdir/Doxyfile" doxyndex fi}### Run a given subdir by setting up global variables first.do_subdir(){ subdir=`echo "$1" | sed -e 's+/$++'` srcdir="$top_srcdir/$subdir" subdirname=`basename "$subdir"` mkdir -p "$subdir" 2> /dev/null if test ! -d "$subdir" ; then echo "Can't create dox subdirectory $subdir" return fi top_builddir=`echo "/$subdir" | sed -e 's+/[^/]*+../+g'` apidox_subdir}### Create installdox-slow in the toplevelcreate_installdox(){# Fix up the installdox script so it accepts empty args## This code is copied from the installdox generated by Doxygen,# copyright by Dimitri van Heesch and released under the GPL.# This does a _slow_ update of the dox, because it loops# over the given substitutions instead of assuming all the# needed ones are given.#cat <<\EOF#! /usr/bin/env perl%subst = () ;$quiet = 0;if (open(F,"search.cfg")){ $_=<F> ; s/[ \t\n]*$//g ; $subst{"_doc"} = $_; $_=<F> ; s/[ \t\n]*$//g ; $subst{"_cgi"} = $_;}while ( @ARGV ) { $_ = shift @ARGV; if ( s/^-// ) { if ( /^l(.*)/ ) { $v = ($1 eq "") ? shift @ARGV : $1; ($v =~ /\/$/) || ($v .= "/"); $_ = $v; if ( /(.+)\@(.+)/ ) { $subst{$1} = $2; } else { print STDERR "Argument $_ is invalid for option -l\n"; &usage(); } } elsif ( /^q/ ) { $quiet = 1; } elsif ( /^\?|^h/ ) { &usage(); } else { print STDERR "Illegal option -$_\n"; &usage(); } } else { push (@files, $_ ); }}if ( ! @files ) { if (opendir(D,".")) { foreach $file ( readdir(D) ) { $match = ".html"; next if ( $file =~ /^\.\.?$/ ); ($file =~ /$match/) && (push @files, $file); ($file =~ "tree.js") && (push @files, $file); } closedir(D); }}if ( ! @files ) { print STDERR "Warning: No input files given and none found!\n";}foreach $f (@files){ if ( ! $quiet ) { print "Editing: $f...\n"; } $oldf = $f; $f .= ".bak"; unless (rename $oldf,$f) { print STDERR "Error: cannot rename file $oldf\n"; exit 1; } if (open(F,"<$f")) { unless (open(G,">$oldf")) { print STDERR "Error: opening file $oldf for writing\n"; exit 1; } if ($oldf ne "tree.js") { while (<F>) { foreach $sub (keys %subst) { s/doxygen\=\"$sub\:([^ \"\t\>\<]*)\" (href|src)=\"\1/doxygen\=\"$sub:$subst{$sub}\" \2=\"$subst{$sub}/g; print G "$_"; } } } else { while (<F>) { foreach $sub (keys %subst) { s/\"$sub\:([^ \"\t\>\<]*)\", \"\1/\"$sub:$subst{$sub}\" ,\"$subst{$sub}/g; print G "$_"; } } } } else { print STDERR "Warning file $f does not exist\n"; } unlink $f;}sub usage { print STDERR "Usage: installdox [options] [html-file [html-file ...]]\n"; print STDERR "Options:\n"; print STDERR " -l tagfile\@linkName tag file + URL or directory \n"; print STDERR " -q Quiet mode\n\n"; exit 1;}EOF}# Do only the subdirs that match the RE passed in as $1do_subdirs_re(){ RE=`echo "$1" | sed -e 's+/$++'` # Here's a queue of dirs to re-process later when # all the rest have been done already. > subdirs.later # subdirs.top lists _all_ subdirs of top in the order they # should be handled; subdirs.in lists those dirs that contain # dox. So the intersection of the two is the ordered list # of top-level subdirs that contain dox. # # subdirs.top also doesn't contain ".", so that special # case can be ignored in the loop. ( for i in `grep "^$RE" subdirs.top` do if test "x$i" = "x." ; then continue fi # Calculate intersection of this element and the # set of dox dirs. if grep "^$i\$" subdirs.in > /dev/null 2>&1 ; then echo "$i" mkdir -p "$i" 2> /dev/null # Handle the subdirs of this one for j in `grep "$i/" subdirs.in` do echo "$j" mkdir -p "$j" 2> /dev/null done fi done # Now we still need to handle whatever is left for i in `cat subdirs.in` do test -d "$i" || echo "$i" mkdir -p "$i" 2> /dev/null done ) > subdirs.sort for i in `cat subdirs.sort` do do_subdir "$i" done if test -s "subdirs.later" ; then sort subdirs.later | uniq > subdirs.sort for i in `cat subdirs.sort` do : > subdirs.later echo "*** Reprocessing $i" do_subdir "$i" test -s "subdirs.later" && echo "* Some tag files were still not found." done fi}if test "x." = "x$top_builddir" ; then apidox_toplevel create_subdirs create_installdox > installdox-slow if test "x$recurse" = "x1" ; then if test "x$module_name" = "xkdelibs" ; then if test -z "$QTDOCTAG" && test -d "$QTDOCDIR" && \ test ! -f "qt/qt.tag" ; then # Special case: create a qt tag file. echo "*** Creating a tag file for the Qt library:" mkdir qt doxytag -t qt/qt.tag "$QTDOCDIR" > /dev/null 2>&1 fi fi if test -n "$QTDOCTAG" && test -r "$QTDOCTAG" ; then echo "*** Copying tag file for the Qt library:" mkdir qt cp "$QTDOCTAG" qt/qt.tag fi do_subdirs_re "." fielse if test "x$recurse" = "x1" ; then do_subdirs_re "$subdir" else do_subdir "$subdir" fifi# At the end of a run, clean up stuff.if test "YES" = "$cleanup" ; then rm -f subdirs.in subdirs.later subdirs.sort subdirs.top Doxyfile.in rm -f `find . -name Doxyfile` rm -f qt/qt.tag rmdir qt > /dev/null 2>&1fiexit 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -