def _is_valid_make_var(varname):
    """Check if the make variable name seems valid."""
    if len(varname) == 0:
        return False

    # According to gnu make, any chars not whitespace, ':', '#', '=' are valid.
    invalid_chars = ":#= \t\n\r"
    for n in range(0, len(invalid_chars)):
        if invalid_chars[n] in varname:
            return False
    return True