Recently, I compiled gdb by using configure
and make
. To guarantee that the code was built into another directory ( build
), I executed the configure
script from the build directory. (with ../binutils/configure
)
Is this strategy (executing configure from within the wished build directory to specify the build directory) written down in some standard, a written convention or similar or does there not exist such a common practice?
It is eg documented here:
The GNU Build System distinguishes two trees: the source tree, and the build tree. These are two directories that may be the same, or different.
https://www.gnu.org/software/automake/manual/html_node/VPATH-Builds.html
Eg the make distcheck
makes use of this when doing its test build, and makes the source directory read-only so that any misconfigured build rule that creates files in the srcdir instead of builddir gets reported as an error during that check:
https://www.gnu.org/software/automake/manual/html_node/Checking-the-Distribution.html
So while autotools may not advertise this differentiation of source and build directories as strongly as Cmake does it actually has stronger support for it as Cmake is missing such a check feature.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.