Making gears having teeth curved in their longitudinal direction