Short version of the question: What are objects.mk, sources.mk, makefile, subdir.mk, *.o and *.d files generated by Eclipse?
Long Version of the question:
- In my home directory I have the
workspacedirectory. Whenever I create a project and call itProjectNamea new directory (also calledProjectName) is created by Eclipse in theworkspacefolder. - In my project I create different classes, every class is associated with 2 files (source file
ClassName.cppand header fileClassName.h). These files are put into theworkspace/ProjectName/srcfolder. - Now I
Buildmy project in Eclipse and in theworkspace/ProjectNamea new folder appears. It is calledDebug. - In this folder there is only one file whose functionality I understand:
ProjectName. It is the executable. If I type its name in the command line, my program will be executed. - Another 3 files are unknown to me:
objects.mk,sources.mk,makefile. - Moreover, in
Debugfolder there issrcdirectory. It containssubdir.mkfile whose meaning is unknown to me as well asClassName.oandClassName.dfiles (if I have N classes there will be N pairs of the*.oand*.dfiles.)
Can anybody, please, explain the meaning and purpose of these files?
objects.mk,sources.mk,makefileandsubdir.mkare makefiles generated by Eclipse according to your project type (executable, library, shared library). For their contents and how these work refer to themakecommand documenation of your toolchain. In short these are responsible to call the compiler and linker.ClassName.ois the object file generated by the compiler, all of them will be linked together to an executable or stored in a library (depending on project type).ClassName.dis a so called dependency reference file that is generated by the compiler (on demand) and included into the makefiles, that it’s possible to track changes in header files, and recompile the concerned source files if neccessary.