At least 12 people have been killed in a school in southern Germany by a gunman wearing black combat clothing.