This is an example how to create custom/user define components in ESP-IDF environment. Rather than creating whole application in single file along with app_main, you can take this as an example to create user-defined custom module/components and its associated Makefile.
The project hello_world contains one source file in C language hello_world_main.c. The file is located in folder main.
ESP-IDF projects are build using CMake. The project build configuration is contained in CMakeLists.txt
files that provide set of directives and instructions describing the project's source files and targets (executable, library, or both).
Below is short explanation of remaining files in the project folder.
├── CMakeLists.txt
├── example_test.py Python script used for automated example testing
├── main
│ ├── CMakeLists.txt
│ ├── component.mk Component make file
│ └── hello_world_main.c
├── Makefile Makefile used by legacy GNU Make
└── README.md This is the file you are currently reading
For more information on structure and contents of ESP-IDF projects, please refer to Section Build System of the ESP-IDF Programming Guide.