|  5.1 User-Provided Input Files 
The smallest project requires the user to provide only two files.  The
remainder of the files needed to build the package are generated by the
GNU Autotools (see section 5.2 Generated Output Files).
 
 
`Makefile.am' is an input to automake.`configure.in' is an input to autoconf. 
I like to think of `Makefile.am' as a high-level, bare-bones
specification of a project's build requirements: what needs to be built,
and where does it go when it is installed?  This is probably Automake's
greatest strength--the description is about as simple as it could
possibly be, yet the final product is a `Makefile' with an array of
convenient maketargets. 
The `configure.in' is a template of macro invocations and shell
code fragments that are used by autoconfto produce a
`configure' script (see section C. Generated File Dependencies).autoconfcopies the contents of `configure.in' to
`configure', expanding macros as they occur in the input.  Other
text is copied verbatim. 
Let's take a look at the contents of the user-provided input files that
are relevant to this minimal project.  Here is the `Makefile.am':
 
 |  | 
 ## Makefile.am -- Process this file with automake to produce Makefile.in
bin_PROGRAMS = foonly
foonly_SOURCES = main.c foo.c foo.h nly.c scanner.l parser.y
foonly_LDADD = @LEXLIB@
 | 
 
This `Makefile.am' specifies that we want a program called
`foonly' to be built and installed in the `bin' directory when
make installis run.  The source files that are used to build
`foonly' are the C source files `main.c', `foo.c',
`nly.c' and `foo.h', thelexprogram in
`scanner.l' and ayaccgrammar in `parser.y'.  This
points out a particularly nice aspect about Automake: becauselexandyaccboth generate intermediate C programs
from their input files, Automake knows how to build such intermediate
files and link them into the final executable.  Finally, we must
remember to link a suitablelexlibrary, if `configure'
concludes that one is needed. 
And here is the `configure.in':
 
 |  | 
 dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT([foonly], [2.0], [gary@gnu.org])
AM_INIT_AUTOMAKE([1.9 foreign])
AC_PROG_CC
AM_PROG_LEX
AC_PROG_YACC
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
 | 
 
This `configure.in' invokes some mandatory Autoconf and Automake
initialization macros, and then calls on some Autoconf macros from the
AC_PROGfamily to find suitable C compiler,lex, andyaccprograms.  Finally, theAC_OUTPUTmacro is used to
cause the generated `configure' script to output a
`Makefile'---but from what?  It is processed from
`Makefile.in', which Automake produces for you based on your
`Makefile.am' (see section C. Generated File Dependencies). 
 |