#!/bin/sh SRC_PATH="${1}" OUT_PATH="${2}" # Look for each dox files for DOC2GEN in ` find "${SRC_PATH}" -name \*.dox` do # Get the name of the doxygen docs set NAME=`basename ${DOC2GEN} | sed 's!.dox!!'` # Remove old directory rm -rf ${OUT_PATH}/${NAME} # Backup the dox file cp ${DOC2GEN} ${DOC2GEN}.old # Change html output path sed -i "s!^HTML_OUTPUT.*\$!HTML_OUTPUT = ${NAME}!" ${DOC2GEN} sed -i "s!^OUTPUT_DIRECTORY.*\$!OUTPUT_DIRECTORY = ${OUT_PATH}!" ${DOC2GEN} # Create output directory mkdir -p "${OUT_PATH}/${NAME}" # Print informations echo -e -n "Generating ${DOC2GEN} to ${OUT_PATH}/${NAME}\t\t" # Move into the root sources directory cd ${SRC_PATH} # Start doxygen html generation doxygen ${DOC2GEN} >/dev/null 2>&1 # Check the return code if [ $? -eq 0 ]; then echo "[OK]" else echo "Fail" fi # Restore backed-up dox file mv ${DOC2GEN}.old ${DOC2GEN} done