@echo off
REM $Id: make.bat,v 1.1.1.1 2006/12/12 09:40:08 frm Exp $

set DOCBOOK=manual.docbook

REM this assumes that the docbook XSL and DTD files are
REM in a docbook subfolder!
set BASEDIR=docbook

set XSLDIR=%BASEDIR%\xhtml
set HTMLDIR=%BASEDIR%\html
set DTDDIR=%BASEDIR%\dtd
set ENTDIR=%DTDDIR%\ent

REM validate docbook
echo === VALIDATING
xmllint --path %DTDDIR% --nonet --xinclude --noent --noout %DOCBOOK%
if errorlevel 1 goto error

REM generate HTML
echo === GENERATING HTML
if not exist user mkdir user
xsltproc --path %ENTDIR% --path %DTDDIR% --path %XSLDIR% --nonet --xinclude -o user/ html.xsl %DOCBOOK%
if errorlevel 1 goto error

REM generate the API docs using Doxygen
echo === GENERATING API DOCS
doxygen >nul
REM if errorlevel 1 goto error  -- ignore doxygen retcode as it seems
REM to be always != 0



:error
echo.
echo --------------------------------------------------------
echo Error while running one of xmllint, xsltproc, doxygen
echo utility. Check your sources.
echo.
echo Please install xmllint, xsltproc and doxygen utilities 
echo and add them to your PATH if you still get this error. 
echo Aborting.
echo --------------------------------------------------------
echo.
