These classnotes are depreciated. As of 2005, I no longer teach the classes. Notes will remain online for legacy purposes

UNIX01/Building An Application

Classnotes | UNIX01 | RecentChanges | Preferences

Once you have extracted the source for an application into a directory, you must build that application.

The standard tool which application developers use to make building their applications easy is something called a Makefile. If they did use a Makefile, then by simply typing 'make' in the application directory will build the application.

However, Makefiles can sometimes be overly complicated. For example, you could want the application installed into /usr, but the person who wrote the application has it defaulted to /opt. If you wanted to change it somewhere else, you would have to hand edit the Makefiles. If there were many Makefiles in a particular project, it could get unweildy very fast. Enter automake and autoconf:

automake and autoconf

Unless you are a developer, you will not need to learn much about using these tools. The basic intent behind them is to make it easier for people to customize their builds and installs. As an end-user, all you need to worry about is how to build an application which uses automake and autoconf.

The standard method for building using these tools is to issue the following commands in the following order:

 $ ./configure
 $ make
 $ make install

The 'configure' command checks your system for dependancies, sets up paths for the build (so the application can know where your libraries are) and creates appropriate Makefiles. 'make' does the actual application building, and 'make install' performs the actual install.

Once the application has been installed in this way, it can be uninstalled using the following command issued in the source code directory:

 $ make uninstall

The 'configure' command takes many parameters as its options. For a full list of these, issue './configure --help'. As an example, if you wanted to change where the files get installed for a particular application from '/opt' to '/usr' you could issue this command:

 $ ./configure --prefix=/usr


Classnotes | UNIX01 | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited May 10, 2003 12:29 am (diff)
Search:
(C) Copyright 2003 Samuel Hart
Creative Commons License
This work is licensed under a Creative Commons License.