def preprocess(text):
    """
    Removes comments ('#') and handles continue line characters for makefile 
    text
    """
    lines = []
    previousLine = ''
    for line in text:
        
        # Join previous line (blank if there was no continue line)
        line = previousLine + line
        # ignore comments
        line = line.split('#')[0]
        # strip
        line = line.strip()
        if len(line) > 0:
            if line[-1] == '\\':
                previousLine = line[0:-1]
            else:
                previousLine = ''
                lines.append(line)
        else:
            previousLine = ''
    
    return lines