I have a gigantic project that is built using makefiles. Running make at the root of the project takes over 20 minutes when no files have changed (i.e. just traversing the project and checking for updated files).
I'd like to create a dependency map that will tell me which directories I need to run 'make' in based on the file(s) changed. I already have a list of updated files that I can get from my version control system, and I'd like to skip the 20 minutes of traversing and get straight to the locations that do need to be recompiled.
The project has a mix of several languages and custom tools, so this would ideally be language-independent (i.e. it would only process all makefiles to generate dependencies). I'll settle for a C/C++-specific solution, too, as the majority of the project is in C++. The project is built on Linux.
[Edit - clarifications, responses to comments]
The project truly is gigantic, it's taking 20 minutes simply because of the size and because of all things described in the link below ("recursive makes consider harmful"). Unfortunately, the project is put together from many pieces coming from many different places, and there's little flexibility in what I can do with low-level Makefiles... the top-level ones putting the pieces together are the ones I have control over.