I'm required to write documentation for my current project that lists all .c files and for each one lists every .h file which is directly or indirectly included by that file.
This is a large project, and although we have Makefiles which theoretically have this information, those Makefiles are sometimes incorrect (we inherited this project from another company). We've often had to do a
make clean ; make for our changes to actually be reflected in the recompilation, so I don't want to rely on these Makefiles.
So is there a tool which lets us give it the name of a .c file and an include path and have it tell us all of the .h files which are directly or indirectly included by the .c file? We don't have anything weird like
#define my_include "some_file.h" #include my_include
so the tool doesn't need to be perfect. Anything that searched .c and .h files in an include path for regular includes would be good enough.