Autoconf & automake to automatically generate makefile
1. Run autoscan to generate Configure. Scan.
2. Modify Configure. Scan as follows:
Ac_init (hello. c)
Am_init_automake (hello, 1.0) // generated Application name & version number
# Ac_config_header ([config. H]) // mask (not required, related to autoheader)
Ac_output (makefile)
CP Configure. Scan Configure. In (or configure. am)
3. Execute aclocal to generate aclocal. M4.
4. Execute Autoconf to generate configure
5. Compile the makefile. Am document.
Automake_options = foreign
Bin_programs = Hello
Hello_sources = Hello. C // Add dependency file. C. h
6. Execute automake -- add-missing:
Automake generates the makefile. In File Based on the makefile. Am file.
Parts)
If the prompt is:
Required file './news' not found
Required file './readme' not found
Required file './authors' not found
Required file './changelog' not found
Run touch news readme authors changelog to create the corresponding directory.
7. Execute./configure to generate makefile.
Note: The preceding example uses hello. C as an example.