天天看點

Makefile自動生成(Automake)

Makefile file makes compiling work more efficient, especially when it turns to solve some jobs with a complex structure. But

it depends on the building environment so hard that we can't use it portably. So that a tools called automake assist us to generate makefile

automatically.

<code>autoscan</code>

<code>vim configure.scan</code> and <code>mv configure.scan configure.ac</code>

<code>aclocal</code>

<code>autoconf</code>

<code>vim Makefile.am</code>

<code>automake --add-missing</code>

<code>./configure</code>

<code>make</code>

First of all, create a source code in C:

then <code>autoscan</code> it, you will find a file named configure.scan

edit configure.scan and rename it as configure.ac

use <code>aclocal</code> to create aclocal.m4. m4 is a kind of marco processor.

use <code>autoconf</code> to generate configure

edit makefile.am

<code>./make</code>

Copyright © 2021 Gsharp. All Rights Reserved.