The learning curve for Yocto is different from another building system, so I understand your confusion, but trust me, it's worth it. Your questions are related to BitBake, so I recommend the BitBake User Guide . Just make sure you read the same version as your poky version.
require is similar to include and can be compared with #include with C and C ++ just like you wrote. Although, in general, both of them should be used to add some extensions to the recipe (* .bb), which are common to some recipes (just - you can reuse it). For example: path definitions, custom tasks used by pairs of recipes. The overall goal is to make the recipe cleaner and separate some constants for reuse.
Very important thing -> difference between include and require (from the BitBake manual):
The include directive does not generate an error when a file cannot be found. Therefore, it is recommended that if it is expected that the file you include will exist, you should use require instead of include. In doing so, make sure that an error occurs if the file is not found.
The result: when you include the file in * .bb, and it was not found, BitBake will not cause an error while parsing this recipe. If you use require , an error will be raised. You must use the requirement when the specified file must exist, since it contains important variables / tasks that are necessary for processing.
In the case of *.bbappend - it is very powerful. A typical case is that you add some custom changes to the recipe from another level using *.bbappend , because (for example): you are not the custodian of the original recipe or modifications are used only in your project (then it should be located in your meta layer). But you can also bbappend recipe on the same layer. BitBake parses all the layers and then โcreatesโ the output and executes it. Read more in the Run from BitBake User chapter .
The inherit mechanism can be used to inherit *.bbclass , where common tasks are defined for a specific purpose, so you do not need to write them yourself, for example: you use inhert cmake or inherit autotools for your recipe when it needs to provide output for sources that are built respectively CMake (and you have CMakeLists.txt installed) or autotools (Makefile.am, etc.). The class definitions provided by OpenEmbedded are under / meta / classes / if you are using the Yocto release with poky. You can check them, and you will see that, for example, autotools.bbclass defined (among others) the task: autotools_do_configure() , so you do not need to write it from scratch. However, you can override it in your recipe (simply by providing your own definition of this function). If the recipe cannot be changed, you can simply create a *.bbappend file and write your own do_configure() function, which will override the function from *.bbclass . Just like in OO languages โโlike C ++ or Java.