Only add a dependency on the target, not its project.

The former also made no sense. The target has to depend on the
project, so depending on the project was just arbitrary.