home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Previous Section Next Section

5.1 The Build Script

The Build script[1] is used to compile, link, and install all the programs that are shipped with sendmail. The Build script is run like this:

[1] The Build script we describe in this section is not the same as the one in the top-level directory, nor is it the same as the one in the cf/cf directory. Both of those scripts are just tiny wrappers that invoke make(1) directly.

% ./Build  switches what  

Here we execute Build by prefixing its name with a dot and a slash. This trick ensures that you can run it, even if you do not have a dot in your PATH. As an alternative, because Build is a Bourne shell script, you can run the shell and have the shell run it:

% sh Build  switches what  

The switches change the behavior of Build, causing it, for example, to use different directories or clean out a directory to start over. We show all the Build command-line switches in Table 5-2, following the explanation of what, and explain them in detail in the sections that follow that table.

The what corresponds to the make(1) "targets" on the left side of the Makefile created for each program. If what is missing, the target defaults to all. The possible targets are:

all

This target causes the program to be compiled and linked. It creates an executable file that you can install and run, and also formats the manual pages.

clean

This target causes all the intermediate .o files to be removed, the executable file to be removed, and the formatted manual pages to be removed. This is a good way to reclaim disk space after installing the program. Running it does not, however, create a new Makefile. You should always create a new Makefile whenever you modify your m4 build file. See fresh in the next entry for one way to do that.

fresh

This target causes the obj directory to be removed in its entirety, and then recreated from scratch. If your m4 build file has been modified, this (with the -f or -Q switch) will cause a corresponding new Makefile to be created.

install

This target causes the created executable file (and possibly any manual pages) to be installed for use. You can prevent manuals from being installed by declaring the confNO_MAN_INSTALL build macro (confNO_MAN_INSTALL) in your m4 build file.

install-strip

This target causes the installed binary to be stripped with strip(1). Otherwise, it is the same as install.

force-install

Two programs, mail.local and rmail, will not install with the install command. Instead, each must be installed individually with this force-install command. Note that force-install is not supported at the top level, and must instead be run in each subdirectory as needed.

Table 5-2. Build command-line switches

Switch

§

Description

-A

-A

Show the architecture for the build

-c

-c

Clean out an existing object tree

-E

-E

Pass environment variables to Build

-f

-f

Use an m4 build file in alternative directory

-I

-I

Add additional include directories

-L

-L

Add additional library directories

-M

-M

Show the name of the object directory

-m

-m

Show, don't create the directory

-n

-n

Create the directory but don't compile[2]

-O

-O

Specify the path of the object directory

-Q

-Q

Set prefix for the object directory

-S

-S

Skip system-specific configuration

-v

-v

Specify build-variant

[2] The -n switch is not actually a part of Build. Instead, Build passes it to make(1).

    Previous Section Next Section