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?
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.
The D file extension is used for files that store code written in a special programming language called D. D is similar to the languages C++ and C#, Java and Eiffel. The file itself can be opened by any text editing program since the source code is saved in a plain text format.
A D file is a source dependency file generated by GCC, a GNU C compiler. It contains dependencies in plain text that describe the files that were used to create compiled objects (. O files) by a C compiler. D files are generated automatically when the -MMD flag is activated when compiling with GCC.
The ".o" files are likely intermediate files from which the actual executable program should have been created. The ". d" files are likely internal state used by the makefile, only important if you are making changes to the source code and then rebuilding "incrementally".
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With