Makefile. am, makefile. In And makefile

Source: Internet
Author: User
Tags automake

ArticleSource: http://blog.mcuol.com/User/wangguangdong/Article/17384_1.htm

 

Makefile. am, makefile. In, the relationship between makefiles, and the functions of commands such as aclocal, automake, and Autoconf

 

Aclocal # generate aclocal. M4
Libtoolize -- force
Automake -- add-Missing #Generate makefile. In according to makefile. AM
Autoconf #Generate configure Based on Configure. In
Autoheader

In order to find out the functions of a series of commands such as automake, I collected and read some relevant information. The following is a small example to familiarize yourself with the use of these GNU tools:

Example: Create a hello. c file in the/Hello/directory and compile and run it:

# Cd/Hello/

(1) write the source file hello. C:

Include
Int main (INT argc, char ** argv)
{
Printf ("Hello, GNU! N ");
Return 0;
}

(2) # autoscan
-> Generate Configure. Scan and autoscan. Log

(3) Change Configure. Scan to configure. In:

# Process this file with Autoconf to produce a configure script.
Ac_init (hello. c)
Am_init_automake (hello, 1.0)

# Checks for programs.
Ac_prog_cc

# Checks for library functions.
Ac_output (makefile)

(4) # aclocal
-> Generate aclocal. M4 and autom4te. cache (Configure. In is involved when aclocal. M4 is generated)

(5) # Autoconf
-> Generate configure (according to configure. In, and aclocal. M4)

(6) Compile makefile. am:

Automake_options = foreign
Bin_programs = Hello
Hello_sources = Hello. c

(7) # automake -- add-Missing
-> Generate makefile. In, depcomp, install-Sh, and missing (according to makefile. am, and aclocal. M4)

(8) #./configure
-> Generate makefile, config. log, and config. Status.

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.