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.