Autoconf & automake automatically generate makefile

Source: Internet
Author: User

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.

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.