Create object hierarchy from Make output?
make -d and make -p provide useful information, but I need this in JSON format, so I can enumerate what libraries came from which source files, recursively. Is there a way to do this already (approximately close, anyhow)? Or is there a custom tool available? I've scoured the Intarwebs, and my search has come up dry. Thank you for any help!
Note: I'm looking for something that's similar开发者_开发问答 to sysconfig.parse_makefile. In fact, what that does is pretty close to what I'm looking for, except that it's only useful for the implicit Makefile that is used to build Python. Any pointers?
It's not JSON, but the Perl CPAN module Makefile::GraphViz creates visualizations of the dependency graph from a makefile. If JSON is really what you want, you could probably capture the 'dot' dependency file that is generated and convert it to JSON fairly easily.
精彩评论