For a C project managed and successfully compiled using GNU autotools, eg. emacs, is there a simple way to get a list of all the included headers that were required to compile the project (the site-specific include paths that were found by the configure
script during compilation)?
My current approach has just been to
cpp -C ...
Obviously, this is a pain. I would think a project compiled using configure
would have this information somewhere. Does it?
For a C project managed and compiled using GNU autotools, eg. emacs, is there a simple way to get a list of all the included headers that were required to compile the project?
If by "were required" you mean that you want to make the determination after the project is successfully built, then yes. Unless suppressed, Automake-based makefiles have rules for generating include-dependency lists, which they use on subsequent builds to recognize the need to rebuild unchanged sources on account of changes to dependencies. You can find these files in the .deps
subdirectory.
For what it's worth, when compiling with gcc
, the gcc -MM
command is used for the purpose.