Autogenerate dependencies recursively.