(1) program is used to compile and install
script not only created an
Makefile is tuned by defining or redefining directives (shown in Table 18.1 that begin lines in that file.
We will discuss each of these macros shortly but first note that, in general, you should never have to modify anything after the "end" line (shown in the following example). The only exception might be special requirements created by porting sendmail to a new platform.
################### end of user configuration flags ######################
Finally, before changing anything inside Makefile , be sure to read src/READ_ME . It always contains the latest information about building sendmail . In this book we are forced to speak in generalities, whereas the src/READ_ME file discusses operating systems, compilers, and hardware in specific detail.
The DBMDEF= directive defines the database library support you want. The currently available choices are listed in Table 18.2 . Details are given in the indicated section.
Either NDBM or NEWDB must be defined, or sendmail will read the aliases into its symbol table every time it starts. This will make sendmail crawl and is not recommended.
External databases can be extremely valuable, especially in providing easy solutions for complex problems. Therefore we recommend that you include a definition for all databases that your system supports, even if you don't immediately foresee a need for them.
Below, we illustrate the selection of two forms of database:
DBMDEF= -DNEWDB -DNDBM
When these two forms are selected, old databases are read by using NDBM, but new databases are created by using NEWDB. Read src/READ_ME for details about, and exceptions to, this transition process.
The ENVDEF= directive is used primarily to specify code that should either be specially included or excluded. The following example shows support for identd (8) being excluded from the compiled binary:
Note that, once excluded, support cannot
easily be included later by using options. But it may be better to turn
some facilities, such as
off and on with options rather than compiling
them out (see
Section 18.104.22.168, "Timeout.ident"
for a description of the
The ENVDEF= directive can also be used to define operating specific support. For example,
Here, support for Sun's Solaris 2.5.1 operating system is being included. In general, operating support is already included in the Makefile selected for your system. You will have only to redefine this if you are porting to a completely new operating system.
The INCDIRS= directive defines the directories searched (using the compiler's
Many Makefile s specify /usr/sww in these lines. If you don't need local include files or libraries, you can leave the /usr/sww in place without harm. 
This tells the loader to exclude dynamic library support for better security.
The LIBDIRS= directive defines the directories searched (using the loader's
LIBS= -ldb -lresolv -l44bsd
It is likely that you will have to add or change libraries in this list
depending on your architecture and operating system. To discover
which you need, run
(1) (see the next section)
and observe which routines the linker reports as missing.
The BINDIR= directive defines the location (directory) where the sendmail binary will be installed. It is very unlikely that you will ever have to change this from the value predefined for you in your Makefile . One exception might be if you are installing a new sendmail in parallel with the existing one. In that instance you might use
BINDIR=/usr/tests STDIR=/usr/tests HFDIR=/usr/tests ENVDEF= -D_PATH_SENDMAILCF=/usr/tests/sendmail.cf \ -D_PATH_SENDMAILPID=/usr/tests/sendmail.pid
The STDIR= and HFDIR= are described below. The ENVDEF= tells sendmail where its configuration and pid files will be found (see Section 18.8.34, PATH... ).
The STDIR= directive defines the location (directory) where the sendmail program's statistics file will be found (see Section 26.2.1, "The sendmail.st File" for a description of this file). It is very unlikely that you will ever have to change this from the value that is predefined for you in your Makefile .
The HFDIR= directive defines the location (directory) where the
program's SMTP-help file will be found (see
Section 34.8.28, HelpFile (H)
a description of the
The OBJADD= directive defines additional object files that need to be included in the sendmail program. It is very unlikely that you will ever have to change this from the value that is predefined for you in your Makefile . One exception might be if you need to replace a standard C library function with one that was customized to satisfy some local need. For example, consider a replacement for the syslog (3) routine. First place a copy of syslog.c in the src directory. Then run:
which will create an obj.* directory and populate it with symbolic links.  Finally, edit your Makefile and syslog.o to the OBJADD= directive:
This will cause the syslog.c file to be compiled to produce the needed syslog.o and will cause that syslog.o to be linked in with the sendmail binary.