recursively walk the dependencies of files