def triple_split(triple):
    """Split target triple into parts.
    """
    arch, vendor, os = triple.split('-', 2)
    if '-' in os:
        os, env = os.split('-', 1)
    else:
        env = ''
    return arch, vendor, os, env