Gun makefile:
Generate makefile for automake and Autoconf (simplified ).
ProgramSource code
|
Autoscan *
|
V
Configure. Scan
|
Compile and modify *
|
V aclocal *
Makefile. Am configure. In -------> Aclocal. M4
\___ / \______ /
\ / \ /
Automake * Autoconf *
\ / \ /
V v
Makefile. In Configure
\ /
. / Configure *
\ /
V
Makefile
Detailed steps and possible problems:
Autoscan /* Generate Configure. Scan */
// Generate Configure. Scan and modify it to configure. In.
Aclocal /**/
// If aclocal. M4 cannot be generated, add
Am_init_automake
Sometimes you need to add ac_output ([makefile])
Autoconf /* Generate configure */
// Makefile. AM in the root directory (you do not need to create the source code in the root directory) as follows:
Subdirs = SRC
// The new file makefile. AM in the src directory is as follows (for example, if the source directory is the root directory, it is created in the root directory ):
Automake_options = Foreign
Bin_programs = Hello
Hello_sources = Hello. c
Libtoolize - F - C /* View missing files */
// Autoheader to generate the file Configure. H. In
Automake - A /* View missing files */
Touch news
Touch readme
Touch authors
Touch changelog
Automake
. / Configure
Make
Sudo make install
Error: The target "all" can be created without rules ". Stop.
Modify makefile. AC to add makefile in the current directory