#!/bin/sh
cd "${0%/*}" || exit                                # Run from this directory
targetType=libo                                     # Preferred library type
. ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments $*

#------------------------------------------------------------------------------

if [ -f /usr/include/FlexLexer.h ] && [ ! -f FlexLexer.h ]
then
    echo "Adding FlexLexer.h link to ${PWD##*/} for cross-compilation" 1>&2

    ln -sf /usr/include/FlexLexer.h FlexLexer.h

    if [ -d lnInclude ]
    then
        (cd lnInclude && ln -sf ../FlexLexer.h .)
    fi
fi

## unset COMP_FLAGS LINK_FLAGS
# Enable psapi to obtain memory information (for example)
COMP_FLAGS="-DFOAM_USE_WINDOWS_PSAPI"
LINK_FLAGS="-lpsapi"

# Make object (non-shared by default)
# Never want/need openmp, especially for static objects
wmake -no-openmp $targetType

#------------------------------------------------------------------------------
