@@ -56,4 +56,38 @@ This file is written in the [[http://www.gnu.org/software/m4/|M4 preprocessor la
==== Makefile.am ====
<codeMakefile>
bin_SCRIPTS = foobar
</code>
All we have to do is define this one variable. The name of the variable is relevant and tells automake what to do with value after the equal sign. The ''bin'' before the underscore specifies the ''$prefix/bin'' (e.g., ''/usr/local/bin'') directory as expected. There are a few allowed values like ''etc'', ''man'', ''lib'', or ''include''. There are ways to define your own. The ''SCRIPTS'' after the underscore says that this is a program that needs not to be compiled. Some other values are ''PROGRAMS'', ''MANS'', or ''DATA''.
For more details consult the automake manual.
===== Creating the ''configure'' script =====
Now we can run
<codebash>
autoreconf --install
</code>
to generate the ''configure'' script. The ''--install'' option tells it to generate some helper files if necessary. You may want to add a ''--force'' option if you already used ''autoreconf'' earlier and want to make sure to use the latest helper files.
''autoreconf'' will call ''automake'', ''autoconf'', and possibly other programs from the GNU build system and will generate the ''Makefile.in'' in addition to the ''configure'' script. This is all you need.
===== Creating a Distributable Package =====
With
<codebash>
./configure
make dist
</code>
you can create the file ''myfoobar-1.0.tar.gz'' that you can distribute. The name of the packages and the version number are taken from ''configure.ac'' .
If you do
<codebash>
./configure
make distcheck
</code>
you can also check for inaccuracies in your configuration in addition to creating the ''.tar.gz'' file.