# $Id: Makefile,v 1.3 1997/04/19 17:51:33 root Exp $                                     # rcs version token. auto updated.

INSTALL= /usr/bin/install                  # location for install binary
CF=     sendmail.cf                        # config file name
M4=     /usr/bin/m4                        # location of m4
MC=     host.mc                            # config source file
CFDIR=  /etc/mail/cf                       # config root directory
RM=     rm -f                              # how to remove a file
CO=     /usr/bin/co                        # GNU RCS check-out binary
CI=     /usr/bin/ci                        # GNU RCS check-in binary
VI=     /usr/bin/vi                        # location of my editor

 

all:    sendmail.cf                        # default for make to build

cf:     ./$(MC)                            # alternate way to build cf
	$(M4) $(MC) > $(CF)                # commands to build cf

edit:                                      # safe editing of config source
	$(CO) -l $(MC)                     # check-out and lock config source
	$(VI) $(MC)                        # edit config source
	$(CI) -u $(MC)                     # check-in and unlock config source

install:                                   # install sendmail.cf
	$(INSTALL) -c -o root -g sys -m 644 $(CF) /etc/$(CF)

                                           # install sendmail.cf in /etc

stop:                                      # kill a running sendmail
	kill -TERM `/usr/bin/head -1 /var/run/sendmail.pid`

start:                                     # start a new sendmail daemon
	/usr/sbin/sendmail -bd -q60m        # command to start sendmail

restart:                                   # tell sendmail to reread config file
	kill -HUP `/usr/bin/head -1 /var/run/sendmail.pid`

reconfig:                                  # Quick update of config
	make edit                          # edit config
	make cf                            # create cf
	make install                       # install new cf
	make restart                       # read new config file

diff:                                      # view differences between existing
	diff /etc/$(CF) $(CF)              # config file and on just created

view:                                      # look at production config file
	view /etc/$(CF)

clean:                                     # remove just built config file
	rm -f $(CF)

#
# source file dependencies
sendmail.cf:    ./$(MC)                    # build new $(CF) if $(MC) changed
	make cf
