# loaded and called from program's icm_bootstrap scripts

precomp()
{
    echo "
Buiding tmp/spch.gch and using .ih.gch files"

    ../tmp/usr/libexec/icmake/icm-spch $1 -k xerr/xerr.ih -l spch   || exit 1
    opts=" -Wall -Werror -O2 -isystem ../tmp"
    ../tmp/usr/libexec/icmake/icm-spch -p spch tmp/ \
        'g++ -c -o $2 '${ICMAKE_CPPSTD}"${opts}"' -x c++-header $1' || exit 1
    ../tmp/usr/libexec/icmake/icm-spch -s spch tmp/                 || exit 1

    rm spch
}
