def pyext_coms(platform):
    """Return PYEXTCCCOM, PYEXTCXXCOM and PYEXTLINKCOM for the given
    platform."""
    if platform == 'win32':
        pyext_cccom = (
            '$PYEXTCC /Fo$TARGET /c $PYEXTCCSHARED $PYEXTCFLAGS $PYEXTCCFLAGS $_CCCOMCOM $_PYEXTCPPINCFLAGS $SOURCES'
            )
        pyext_cxxcom = (
            '$PYEXTCXX /Fo$TARGET /c $PYEXTCSHARED $PYEXTCXXFLAGS $PYEXTCCFLAGS $_CCCOMCOM $_PYEXTCPPINCFLAGS $SOURCES'
            )
        pyext_linkcom = (
            '${TEMPFILE("$PYEXTLINK $PYEXTLINKFLAGS /OUT:$TARGET.windows $( $_LIBDIRFLAGS $) $_LIBFLAGS $_PYEXTRUNTIME $SOURCES.windows")}'
            )
    else:
        pyext_cccom = (
            '$PYEXTCC -o $TARGET -c $PYEXTCCSHARED $PYEXTCFLAGS $PYEXTCCFLAGS $_CCCOMCOM $_PYEXTCPPINCFLAGS $SOURCES'
            )
        pyext_cxxcom = (
            '$PYEXTCXX -o $TARGET -c $PYEXTCSHARED $PYEXTCXXFLAGS $PYEXTCCFLAGS $_CCCOMCOM $_PYEXTCPPINCFLAGS $SOURCES'
            )
        pyext_linkcom = (
            '$PYEXTLINK -o $TARGET $PYEXTLINKFLAGS $SOURCES $_LIBDIRFLAGS $_LIBFLAGS $_PYEXTRUNTIME'
            )
    if platform == 'darwin':
        pyext_linkcom += ' $_FRAMEWORKPATH $_FRAMEWORKS $FRAMEWORKSFLAGS'
    return pyext_cccom, pyext_cxxcom, pyext_linkcom
