./Configure, make, make install

Source: Internet
Author: User
Tags gz file automake

These are typical installation steps for programs generated using GNU Autoconf and automake.

./Configure is used to detect the target features of your installation platform. For example, it will check whether you have cc or GCC. It does not need cc or GCC. It is a shell script.
Make is used for compilation. It reads commands from makefile and then compiles the commands.
Make install is used for installation. It also reads commands from makefile and installs them to the specified location.

Automake and Autoconf are very useful for publishing C Programs.

-----
1. Configure. This step is generally used to generate makefile to prepare for the next compilation. You can add parameters after configure to control the installation, such as the Code :. /configure-Prefix =/usr indicates to install the software under/usr, And the execution file will be installed in/usr/bin (instead of the default/usr/local/bin ), the resource file will be installed in/usr/share (instead of the default/usr/local/share ). You can specify the-sys-Config = parameter to set some software configuration files. Some software can also be added with-with,-enable,-without,-Disable and other parameters to control the compilation. You can view detailed instructions for help by allowing./configure-help.

2. Make. This step is to compile. Most source code packages are compiled through this step (of course, some software written in Perl or Python needs to call Perl or Python for compilation ). If an error occurs during the make process, you need to write down the error code (note that it is not just the last line), and then you can submit the bugreport to the developer (generally there is a submission address in install ), or your system has less dependent libraries, and you need to carefully study the error code.

3. Make insatll. This command is used for installation (of course, some software must first run make check or make test for some tests ), this step usually requires you to have the root permission (because you need to write files to the system ).

-----
Linux users may know that when installing an application in Linux, they generally run the configure script first, then use make to compile the source program, and run make install, finally, run make clean to delete some temporary files. You can use the preceding three automatic tools to generate the configure script. Run the configure script to generate the MAKEFILE file, and then run make, make install, and make clean.

Configure is a shell script that can automatically set the source program to meet the characteristics of UNIX systems on different platforms, in addition, appropriate makefile files or C header files are generated based on the system parameters and environment, so that the source program can be easily compiled and connected on these different platforms.

In this case, you can run the configure script and run the configure script to generate a MAKEFILE file that complies with the GNU specification:
$./Configure

At this time, you can run make to compile the file, run make install to install the file, and run make clean to delete the temporary file.
$ Make
$ Make install (Note: You must have sufficient permissions to run this command)
$ Make clean

The makefile generated by configure has several preset targets for use. Several important descriptions are as follows:

Make all: generate the set goal, that is, the executable file in this example. You can compile the source code and link it to generate an executable file.

Make clean: Clear the executable files generated by compilation and the target files (object file, *. O ).

Make distclean: In addition to clearing executable and target files, the makefile generated by configure is also cleared.

Make install: Install the program to the system. If the source code is correctly compiled and the execution result is correct, you can install the program to the preset executable file storage path. If bin_programs macro is used, the program will be installed in the/usr/local/bin directory.

Make Dist: Package programs and related files into a compressed file for release. After the execution is complete, a file named package-version.tar.gz will be created under the directory. The package and version variables are defined according to the am_init_automake (package, Version) in the configure. In file. In this example, the file test-1.0.tar.gz will be created.

Make distcheck: similar to make Dist, but added to check whether the compressed file after packaging is normal. In addition to packaging the program and related files into a tar.gz file, this target will automatically unbind the compressed file, execute configure, and make all. After confirming that the compilation is successful, this tar.gz file will be available for release. This check is very useful. The pass-through package can be re-compiled by anyone with the GNU development environment.

./Configure, make, make install

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.