Skip to content

Commit

Permalink
fix build docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Azq2 committed Mar 21, 2024
1 parent d584a96 commit 89e8ae2
Showing 1 changed file with 24 additions and 9 deletions.
33 changes: 24 additions & 9 deletions swilib/tools/gen-docs.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,36 @@
#!/bin/bash
set -e
set -x

export PATH="/opt/doxygen/bin/:$PATH"

cd $(dirname $0)/../
[[ -d doxygen-awesome-css ]] || git submodule add https://github.com/jothepro/doxygen-awesome-css.git

PREDEFINED="SWILIB_LIBC SWILIB_LIBPNG SWILIB_ZLIB SWILIB_OPENSSL SWILIB_LEGACY_COMPAT SWILIB_MODERN __swilib_begin __swilib_end DOXYGEN"
PROJECT_NAME="SWILIB API"
[[ -d doxygen-awesome-css ]] || git clone https://github.com/jothepro/doxygen-awesome-css --depth 1

mkdir -p html/swilib/SG
mkdir -p html/swilib/SG_X75
mkdir -p html/swilib/NSG
mkdir -p html/swilib/NSG_ELKA

( cat Doxyfile ; echo "HTML_OUTPUT=html/swilib/SG"; echo "PREDEFINED=$PREDEFINED"; echo "PROJECT_NAME=$PROJECT_NAME (SG)    " ) | doxygen -
( cat Doxyfile ; echo "HTML_OUTPUT=html/swilib/SG_X75"; echo "PREDEFINED=$PREDEFINED X75"; echo "PROJECT_NAME=$PROJECT_NAME (X75)    " ) | doxygen -
( cat Doxyfile ; echo "HTML_OUTPUT=html/swilib/NSG"; echo "PREDEFINED=$PREDEFINED NEWSGOLD"; echo "PROJECT_NAME=$PROJECT_NAME (NSG)    " ) | doxygen -
( cat Doxyfile ; echo "HTML_OUTPUT=html/swilib/NSG_ELKA"; echo "PREDEFINED=$PREDEFINED NEWSGOLD"; echo "PROJECT_NAME=$PROJECT_NAME (ELKA)    " ) | doxygen -
function doxygen_run() {
name=$1
dir=$2
defines=$3

mkdir -p "html/swilib/$dir"

echo "Gen docs: $dir"

cp Doxyfile Doxyfile.tmp
echo "HTML_OUTPUT=html/swilib/$dir" >> Doxyfile.tmp
echo "PROJECT_NAME=SWILIB API $name    " >> Doxyfile.tmp
echo "PREDEFINED=SWILIB_LIBC SWILIB_LIBPNG SWILIB_ZLIB SWILIB_OPENSSL SWILIB_LEGACY_COMPAT SWILIB_MODERN __swilib_begin __swilib_end DOXYGEN $defines" >> Doxyfile.tmp
doxygen -q Doxyfile.tmp
rm Doxyfile.tmp

echo "------------------------------------------------------"
}

doxygen_run "(SG)" "SG" ""
doxygen_run "(X75)" "SG_X75" "X75"
doxygen_run "(NSG)" "NSG" "NEWSGOLD"
doxygen_run "(ELKA)" "NSG_ELKA" "NEWSGOLD ELKA"

0 comments on commit 89e8ae2

Please sign in to comment.