generators: use `GetObjectOutputRoot` to compute target directories In a coming change to shorten directory paths, this allows one place to decide how to compute the target path root.