Linux environment, when the project is very large, the process of compiling is very complex, so need to use make tool, automatic compilation installation, but the handwriting makefile file is more complex, fortunately in the GNU program, designed a tool called Autoconf/automake, Used to automatically generate makefile files, which provides a convenient and quick entry for compiling and installing programs.
First, check whether the Autotools tool is installed with the which command
Aclocal AutoScan autoconf Autoheader automake
Second, installation Autotools
Since the Linux distribution is the Red-hat series of Centos7, use Yum to install autoconf and Automake
Third, new source files, in order to be simple and rapid, only use the classic program hello.c
Iv. execute the AutoScan command to generate the Configure.scan file, and modify it to configure.ac, if there is no this. ac file, execution of the aclocal command will be error-free
V. Modification of CONFIGURE.AC Parameters
The above parameters will be the same, and you need to add the Am_init_automake entry, note that it is the start of AM and not the AC
Vi. execute the aclocal command to generate the Aclocal.m4 file
Vii. execute the autoconf command to generate the Configure file
Viii. using the Autoheader command to generate a config.h.in file
Ix. Manual creation of makefile.am files
The Automake tool converts makefile.am into makefile.in files according to the parameters in the config.in. Before using Automake, you should manually establish the makefile.am file.
Use the Automake command to generate the Makefile.in file add option--add-missing You can have the Automake tool automatically add the necessary script files
Xi. execute the./configure command to generate the final makefile file
12, finally make a click, and then execute the./hello Run the program
----------Tail Language: Open source is a kind of faith, continuous learning is the only way forward!
Automatic generation of makefile files using the Automake tool under Linux