Skip to content
Snippets Groups Projects
Commit e3f73e52 authored by Elmar S. Heeb's avatar Elmar S. Heeb Committed by Claude Becker
Browse files

managing_a_software_package_with_the_gnu_autotools

parent 06f4d56c
No related branches found
No related tags found
No related merge requests found
......@@ -56,4 +56,38 @@ This file is written in the [[http://www.gnu.org/software/m4/|M4 preprocessor la
==== Makefile.am ====
<code Makefile>
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
<code bash>
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
<code bash>
./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
<code bash>
./configure
make distcheck
</code>
you can also check for inaccuracies in your configuration in addition to creating the ''.tar.gz'' file.
If you want to clean up you can call
<code bash>
make distclean
</code>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment