Learning notes: Linux make compilation, installation, and uninstallation
Normal compilation, installation, and uninstallation:The installation of source code generally consists of three steps:Configure, make, and install). The configure file is an executable script file with many options. You can use the command./configure-help in the source code directory to output a detailed list of options. The -- prefix option indicates the installation directory. If this option is not configured, the executable files are stored in/usr/local/bin by default, and the library files are stored in/usr/local/lib by default, by default, the configuration file is stored in/usr/local/etc, and other resource files are stored in/usr/local/share, which is messy. If -- prefix is configured, for example, $. /configure -- prefix =/usr/local/test. Another advantage of using the -- prefix option is to easily uninstall or transplant the software. When a software installation is no longer needed, you only need to simply delete the installation directory, the software can be detached cleanly, and the porting software only needs to copy the entire directory to another machine (under the same operating system ). Of course, to uninstall the program, you can also use make uninstall in the original make directory, provided that the make file has specified uninstall.About detaching:If the -- prefix option is not configured and the source code package does not provide make uninstall, You Can unmount it in the following way: Find a temporary directory and reinstall it, for example:
$. /Configure -- prefix =/tmp/to_remove & make install and traverse the/tmp/to_remove file, delete the file corresponding to the installation location (because the directory structure in/tmp/to_remove is the directory structure when the -- prefix option is not configured ). Original article address: Workshop