In GNU make, there are many conventions, such as this destdir: a prefix variable used to add to the path of the file to be installed.
For example, we compile a third-party library locally, but need to package it for other people to use, on the one hand, if we install to the default directory, such as/usr, at this time, after the installation of a large number of files, the package is very difficult to find full; or we configure the--prefix, Or CMake when Cmake_install_prefix is specified, then the compilation dependencies within the PC file will go wrong and become the path we specified, which is inconvenient to use. At this point, Destdir will come in handy.
Destdir works only when make install, and it is not related to what tool the makefile is generated from, as follows:
Make install destdir=< $CUSTOM _prefix>
When you specify the path to install when configure or CMake, the files made install installed in this manner are all installed in a $custom_prefix-prefixed directory so that developers can publish and use the files in this directory directly by packaging them.