Understanding Folders and Files Created by Eclipse

A short version of the question: What are the objects.mk , sources.mk , makefile , subdir.mk , *.o and *.d created by Eclipse?


Long version of the question:

  • In my home directory, I have a workspace directory. Whenever I create a project and call it ProjectName , a new directory (also called ProjectName ) is created by Eclipse in the workspace folder.
  • In my project I create different classes, each class is associated with 2 files (the source file ClassName.cpp and the header file ClassName.h ). These files are placed in the workspace/ProjectName/src folder.
  • Now I Build my project in Eclipse and a new folder appears in workspace/ProjectName . It is called Debug .
  • There is only one file in this folder, the functionality of which I understand: ProjectName . This is an executable file. If I type his name on the command line, my program will be executed.
  • I still do not know 3 more files: objects.mk , sources.mk , makefile .
  • In addition, there is a src directory in the Debug folder. It contains the subdir.mk file, the value of which is unknown to me, as well as the files ClassName.o and ClassName.d (if I have N classes, there will be N pairs of *.o and *.d .)

Can someone please explain the meaning and purpose of these files?

+4
source share
1 answer

objects.mk , sources.mk , makefile and subdir.mk are makefiles created by Eclipse according to your type of project (executable file, library, shared library). For their contents and how these works relate to documenting the make your toolchain. In short, they are responsible for calling the compiler and linker.

ClassName.o is an object file generated by the compiler, all of them will be associated with the executable file or stored in the library (depending on the type of project).

ClassName.d is a so-called dependency reference file that is generated by the compiler (upon request) and included in make files, which allows you to track changes in header files and, if necessary, recompile the corresponding source files.

+4
source

All Articles