用make构建后的.d文件是什么 [英] what is .d file after building with make

查看:407
本文介绍了用make构建后的.d文件是什么的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有时,我会找到给定源文件的.d文件. 例如,如果我编译test.c,我已经

Sometimes, I find .d files for a given source file. For instance, if I compile test.c, I've got

test.d, test.o

我知道test.o是目标文件,但不知道test.d的用途是什么. 您能提供任何提示或指示吗?

I understand that test.o is the object file but have no idea what is test.d for. Could you give any hints or pointers?

推荐答案

许多构建系统将自动检测到的make依赖项添加到.d文件中.特别是,对于C/C ++源文件,它们确定需要什么#include文件,并自动将该信息生成到.d文件中.

Many build systems add automatically detected make dependencies into the .d file. In particular, for C/C++ source files they determine what #include files are required and automatically generate that information into the .d file.

.d文件随后包含在makefile中,因此make知道该信息.如果您查看这些文件的内容,它们将成为先决条件语句,例如:

The .d files are then included by the makefile so make is aware of that information. If you look at the contents of those files they'll be make prerequisite statements, like:

foo.o : foo.h bar.h biz.h

这篇关于用make构建后的.d文件是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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