#!/bin/bash

###################################################
#
# This must be run from the /docs/ directory
# in the MoSync SVN trunk!

# The Doxygen-generated docs will be placed in 
# subdirectories according to DOCSLIST below
# where each DOCLIST target directory has its own Doxyfile

# The autogenerated docs can be accessed through the main page
# at ./index.html

# The following stylesheets are needed for the documentation and 
# index page to look right:
#
# -- mosyncdocsindex.css
#	Styles the index page for all documentation
#
# -- mosyncdoxygen.css
#	Styles the general feel of the generated documents. 
#	This file is included in the generated docs through the use of
#	the HTML_STYLESHEET directive in each respective Doxyfile
#
# -- mosyncdoxytabs.css
# 	Currently not in use
#	But intended to replace tabs.css in the generated docs.
#	tabs.css controls the look and feel of the tabs in the docs and
#	currently doesn't seem to be  user-customisable through Doxyfile 
#	directives
#	Once ready, to be copied into each target output directory
#	by the for-loop at the end of this script.
#
#
#######################################################

DOCSLIST="../libs/MAUtil ../libs/MAStd"

OUTPUTDIR="./"

TARGETLIST="MAUtil MAStd"

#clean
for i in $TARGETLIST; do
	rm -rf ${i}
done;

#build
for i in $DOCSLIST; do

	pushd ${i} #&> /dev/null

	echo "Generating documentation for ${i}..."
	doxygen #&> /dev/null

	popd #&> /dev/null

done;

echo -e "\n"
echo -e "Done generating documentation..\n"
echo -e "Generated docs can be found in $OUTPUTDIR\n"


#for i in $TARGETLIST; do

#	cp ./mosyncdoxytabs.css $OUTPUTDIR${i}/tabs.css

#done;

