用make构建后的.d文件是什么 [英] what is .d file after building with make
问题描述
有时,我会找到给定源文件的.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屋!