Remove duplicate files and link sources.