remove unneeded sources from targets