Install Command:
Apt-get Install Automake
Automake instance:
Helloworld.c
#include <stdio.h>
#include <string.h>
extern int output (char* data);
int main ()
{
int n=15;
printf ("Hellow World%d \ n");
Output ("from helloword.c");
return 0;
}
Output.c
#include <stdio.h>
#include <string.h>
int output (char* data)
{
printf ("Output data= %s\n ", data);
return 0;
}
1. Execute the Order:
AutoScan
2, modify the Configure.scan and renamed to Configure.ac
#-*-autoconf-*-
# Process This file and autoconf to produce a configure script.
Ac_prereq ([2.68])
Ac_init ([HelloWorld], [2.0], [542335496@qq.com])
Am_init_automake (helloworld,2.0)
Ac_config_srcdir ([output.c])
Ac_config_headers ([config.h])
# Checks for programs.
Ac_prog_cc
# Checks for libraries.
# Checks for header files.
Ac_check_headers ([string.h])
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
Ac_output (Makefile)
Command: MV Configure.scan configure.ac
Gedit Configure.ac
3. Execute the Order:
Aclocal produces aclocal.m4 file, which is a successful configuration
Autoconf produces configure file, which is a successful configuration
4. Execute the Order:
Autoheader Generation Config.h.in
5. Create and edit makefile.am files:
Gedit makefile.am
Content is:
automake_options= Foreign
bin_programs= HelloWorld
helloworld_sources= HELLOWORLD.C output.c
6, Automake--add-missing generate makefile.in file, no output information can be successful
7./configure
8, make
9. Make install compilation complete
10. Operation:
./helloworld
11, packaging and publishing, generate helloworld-2.0.tar.gz:
Make Dist