PDA

View Full Version : Is it safe to delete out-of-source build files?



d_stranz
10th February 2015, 18:24
I've built Qt 5.4 from source using MSVC 2008 since binaries for that are not available to download. I did an out-of-source build into a build directory ("msvc2008_32_build"), and an install into a third directory ("msvc2008_32"). Except for two compilation errors (now fixed), everything built and installed without a hitch.

Is it now safe to "make clean" in the build directory? (Or even to simply delete it entirely?) Is there anything in the build directory that is required to compile, link, or debug?

Paranoid, maybe, but it takes hours to build and install from source, and I don't want to have to do it again.

Thanks.

wysota
10th February 2015, 21:06
I think that make clean should be ok (it only deletes intermediate files). I would be worried about distclean. From what I remember what is really problematic is the include files which used to point to the source directory (I don't know if they still do).

d_stranz
10th February 2015, 22:54
From what I remember what is really problematic is the include files which used to point to the source directory

It looks like the build / install process on Windows has been improved greatly since 5.2. Then, it was almost impossible to do an out-of-source build and install didn't work at all. It looked like the configure -prefix option either wasn't working at all or worked incorrectly. (Or I was using it incorrectly).

In 5.4, the include tree is copied from the source directory into the install directory and both build and install go cleanly. The executables (qmake, moc, etc) are also copied into the install "bin" directory.

I don't see anything in the build directory that can't be removed through make clean. Unless something breaks, I'll consider this as solved, otherwise I will report back.

The messages upon the end of the config step say to make "confclean" to reconfigure, but there is no such target in the Makefile. There is however a "distclean" target so maybe this is what it should be. I built both 32- and 64-bit versions, but since I am not using the 64-bit version yet I will run distclean on that and see what happens.

Edit: make distclean removes all compilation artifacts as well as all of the Makefiles, but leaves the directory tree intact. So it will be necessary to run configure again before the distro can be rebuilt. make clean removes compilation artifacts but leaves the Makefiles and directory tree intact.

wysota
10th February 2015, 23:04
Try simply changing the directory name of your build tree and see if the installation breaks. If not, it should be safe to remove the files completely.