automake


Introduction:

AUTOMAKE:
is part of the GNU AUTOTOOLS package; from relatively simple user
input, AUTOMAKE generates files that can, in turn, generate Makefiles
and other items necessary for building a software package.

AUTOMAKE follows the fairly strict and elaborate GNU Makefile standards.
AUTOMAKE reads user input files, typically named Makefile.am, creating
corresponding files called Makefile.in, which contain the equivalent
information, but with more elaborate formatting, and with details
appropriate to the environment detected by the CONFIGURE command, such
as the name and location of the necessary compiler.

As an extremely simple software project, consider an example known as
"amhello", which is essentially a C "Hello, world" program.

If we treat this as a real project, though, a user might begin by making
a src subdirectory in which the C file would be stored as
amhello.c.

To accompany amhello.c, some information needed to build the
makefile would be stored in a file Makefile.am:

      bin_PROGRAMS = hello
      hello_SOURCES = main.c
    

In the parent directory, there needs to be a README document,
which typically gives a brief overview of the project, and which here,
might simply read "The AMHELLO project illustrates a simple
example of the GNU AUTOMAKE facility."

Also in the parent directory would be another Makefile.am,
this time reading:

      SUBDIRS = src
      dist_doc_DATA = README
    

The fifth and final item is another file in the parent directory,
called configure.ac, which instructs the AUTOCONF tool on
how to set up the configure script, and here the input becomes
a bit more elaborate and obscure:

      AC_INIT([amhello], [1.0], [bug-automake@gnu.org])
      AM_INIT_AUTOMAKE([-Wall -Werror foreign])
      AC_PROG_CC
      AC_CONFIG_HEADERS([config.in])
      AC_CONFIG_FILES([
        Makefile
        src/Makefile
      ])
      AC_OUTPUT
    

Assuming these files are in place, then the process of installing the
amhello package would consist of the following commands,
given in the parent directory:

      autoreconf --install
      ./configure
      make
    

Web Site:


https://www.gnu.org/software/automake/

Reference:

Usage:

On any ARC cluster, check the installation details
by typing "module spider automake".

AUOMAKE requires that the appropriate modules be loaded before it can be run.
One version of the appropriate commands for use on Cascades is:

module purge
module load automake/1.15
    

Examples:

In the following batch file, AUTOMAKE is used to configure and make
the "amhello" software package. In order to see what is going on,
the "ls" command is used before and after each step.

#! /bin/bash
#
#PBS -l walltime=5:00
#PBS -l nodes=1:ppn=1
#PBS -W group_list=cascades
#PBS -q open_q
#PBS -j oe

cd $PBS_O_WORKDIR

module purge
module load automake/1.15
#
ls
ls src
#
autoreconf --install
#
ls
ls src
#
./configure
#
ls
ls src
#
make
#
ls
ls src
#

A complete set of files to carry out a similar process are available in
automake_example.tar