你知道project\file中包含文件的工具构建树吗? [英] Do you know tool building tree of include files in project\file?

查看:139
本文介绍了你知道project\file中包含文件的工具构建树吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

说,我想要一个工具(或脚本?)采取项目(或.h文件)和构建包含的可搜索树包括在其中(包括在包括在中,等等)。是否存在这样的东西?我应该自己写这个[当然我是:),但可能是某人已经写了或可能有一个想法如何得到它?]

Say, I'd like to have a tool (or script?) taking project (or .h file) and building searchable tree of "includes" included into it (of included into of included into and so so on). Is there exist something like this? Should I write this by myself [of course I am :), but may be somebody had it already written or may be has an idea how to get it]?

推荐答案

不完全确定这是你的后,但你可以很容易地得到包含通过从基本c文件生成后CPP处理的文件,并删除文件/例如,使用gcc

Not entirely sure this is what you're after, but you can easily get a list of includes by generating the post-CPP-processed file from the base c file, and grepping out the file/line number comments, e.g., using gcc

gcc -E main.c {usual flags} | grep '#' | cut -d' ' -f3 | sort | uniq

其中main.c是您的基本c文件。

where main.c is your base c file.

这篇关于你知道project\file中包含文件的工具构建树吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆