The following tools can help you create a configuration and Makefile:
- autoscan
- autoconf
- aclocal
- automake -a
Assume the following directory structure below:
project1--------
\---src
\--- stl
| \--- stringSTL.cc
|
\--- prog1
\--- prog1.c, test.c
Two programs, stringSTL (a C++ program), and prog1.c ( a C program that
depends on test.c). Note, that this is really two separate programs
under one project. So currently this is all that exist in the directory
tree structure.
The first step is to run
autoscan from the project1 directory
$cd project1
$autoscan
$cp configure.scan configure.in
This will produce configure.scan, which in the last command above gets
copied to configure.in. Now, what's in configure.in will vary depending upon which version is used. Regardless, configure.in will have to be
edited. Below, is what is should look like:
Next, you will need to create serveral Makefile.am files, in each of the directories.
Next, run the following:
$autoconf
$aclocal
$automake -a
automake -a may alert you to missing files
COPYING, INSTALL, NEWS, README, AUTHORS, and ChangeLog. If
so, these files can be created as follows:
$touch COPYING INSTALL README NEWS AUTHORS ChangeLog TODO
It's best to run this command after running
automake -a
because some versions of automate will create an INSTALL file, plus a few
some of the other files.
touch will not overwrite any
of these; although, you may get a permissions error, which can be ignored.
Next, run
automake -a again
$automake -a
If you find errors in
configure.in it may be necessary to delete configure, and all config.* files. Do not delete configure.in. Then, run
autoconf, aclocal, automake -a again.