Generates a list of files in dependency order