编译时有什么文件实际上包含 [英] What files are actually included when compiling

查看:106
本文介绍了编译时有什么文件实际上包含的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常大的code,其中很多是传统的code。
我想知道,所有这些文件都在编译参加。
在code写的GNU编译器和大多在C / C ++,但一些在其他程序中了。
任何意见将是非常美联社preciated。

I have a very large code, a lot of which is legacy code. I want to know which of all these files are taking part in the compilation. The code is written in GNU compilers and mostly in C/C++, but some in other programs too. Any advice will be highly appreciated.

谢谢,

卡察夫。

我在linux下编译使用脚本/ Makefile文件的混合。我想以某种方式包装这个构建了一个工具,这将给在构建,$ P $使用pferably使用绝对路径名的所有源文件的输出。

I am compiling under linux with a mix of scripts/makefiles. I want to somehow 'wrap' this build with a tool which will give an output of all the source files used in the build, preferably with absolute path names.

你说什么?

推荐答案

两个选项浮现在脑海中。

Two options come to mind.


  1. 解析编译日志

  1. Parse the compilation log

运行构建,保存日志,然后在日志中搜索。

Run a build, save the log, and then search in the log.

查找那些在编译时打开的文件。

Find the files that are opened during the compilation time.

要做到这一点可能是使用一个系统跟踪工具如 strace的或库跟踪的一种方式如 ltrace 工具,然后看出来的文件打开调用。

A way to do that might be to use a system tracing tool like strace or library tracing tool like ltrace and then look out for file open calls.

又见<一个href=\"http://stackoverflow.com/questions/880263/how-can-i-detect-file-accesses-in-linux\">http://stackoverflow.com/questions/880263/how-can-i-detect-file-accesses-in-linux

这篇关于编译时有什么文件实际上包含的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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