Expose depend_files: from the custom_target this creates.
This is the change suggested in #2815, with tests and documentation added.
Fixes#2789 (duplicate #2830)
This allows us to more easily have the documentation in sync with
the source code as people will have to document new features etc
right at the time where they implement it.