what is .d file after building with make

狂风中的少年 提交于 2020-04-07 14:25:40

问题


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

test.d, test.o

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?


回答1:


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.

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

etc.



来源:https://stackoverflow.com/questions/19114410/what-is-d-file-after-building-with-make

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!