I have seen the following install command used in multiple yocto recipes install -d ${D}${libdir}I am aware of the install command and its purpose, however I am unable to understand the purpose of ${D} variable as it is often nowhere defined in the recipe. Can somebody explain the purpose of this shell variable?
${D} variable in install command
compiling;yocto
The ${D} variable allows the software being built to be installed in a directory other than its real target. For example, you might configure the software so that libdir is /usr/lib, but that's for the target device; when you run the installation on your build system, you don't want the newly-built files to actually be installed in /usr/lib, you want the placed somewhere isolated so that they can be readily identified and copied across to the target system. So you create a temporary directory and install there:mkdir /tmp/yocto-targetmake install D=/tmp/yocto-targetThat way the files end up in /tmp/yocto-target/usr/lib and so on. You can then archive all of /tmp/yocto-target using whatever tool you prefer, dropping the /tmp/yocto-target prefix, copy the archive to the target device and install its contents there.In other build systems, the DESTDIR variable is used for the same reason.