-#!/bin/sh -e
+#!/bin/bash -e
do_html_cleanup()
{
sed -e 's/id="current"/class="current"/' \
| tidy -ascii -q --wrap 0 --show-warnings no --fix-uri no \
| sed -e 's/name="\([^"]*\)"\([^>]*\) id="\1"/name="\1"\2/g' \
- | xsltproc --novalid --nonet --html --stringparam topdir $TOPDIR "$base/html-munge.xsl" -
+ | xsltproc --novalid --nonet --html --stringparam topdir "$reltopdir" \
+ "$base/html-munge.xsl" -
}
###########################################################################
exit 1
fi
-if [ "$tagfile" == "YES" -a -z "$tagfile_name" ]; then
+if [ "$tagfile" = "YES" -a -z "$tagfile_name" ]; then
echo "--tagfile-name is required with --tagfile"
exit 1
fi
srcd="${src%%/*}"
dstd="${dst%%/*}"
if [ "$srcd" = "$dstd" ]; then
- src="${src#*/}"
- dst="${dst#*/}"
+ src="${src#$srcd}"; src="${src#/}"
+ dst="${dst#$dstd}"; dst="${dst#/}"
else
break
fi
done
- echo "`echo "$src" | sed -e "s/[^\/]*/../g"`/$dst" # `"
+ rel="`echo "$src" | sed -e "s/[^\/]*/../g"`/$dst" # `"
+ echo "${rel%/}"
}
# Log executed commands
exit 1;
fi
TOPDIR="`pwd`";
+reltopdir="`relpath "$doxydir/$output_dir/$html_dir" "$TOPDIR"`" #`"
+echo "relpath $doxydir/$output_dir/$html_dir $TOPDIR -> $reltopdir"
cd "$doxydir"
## Call doxygen proper
generate_tagfile=""
-if [ "$tagfile" == "YES" ]; then
+if [ "$tagfile" = "YES" ]; then
generate_tagfile="$tagfile_name"
fi
export TOPDIR html tagfile tagfile_name tagfiles output_dir html_dir generate_tagfile
## Clean up tagfile, if generated
-if [ "$tagfile" == "YES" ]; then
+if [ "$tagfile" = "YES" ]; then
mv "$tagfile_name" "${tagfile_name}.orig"
cmd xsltproc --novalid --nonet -o "$tagfile_name" "$tagxsl" "${tagfile_name}.orig"
fi
## Postprocess html files, if generated
-if [ "$html" == "YES" ]; then
+if [ "$html" = "YES" ]; then
for h in "$doxydir/$output_dir/$html_dir"/*.html; do
cmd html_cleanup "$h"
done
# Rule to generate tagfile
# (need to exclude the 'clean' case, otherwise we'll have duplicate nodes)
if not env.GetOption('clean'):
- env.Append(ALL_TAGFILES =
- env.Doxygen(doxyfile,
- DOXYOPTS = [ '--tagfile-name', '"${MODULE}.tag"',
- '--tagfile' ],
- DOXYENV = { 'TOPDIR' : env.Dir('#').abspath,
- 'output_dir' : 'doc',
- 'html_dir' : 'html',
- 'html' : 'NO',
- 'generate_tagfile': 'doc/${MODULE}.tag' },
- MODULE = module )[0].abspath)
+ tagfile = env.Doxygen(doxyfile,
+ DOXYOPTS = [ '--tagfile-name', '"${MODULE}.tag"',
+ '--tagfile' ],
+ DOXYENV = { 'TOPDIR' : env.Dir('#').abspath,
+ 'output_dir' : 'doc',
+ 'html_dir' : 'html',
+ 'html' : 'NO',
+ 'generate_tagfile': 'doc/${MODULE}.tag' },
+ MODULE = module )
+ env.Append(ALL_TAGFILES = tagfile[0].abspath)
+ env.Depends(tagfile, env.File('#/doclib/doxygen.sh'))
# Rule to generate HTML documentation
doc = env.Doxygen(doxyfile,
'output_dir' : 'doc',
'html_dir' : 'html',
'html' : 'YES' } )
+ env.Depends(doc, env.File('#/doclib/doxygen.sh'))
# Copy the extra_sources (the images) into the documentation directory
# (need to exclude the 'clean' case otherwise there are multiple ways to clean the copies)