Understanding the variables scope
The BitBake metadata has thousands of variables, but the scope where these variables are available depends on where it is defined. Basically, there are two kinds of variables as follows:
Variables defined in configuration files are global to every recipe. The parsing order of the main configuration files is shown as follows:
build/conf/local.conf
<layer>/conf/machines/<machine>.conf
<layer>/conf/distro/<distro>.conf
Variables defined within recipe files are local to the specific recipe only during the execution of its tasks.