Basic process of compiling and installing software in Linux

Source: Internet
Author: User

Recent learning source code manually compiled installation, found that most of the students do not know the meaning of each step of the command execution, then collated a bit, for everyone to study together, thank you!

1. Prepare the package source file
Download the appropriate package (with. tar.gz or. tar.bz2 as suffix) from the Internet and extract the Tarball file to the/USR/LOCAL/SRC directory;
2../configure
Used to build makefile this file, usually the program developer will write a script to check your Linux system, related software properties, etc., this step is very important, because in the future, your installation information is completed in this step. In addition, this step of the relevant information should refer to the directory of the readme or install related files. It is usually possible to control the installation by adding parameters after the configure, such as./CONFIGURE–PREFIX=/USR (Specify the installation path to the/usr directory).
3. Makeclean
Make reads the work about clean in makefile. This step does not have to be, but it is generally done because it can remove the target file. Because no one is sure whether the source contains the last compiled target file (*.O) exists, so of course it is better to clear. At least wait a minute. The newly compiled execution file can be determined to be compiled with your own machine.
4. Make
Make will compile the behavior according to the default work in makefile. The main task of compiling is to do GCC to compile the source code into a target file that can be executed, but these target files usually need some links such as libraries to generate a complete executable file! Use make is to compile the source code into executable files that can be executed, and the executable file will be placed under the current directory, not installed in the intended installation directory.
5. Make install
This command for the final installation, make will be based on the makefile in this file about the Install option, the previous compilation of the completed data installed in the default directory, the installation is complete.

Please be aware that the above steps are done step in and out, and as long as one step fails, the subsequent steps are completely out of the way.

Basic process of compiling and installing software in Linux

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.