Add --dep-info flag to write Makefile compatible dependency files

This isn't super useful for libraries yet without #10593.

Fixes #7633.