#
# Copyright (c) 1986, 1990 by The Trustees of Columbia University in
# the City of New York.  Permission is granted to any individual or
# institution to use, copy, or redistribute this software so long as it
# is not sold for profit, provided this copyright notice is retained.
#
# Reasonable invocations are:
#
#	make all		4.3bsd, Ultrix, Umax
#	make osf1		for DEC Alpha OSF/1 version 1.x and 2.x
#
# Current target list:
#	$(BIN)/mm
#	$(BIN)/mm-trans
#	$(LOCLIB)
#	$(LOCLIB)/$(HELPDIR0)
#	$(LOCLIB)/$(HELPDIR1)
#	$(LOCLIB)/$(HELPDIR1)/.update
#	$(LOCLIB)/$(HELPDIR2)
#	$(LOCLIB)/$(HELPDIR2)/.update
#	$(LOCLIB)/$(HELPDIR3)
#	$(LOCLIB)/$(HELPDIR3)/.update
#	$(LOCLIB)/$(HELPDIR4)
#	$(LOCLIB)/$(HELPDIR4)/.update
#	$(LOCLIB)/$(HELPDIR5)
#	$(LOCLIB)/$(HELPDIR5)/.update
#	$(LOCLIB)/$(HELPDIR6)
#	$(LOCLIB)/$(HELPDIR6)/.update
#	$(LOCLIB)/$(HELPDIR7)
#	$(LOCLIB)/$(HELPDIR7)/.update
#	$(LOCLIB)/help
#	$(LOCLIB)/mm.conf
#	$(LOCLIB)/mmail.el
#	$(LOCLIB)/movemail
#	$(OS)
#	$(PATCHFILES)
#	aixrt			IBM RT
#	all			make everything
#	argsort			utility to echo arguments in sorted order
#	bsd43			BSD 4.3 UNIX
#	clean			remove intermediate files that make produces
#	clobber			remove almost all files that make produces
#	cmds.h
#	depends			object-header file dependencies
#	distclean		remove all files that make produces
#	dynix211		DYNIX 2.11
#	first			default target
#	HELP			install HELP tree
#	help
#	hpux			HP 9000/7xx and 9000/8xx with HP-UX 8.x and 9.x
#	install			install mm files on system.  NB: you must set
#				SFILES too, or else do:
#				make system-name TARGETS=install
#	irix4			Silicon Graphics IRIX 4.x
#	irix5			Silicon Graphics IRIX 5.x
#	isi40			ISI 4.0
#	lint			run lint on source files
#	main-install		subsidiary target for "make install"
#	mkversion		utility to create a version string for mm
#	mm			mm executable
#	mm-trans		utility to convert a TOPS-20 mail file to UNIX
#	mm.conf			customized system-wide local configuration file
#	mm.dist			distribution subdirectory
#	mostlyclean		same as clean
#	movemail		utility to move mail from spool directory to
#				user's mailbox
#	mtxinu43		Mt. XINU 4.3
#	next			NeXT Mach 3.x
#	next-gcc		NeXT Mach 3.x with GNU gcc
#	osf1			DEC Alpha OSF/1 2.x
#	patches			install patches, if any
#	prepatch		utility to install patches
#	re-HELP			update HELP files
#	re-install		install all but configuration file
#	realclean		same as distclean
#	set.h
#	solaris			Sun Solaris 2.x
#	solaris-c++		Sun Solaris 2.x with C++ (not yet operational)
#	solaris-gcc		Sun Solaris 2.x with GNU gcc
#	solaris2.1		Sun Solaris 2.1
#	solaris2.2		Sun Solaris 2.2
#	solaris2.2-c++		Sun Solaris 2.2 with C++ (not yet operational)
#	solaris2.2-gcc		Sun Solaris 2.2 with GNU gcc
#	solaris2.3		Sun Solaris 2.3
#	solaris2.3-c++		Sun Solaris 2.3 with C++ (not yet operational)
#	solaris2.3-gcc		Sun Solaris 2.3 with GNU gcc
#	solaris2.4		Sun Solaris 2.4
#	solaris2.x		Sun Solaris 2.x
#	sunos			Sun SunOS 4.x
#	sunos3.4		Sun SunOS 3.4
#	sunos3.5		Sun SunOS 3.5
#	sunos4.x		Sun SunOS 4.x
#	sys-prof		utility to create system-wide .mminit file
#	sysv3b2			System V UNIX on 3B2
#	sysv52			System V.2 UNIX
#	TAGS			GNU Emacs TAGS file
#	tar			make tar file of mm.dist
#	token.h
#	tokentest		test program for RFC822 address parsing
#	ultrix			DECstation ULTRIX 4.x
#	ultrix20		VAX ULTRIX 2.x
#	ultrix40		DECstation ULTRIX 4.0
#	ultrix41		DECstation ULTRIX 4.1
#	ultrix42		DECstation ULTRIX 4.2
#	ultrix4x		DECstation ULTRIX 4.x
#	umaxv			UMAXV
#
# $Header: /usr/local/src/mm/mm-0.94/mm/RCS/Makefile,v 1.11 2005/05/31 15:44:26 beebe Exp beebe $
#
# [30-May-2005]
#=======================================================================
.SUFFIXES: .H .h .i .c

# Trapping preprocessor output in .i files is very useful during ports
# to new systems.  We flush empty lines, and turn preprocessor lines
# into comments so that experimental compilations reflect true line
# numbers.
.c.i:
	$(CC) $(CFLAGS) -E $*.c | grep -v '^[ \t]*$$' | \
		sed -e 's@^\( *#.*\)$$@/* \1 */@' \
			-e 's/[ 	][ 	]*$$//g' \
			-e '/^$$/d' >$*.i
.c.o:
	$(CC) $(CFLAGS) -c $*.c
#=======================================================================

prefix		= /usr/local

# Can use gawk or nawk here; IBM RS/6000 AIX calls nawk awk.
AWK		= nawk

BIN		= $(DESTDIR)$(prefix)/bin

# How to make dependency lines for mkdep.awk to format nicely.  If you
# change this, change DEPENDSFILTER and DEPENDSPROGRAM below.  We use
# gcc by default since it provides a common interface across many
# architectures.
CCM		= gcc -MM

CCMD		= ../ccmd

#CCMDLIB	= -L$(prefix)/lib -lccmd
CCMDLIB		= $(CCMD)/ccmd.a

CFLAGS		= $(DEBUG) $(INCLUDE) $(MACHINE) $(USAGE) $(TESTHELP) \
		  -DS_FILE=\"$(SFILE)\" $(OPT) $(DEFINES)

DEFINES		=

#DEBUG		= -DDEBUG -DMDEBUG
DEBUG		= -DDEBUG
DEPENDSFILES	= *.c

# gcc -MM produces
# file : file1 file2 ... \
#	 file file ...
# This filter turns it into
# file : file1
# file : file2
# ...
DEPENDSFILTER	= $(AWK) $(DEPENDSPROGRAM) | grep -v /usr

DEPENDSPROGRAM	= '{line = $$0; \
		    while ($$0 ~ /\\$$/) { getline ; line = line $$0 }; \
		    $$0 = line; \
		    gsub(/[:\\]/,""); \
		    for (k = 2; k <= NF; ++k) print $$1,":",$$k \
		   }'

# help files
HELPDIR0	= help/TOPICS.DIR
HELPDIR1	= help/READ.DIR
HELPDIR2	= help/SEND.DIR
HELPDIR3	= help/TOP.DIR
HELPDIR4	= help/VARS.DIR
HELPDIR5	= help/TOPICS.DIR/READ.DIR
HELPDIR6	= help/TOPICS.DIR/SEND.DIR
HELPDIR7	= help/TOPICS.DIR/TOP.DIR
HELPDIRS	= $(LOCLIB)/$(HELPDIR0) $(LOCLIB)/$(HELPDIR1) \
		  $(LOCLIB)/$(HELPDIR2) $(LOCLIB)/$(HELPDIR3) \
		  $(LOCLIB)/$(HELPDIR4) $(LOCLIB)/$(HELPDIR5) \
		  $(LOCLIB)/$(HELPDIR6) $(LOCLIB)/$(HELPDIR7)
INCLUDE		= -I$(CCMD)
LDFLAGS		= $(DEBUG)

#LIBS		= $(CCMDLIB) -lcurses
#LIBS		= $(CCMDLIB) -ltermcap -lbsd
LIBS		= $(CCMDLIB) -ltermcap -lnsl
LIBS		= $(CCMDLIB) -lcurses -lnsl

LINT		= lint
LINTFLAGS	= -Dlint -DDEBUG -DMDEBUG $(INCLUDE) $(MACHINE)
LINTSRCS	= $(SRCS)

# where to install library type files
LOCLIB		= $(prefix)/lib/mm

# if you don't have a preprocessor predefine, then define your machine
# type here:
MACHINE		=

# set the compiler optimization level here
OPT		= -g

PATCHFILES	= patch.*
RM		= /bin/rm -f
REGEXDIR	= regex-0.12
SED		= /bin/sed
SHELL		= /bin/sh
TESTHELP	=

# define USAGE if you want MM to log usage statistics
USAGE		= -DUSAGE -DUSAGEFILE=$(LOCLIB)/usage.log

#=======================================================================
# Please keep these in alphabetical order for neatness

H		= acttab.h address.h args.h babyl.h \
		  chartype.h cmds.h compat.h config.h extern.h \
		  formats.h help.h keytab.h message.h mm-patchlevel.h \
		  mm.h osfiles.h parse.h pathnames.h rd.h seq.h set.h \
		  token.h version.h

OBJS		= action.o address.o alias.o babyl.o \
		  browse.o cmds.o compat.o dates.o debug.o display.o \
		  doinit.o dt.o edit.o exit.o file.o formattab.o \
		  headers.o help.o init.o keywords.o mailrc.o mbox.o \
		  mh.o misc.o mm.o more.o move.o mtxt.o newmail.o \
		  novice.o parse.o parsemsg.o pop2.o pop3.o print.o \
		  rd.o read.o send.o sendcmds.o sendmail.o seq.o set.o \
		  signals.o support.o token.o usage.o whoami.o

SRCS		= action.c address.c alias.c babyl.c \
		  browse.c cmds.c compat.c dates.c debug.c display.c \
		  doinit.c dt.c edit.c exit.c file.c formattab.c \
		  headers.c help.c init.c keywords.c mailrc.c mbox.c \
		  mh.c misc.c mm.c more.c move.c mtxt.c newmail.c \
		  novice.c parse.c parsemsg.c pop2.c pop3.c print.c \
		  rd.c read.c send.c sendcmds.c sendmail.c seq.c set.c \
		  signals.c support.c token.c usage.c whoami.c

SYSH            = s-aixrt.h s-bsd43.h s-dynix211.h s-hpux.h s-isi40.h \
		  s-mtxinu43.h s-osf1.h s-osf1-4.h s-osf1-5.h s-sun34.h \
		  s-sun35.h s-sun40.h s-sun50.h s-sysv3b2.h s-sysv52.h \
		  s-ultrix20.h s-ultrix40.h s-umaxv.h

#=======================================================================
# Force the user to tell what to make, to ensure correct compilation options.
first:
	@echo "You must tell me what to make.  Do"
	@echo "	make <systemname>"
	@echo "where <systemname> is one of these:"
	@echo "	aixrs6000 aixrt all bsd43 dynix211 freebsd freebsd gnu-linux hpux"
	@echo "	hpux-gcc hpux11 hpux11-gcc irix4 irix5 irix6 isi40 macosx mtxinu43"
	@echo "	netbsd next next-gcc openbsd osf1 osf1-4 osf1-5 osf1-c++ osf1-posix"
	@echo "	solaris solaris-c++ solaris-gcc solaris10 solaris2.1 solaris2.2"
	@echo "	solaris2.2-gcc solaris2.3 solaris2.3-c++ solaris2.3-gcc solaris2.4"
	@echo "	solaris2.x sunos sunos3.4 sunos3.5 sunos4.x sunos5.3 sysv3b2 sysv52"
	@echo "	ultrix ultrix20 ultrix40 ultrix41 ultrix42 ultrix4x umaxv"
	@echo
	@echo "If you use the all target, then you also need to have edited"
	@echo "config.h to include the correct s-xxx.h system-specific"
	@echo "configuration file.  This is unnecessary if you use a"
	@echo "system-specific target name."

all:	mm movemail sys-prof mm-trans

$(BIN)/mm: mm
	@echo installing MM EXECUTABLE
	-@ls -alg $(BIN)/mm $(BIN)/mm.old
	@cp mm $(BIN)/mm.new
	@chmod 755 $(BIN)/mm.new
	@if [ -f $(BIN)/mm ]; then \
		mv $(BIN)/mm $(BIN)/mm.old; \
	 fi
	@mv $(BIN)/mm.new $(BIN)/mm
	-@ls -alg $(BIN)/mm $(BIN)/mm.old

$(BIN)/mm-trans: mm-trans
	@echo installing MM-TRANS \(transform\)
	-@ls -alg $(BIN)/mm-trans $(BIN)/mm-trans.old
	@cp mm-trans $(BIN)/mm-trans.new
	@if [ -f $(BIN)/mm-trans ]; then \
		mv $(BIN)/mm-trans $(BIN)/mm-trans.old; \
	 fi
	@mv $(BIN)/mm-trans.new $(BIN)/mm-trans
	@chmod 755 $(BIN)/mm-trans
	-@ls -alg $(BIN)/mm-trans $(BIN)/mm-trans.old


argsort: argsort.c
	$(CC) $(CFLAGS) $(LDFLAGS) -o argsort argsort.c $(LIBS)

check:
	@echo There is no validation suite for this program

clean mostlyclean:
	-$(RM) *.i *.o \#* *~ core a.out
	-cd $(REGEXDIR); $(MAKE) $@

clobber:	clean
	-$(RM) argsort mkversion mm mm-trans movemail prepatch sys-prof
	-$(RM) TAGS
	-$(RM) cscope.out
	-cd $(REGEXDIR); $(MAKE) $@

cmds.h: cmds.H mkdefines
	awk -f mkdefines < cmds.H > cmds.h

#config.h: $(SYSH)
#	touch config.h
#config.h:
#	@echo See the README file for instructions on creating config.h
#	@exit 1

depends:	mkdep.awk $(DEPENDSFILES)
	$(CCM) $(CFLAGS) $(DEPENDSFILES) | $(DEPENDSFILTER) | \
		sort -u | $(AWK) -f mkdep.awk >depends

distclean realclean:	clobber
	-$(RM) depends
	-cd $(REGEXDIR); $(MAKE) $@

# copy the tree wholesale, assuming it's not there
HELP:
	@echo installing HELP
	tar cf - help | (cd $(LOCLIB) ; tar xf - )

help:
	@echo checking help files

install: main-install HELP $(LOCLIB)/mm.conf

$(LOCLIB):
	-if [ ! -d $(LOCLIB) ] ; then mkdir $(LOCLIB) ; fi

$(LOCLIB)/mm.conf: mm.conf
	@echo installing MM.CONF -- init file
	-@ls -alg $(LOCLIB)/mm.conf $(LOCLIB)/mm.conf.old
	@cp mm.conf $(LOCLIB)/mm.conf.new
	@chmod 664 $(LOCLIB)/mm.conf.new
	@if [ -f $(LOCLIB)/mm.conf ]; then \
		mv $(LOCLIB)/mm.conf $(LOCLIB)/mm.conf.old; \
	 fi
	@mv $(LOCLIB)/mm.conf.new $(LOCLIB)/mm.conf
	-@ls -alg $(LOCLIB)/mm.conf $(LOCLIB)/mm.conf.old

$(LOCLIB)/mmail.el: mmail.el
	@echo installing MMAIL.EL
	-@ls -alg $(LOCLIB)/mmail.el $(LOCLIB)/mmail.el.old
	@cp mmail.el $(LOCLIB)/mmail.el.new
	@chmod 664 $(LOCLIB)/mmail.el.new
	@if [ -f $(LOCLIB)/mmail.el ]; then \
		 mv $(LOCLIB)/mmail.el $(LOCLIB)/mmail.el.old; \
	 fi
	 @mv $(LOCLIB)/mmail.el.new $(LOCLIB)/mmail.el
	-@ls -alg $(LOCLIB)/mmail.el $(LOCLIB)/mmail.el.old

$(LOCLIB)/movemail: movemail
	@echo installing MOVEMAIL
	-@ls -alg $(LOCLIB)/movemail $(LOCLIB)/movemail.old
	@cp movemail $(LOCLIB)/movemail.new
	@if [ -f $(LOCLIB)/movemail ]; then \
		mv $(LOCLIB)/movemail $(LOCLIB)/movemail.old; \
	 fi
	@mv $(LOCLIB)/movemail.new $(LOCLIB)/movemail
	@chgrp daemon $(LOCLIB)/movemail
	@chmod 2751 $(LOCLIB)/movemail
	-@ls -alg $(LOCLIB)/movemail $(LOCLIB)/movemail.old


$(LOCLIB)/help: help
	@echo installing HELP
	-mkdir $@

$(LOCLIB)/$(HELPDIR0): $(HELPDIR0)
	-mkdir $@

$(LOCLIB)/$(HELPDIR1): $(HELPDIR1)
	-mkdir $@

$(LOCLIB)/$(HELPDIR2): $(HELPDIR2)
	-mkdir $@

$(LOCLIB)/$(HELPDIR3): $(HELPDIR3)
	-mkdir $@

$(LOCLIB)/$(HELPDIR4): $(HELPDIR4)
	-mkdir $@

$(LOCLIB)/$(HELPDIR5): $(HELPDIR5)
	-mkdir $@

$(LOCLIB)/$(HELPDIR6): $(HELPDIR6)
	-mkdir $@

$(LOCLIB)/$(HELPDIR7): $(HELPDIR7)
	-mkdir $@

# need to delete HLP files, in case we have no write access to the files
# themselves, though we have write access to the directories
$(LOCLIB)/$(HELPDIR1)/.update: $(HELPDIR1)/*.HLP
	@(cd $(LOCLIB) ; $(RM) $? )
	cp $? $(LOCLIB)/$(HELPDIR1)
	@(cd $(LOCLIB) ; chmod 644 $? )
	@$(RM) $@
	touch $@

$(LOCLIB)/$(HELPDIR2)/.update: $(HELPDIR2)/*.HLP
	@(cd $(LOCLIB) ; $(RM) $? )
	cp $? $(LOCLIB)/$(HELPDIR2)
	@(cd $(LOCLIB) ; chmod 644 $? )
	@$(RM) $@
	touch $@

$(LOCLIB)/$(HELPDIR3)/.update: $(HELPDIR3)/*.HLP
	@(cd $(LOCLIB) ; $(RM) $? )
	cp $? $(LOCLIB)/$(HELPDIR3)
	@(cd $(LOCLIB) ; chmod 644 $? )
	@$(RM) $@
	touch $@

$(LOCLIB)/$(HELPDIR4)/.update: $(HELPDIR4)/*.HLP
	@(cd $(LOCLIB) ; $(RM) $? )
	cp $? $(LOCLIB)/$(HELPDIR4)
	@(cd $(LOCLIB) ; chmod 644 $? )
	@$(RM) $@
	touch $@

$(LOCLIB)/$(HELPDIR5)/.update: $(HELPDIR5)/*.HLP
	@(cd $(LOCLIB) ; $(RM) $? )
	cp $? $(LOCLIB)/$(HELPDIR5)
	@(cd $(LOCLIB) ; chmod 644 $? )
	@$(RM) $@
	touch $@

$(LOCLIB)/$(HELPDIR6)/.update: $(HELPDIR6)/*.HLP
	@(cd $(LOCLIB) ; $(RM) $? )
	cp $? $(LOCLIB)/$(HELPDIR6)
	@(cd $(LOCLIB) ; chmod 644 $? )
	@$(RM) $@
	touch $@

$(LOCLIB)/$(HELPDIR7)/.update: $(HELPDIR7)/*.HLP
	@(cd $(LOCLIB) ; $(RM) $? )
	cp $? $(LOCLIB)/$(HELPDIR7)
	@(cd $(LOCLIB) ; chmod 644 $? )
	@$(RM) $@
	touch $@

# NB: On Sun Solaris 2.x at least, lint doesn't properly handle the
# include of S_FILE in config.h, taking instead the wrong branch, and
# including the default file.  For linting, I therefore had to
# manually modify config.h to make the default s-xxx.h file the same
# one as S_FILE is set to.
lint:
	@echo $(LINT) $(LINTFLAGS) $(INCLUDE) $(LINTSRCS)
	$(LINT) $(LINTFLAGS) $(INCLUDE) $(LINTSRCS)

main-install: $(BIN)/mm $(LOCLIB) $(LOCLIB)/mmail.el \
	 $(LOCLIB)/movemail $(BIN)/mm-trans
	@echo mm installed

mkversion: mkversion.c whoami.o compat.o dates.o mm-patchlevel.h
	-$(RM) mkversion
	$(CC) $(CFLAGS) $(LDFLAGS) -o mkversion mkversion.c whoami.o compat.o dates.o $(LIBS)

mm:	$(OBJS) version.o $(CCMDLIB)
	-$(RM) $@
	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OBJS) version.o $(LIBS)

# Use private version of regular expression code in order to support
# C++ compilation, and ensure consistent behavior on all platforms
REGEXOBJ=$(REGEXDIR)/regex.o $(REGEXDIR)/test/printchar.o
mm-trans: mm-trans.c $(REGEXOBJ)
	$(CC) $(CFLAGS) $(LDFLAGS) -o mm-trans mm-trans.c $(REGEXOBJ) $(LIBS)

mm.conf: sys-prof
	./sys-prof

mm.dist:
	-$(RM) -rf mm.dist
	-mkdir mm.dist
	(cd mm.dist; co -q ../RCS/*)

movemail:  movemail.c
	-$(RM) movemail
	$(CC) $(CFLAGS) $(LDFLAGS) -o movemail movemail.c $(LIBS)

$(PATCHFILES):

patches:  $(PATCHFILES) prepatch argsort
	./prepatch `./argsort $(PATCHFILES)`
	touch patches

prepatch: prepatch.c config.h osfiles.h compat.h
	$(CC) $(CFLAGS) $(LDFLAGS) -o prepatch prepatch.c $(LIBS)

$(REGEXDIR)/regex.o:	$(REGEXDIR)/regex.c $(REGEXDIR)/regex.h $(REGEXDIR)/args.h
	(cd $(REGEXDIR); \
		CC='$(CC)' ./configure ; \
		$(MAKE) CC='$(CC)' CFLAGS='$(CFLAGS) -DREGEX_MALLOC' regex.o)

$(REGEXDIR)/test/printchar.o: $(REGEXDIR)/test/printchar.c $(REGEXDIR)/test/args.h
	(cd $(REGEXDIR)/test; \
		$(MAKE) CC='$(CC)' CFLAGS='$(CFLAGS)' printchar.o)

# tries to update just the files that are changed
re-HELP: $(LOCLIB)/help $(HELPDIRS) $(LOCLIB)/$(HELPDIR1)/.update \
	$(LOCLIB)/$(HELPDIR2)/.update $(LOCLIB)/$(HELPDIR3)/.update \
	$(LOCLIB)/$(HELPDIR4)/.update $(LOCLIB)/$(HELPDIR5)/.update \
	$(LOCLIB)/$(HELPDIR6)/.update $(LOCLIB)/$(HELPDIR7)/.update

re-install: main-install re-HELP

set.h:	set.H mkdefines
	awk -f mkdefines < set.H > set.h

sys-prof: sys-prof.o formattab.o
	-$(RM) sys-prof
	$(CC) $(CFLAGS) $(LDFLAGS) -o sys-prof sys-prof.o formattab.o $(LIBS)

TAGS:	$(H) $(SRCS)
	etags *.[ch]

tar: 	mm.dist
	tar cf mm.tar mm.dist

token.h: token.H mkdefines
	awk -f mkdefines < token.H > token.h

tokentest: token.c
	$(CC) $(CFLAGS) -g $(LDFLAGS) -o token -DTEST token.c $(LIBS)

version.o: $(OBJS) version.c version.h mkversion
	-chmod ug+w version.h
	./mkversion +e
	$(CC) $(CFLAGS) -c version.c

#whobuilt.o: $(SRCS) $(H)
#	$(CC) $(CFLAGS) "`./whobuiltme`" -c whobuilt.c

#=======================================================================
# System-specific convenience targets
#
# You can redefine TARGETS at make-time to make a particular file or
# files, for example:
#	make osf1 TARGETS='action.i edit.i exit.o'
#	make osf1 TARGETS=depends
#	make osf1 TARGETS=install
#	make osf1 TARGETS=lint

TARGETS		= patches all

COMMON		= CC='cc' \
		  LIBS='$(CCMDLIB) -ltermcap' \
		  LINTFLAGS='$(LINTFLAGS)' \
		  LINTSRCS='$(LINTSRCS)' \
		  MACHINE='' \
		  OPT='$(OPT)' \
		  USAGE='-DUSAGE'

GCCFLAGS	= -Wall -Wshadow -Wcast-qual -Wpointer-arith -Wwrite-strings \
		  -Wnested-externs

OS		= gnu

#-----------------------------------------------------------------------
aixrt:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		SFILE='s-aixrt.h' \
		$(TARGETS)

#-----------------------------------------------------------------------
aixrs6000:
	$(MAKE) $(MFLAGS) \
		CC='c89 -Dunix' \
		LIBS='$(CCMDLIB) -ltermcap -lbsd' \
		$(COMMON) \
		SFILE='s-aixrs6000.h' \
		$(TARGETS)

#-----------------------------------------------------------------------
bsd43:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		SFILE='s-bsd43.h' \
		$(TARGETS)

#-----------------------------------------------------------------------
freebsd:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		DEFINES='-DHAVE_BCOPY -DHAVE_NEW_BSD -DHAVE_TIME_T -DTMPDIR=\"/var/tmp\" -DHAVE_UNSETENV -DHAVE_VPRINTF' \
		SFILE='s-freebsd.h' \
		LIBS='$(CCMDLIB) -lcurses -lcompat' \
		$(TARGETS)

#-----------------------------------------------------------------------
netbsd:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		DEFINES='-Dunix -DHAVE_BCOPY -DHAVE_NEW_BSD -DHAVE_TIME_T -DTMPDIR=\"/var/tmp\" -DHAVE_UNSETENV -DHAVE_VPRINTF' \
		SFILE='s-netbsd.h' \
		LIBS='$(CCMDLIB) -lcurses -lcompat' \
		$(TARGETS)

#-----------------------------------------------------------------------
openbsd:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		DEFINES='-Dunix -DHAVE_BCOPY -DHAVE_NEW_BSD -DHAVE_TIME_T -DTMPDIR=\"/var/tmp\" -DHAVE_UNSETENV -DHAVE_VPRINTF' \
		SFILE='s-openbsd.h' \
		LIBS='$(CCMDLIB) -lcurses -lcompat' \
		$(TARGETS)
#-----------------------------------------------------------------------
macosx:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		DEFINES='-Dunix -DHAVE_BCOPY -DHAVE_NEW_BSD -DHAVE_TIME_T -DTMPDIR=\"/var/tmp\" -DHAVE_UNSETENV -DHAVE_VPRINTF' \
		SFILE='s-macosx.h' \
		LIBS='$(CCMDLIB) -lcurses' \
		$(TARGETS)

#-----------------------------------------------------------------------
dynix211:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		SFILE='s-dynix211.h' \
		$(TARGETS)

#-----------------------------------------------------------------------
# With c89 (ANSI/ISO Standard C), unix is not defined, but __unix is.
# If _HPUX_SOURCE is not set, <sys/stdsyms.h> undefines unix, even if
# it was set at compile time, sigh...
hpux:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		CC='c89 -D_HPUX_SOURCE -Dunix' \
		SFILE='s-hpux.h' \
		REGEXOBJ="$(REGEXDIR)/regex.o $(REGEXDIR)/test/printchar.o" \
		$(TARGETS)

hpux-gcc:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		CC='gcc -D_HPUX_SOURCE -Dunix' \
		SFILE='s-hpux.h' \
		REGEXOBJ="$(REGEXDIR)/regex.o $(REGEXDIR)/test/printchar.o" \
		$(TARGETS)

hpux11:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		CC='c89 -D_HPUX_SOURCE -Dunix' \
		LIBS='$(CCMDLIB) -lcurses' \
		SFILE='s-hpux.h' \
		REGEXOBJ="$(REGEXDIR)/regex.o $(REGEXDIR)/test/printchar.o" \
		$(TARGETS)

hpux11-gcc:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		CC='gcc -D_HPUX_SOURCE -Dunix' \
		LIBS='$(CCMDLIB) -lcurses' \
		SFILE='s-hpux.h' \
		REGEXOBJ="$(REGEXDIR)/regex.o $(REGEXDIR)/test/printchar.o" \
		$(TARGETS)

#-----------------------------------------------------------------------
isi40:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		SFILE='s-isi40.h' \
		$(TARGETS)

#-----------------------------------------------------------------------
mtxinu43:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		SFILE='s-mtxinu43.h' \
		$(TARGETS)

#-----------------------------------------------------------------------
next:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		CC='cc $(GCCFLAGS)' \
		SFILE='s-next.h' \
		$(TARGETS)

next-gcc:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		CC='gcc $(GCCFLAGS)' \
		SFILE='s-next.h' \
		$(TARGETS)

#-----------------------------------------------------------------------
# This target may be helpful for experimenting with new s-xxx.h files
# e.g. make OS=gnu gnu TARGETS=xxx
$(OS):
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		SFILE='s-$(OS).h' \
		$(TARGETS)

#-----------------------------------------------------------------------
gnu-linux linux:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		LIBS='$(CCMDLIB) -lcurses' \
		CC='gcc $(GCCFLAGS)' \
		DEFINES='-DHAVE_GNU_LINUX -DHAVE_BCOPY -DHAVE_UNSETENV -DHAVE_VPRINTF -D_BSD_SOURCE' \
		SFILE='s-gnulinux.h' \
		$(TARGETS)

#-----------------------------------------------------------------------
# Need -lsun to get networking support (gethostbyname(), et al)
irix4:
	$(MAKE) $(MFLAGS) \
		CC='cc -ansi -Dunix' \
		LIBS='$(CCMDLIB) -lsun -ltermcap' \
		$(COMMON) \
		MACHINE='' \
		SFILE='s-irix-4.h' \
		$(TARGETS)

#-----------------------------------------------------------------------
# Need -lsun to get networking support (gethostbyname(), et al)
irix5:
	$(MAKE) $(MFLAGS) \
		CC='cc -ansi -Dunix' \
		LIBS='$(CCMDLIB) -lsun -ltermcap' \
		$(COMMON) \
		MACHINE='' \
		SFILE='s-irix-5.h' \
		$(TARGETS)

#-----------------------------------------------------------------------
# Need -lsun to get networking support (gethostbyname(), et al)
irix6:
	$(MAKE) $(MFLAGS) \
		CC='cc -ansi -Dunix' \
		LIBS='$(CCMDLIB) -lsun -ltermcap' \
		$(COMMON) \
		MACHINE='' \
		SFILE='s-irix-6.h' \
		$(TARGETS)

#-----------------------------------------------------------------------
osf1:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		CC='c89 -std1' \
		LIBS='$(CCMDLIB) -lbsd -ltermcap' \
		MACHINE='-DBSD=198911' \
		SFILE='s-osf1.h' \
		$(TARGETS)

osf1-4:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		CC='c89 -std1' \
		LIBS='$(CCMDLIB) -lbsd -ltermcap' \
		MACHINE='-DBSD=198911' \
		SFILE='s-osf1-4.h' \
		$(TARGETS)

osf1-5:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		CC='c89 -std1' \
		LIBS='$(CCMDLIB) -lbsd -ltermcap' \
		MACHINE='-DBSD=198911' \
		SFILE='s-osf1-5.h' \
		$(TARGETS)

osf1-c++:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		CC='cxx -x cxx' \
		LIBS='$(CCMDLIB) -lbsd -ltermcap' \
		MACHINE='-DBSD=198911' \
		SFILE='s-osf1.h' \
		$(TARGETS)

# NB: Must define both _OSF_SOURCE and _POSIX_SOURCE on command-line,
# instead of in s-osf1-posix.h, because the latter is not included
# early enough to get symbols other in other system header files
# defined.
osf1-posix:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		CC='c89 -std1' \
		LIBS='$(CCMDLIB) -lbsd -ltermcap' \
		MACHINE='-DBSD=198911 -D_OSF_SOURCE -D_POSIX_SOURCE' \
		SFILE='s-osf1-posix.h' \
		$(TARGETS)

#-----------------------------------------------------------------------
# NB: The long LIBS list arises because mm is compiled in the pure
# Solaris 2.x environment (System V R4), while ccmd still needs
# sigsetmask() and sigblock() from the Berkeley environment.  It is
# important to load -lc before libucb.a, so as to avoid conflicts
# between identically named routines in the two libc.a libraries.

SOLARIS-LIBS	= $(CCMDLIB) -lnsl -ltermcap -ldl -lc /usr/ucblib/libucb.a

SOLARIS-COMMON	= LDFLAGS='$(DEBUG)' \
		  LIBS='$(SOLARIS-LIBS)' \
		  LINTFLAGS='$(LINTFLAGS) -Xc' \
		  LINTSRCS='$(LINTSRCS)' \
		  MACHINE=' ' \
		  OPT='$(OPT)' \
		  SFILE='s-sun50.h' \
		  USAGE='-DUSAGE'

SOLARIS10-COMMON = LDFLAGS='$(DEBUG)' \
		  LIBS='$(CCMDLIB) -lnsl -ltermcap -ldl -lc' \
		  LINTFLAGS='$(LINTFLAGS) -Xc' \
		  LINTSRCS='$(LINTSRCS)' \
		  MACHINE=' ' \
		  OPT='$(OPT)' \
		  SFILE='s-sun50.h' \
		  USAGE='-DUSAGE'

solaris10:
	$(MAKE) $(MFLAGS) \
		CC='cc -Xc' \
		CCM='cc -Xc -xM1' DEPENDSFILTER='cat' \
		$(SOLARIS10-COMMON) \
		$(TARGETS)

solaris solaris2.3 solaris2.4 solaris2.x:
	$(MAKE) $(MFLAGS) \
		CC='cc -Xc' \
		CCM='cc -Xc -xM1' DEPENDSFILTER='cat' \
		$(SOLARIS-COMMON) \
		$(TARGETS)

sunos5.3:
	$(MAKE) $(MFLAGS) \
		CC='cc' \
		CCM='cc -xM1' DEPENDSFILTER='cat' \
		LDFLAGS='$(DEBUG) -g' \
		LIBS='$(CCMDLIB) -lnsl -ltermcap' \
		LINTFLAGS='$(LINTFLAGS) -Xc' \
		LINTSRCS='$(LINTSRCS)' \
		MACHINE=' ' \
		OPT='$(OPT)' \
		SFILE='s-sun50.h' \
		USAGE='-DUSAGE' \
		$(TARGETS)

solaris2.1 solaris2.2:
	@echo "************************************************************"
	@echo "* NB: ignore                                               *"
	@echo "*      ld: warning: file /usr/lib/libc.so: attempted       *"
	@echo "*      multiple inclusion of file libc.so                  *"
	@echo "************************************************************"
	$(MAKE) $(MFLAGS) \
		CC='cc -Xc' \
		CCM='cc -Xc -xM1' DEPENDSFILTER='cat' \
		$(SOLARIS-COMMON) \
		$(TARGETS)

solaris-c++ solaris2.3-c++:
	$(MAKE) $(MFLAGS) \
		CC='CC' \
		CCM='cc -Xc -xM1' DEPENDSFILTER='cat' \
		$(SOLARIS-COMMON) \
		$(TARGETS)

solaris-gcc solaris2.3-gcc:
	$(MAKE) $(MFLAGS) \
		CC='gcc $(GCCFLAGS)' \
		$(SOLARIS-COMMON) \
		$(TARGETS)

solaris2.2-gcc:
	@echo "************************************************************"
	@echo "* NB: ignore                                               *"
	@echo "*      warning: file /usr/lib/libc.so: attempted multiple  *"
	@echo "*      inclusion of file libc.so                           *"
	@echo "************************************************************"
	$(MAKE) $(MFLAGS) \
		CC='gcc $(GCCFLAGS)' \
		$(SOLARIS-COMMON) \
		$(TARGETS)

#-----------------------------------------------------------------------
SUNOS-CC	= CC='cc -Dconst=' \
		  CCM='cc -Xc -xM1'

SUNOS-COMMON	= DEPENDSFILTER='cat' \
		  LDFLAGS='$(DEBUG)' \
		  LIBS='$(CCMDLIB) -ltermcap' \
		  LINTFLAGS='$(LINTFLAGS)' \
		  LINTSRCS='$(LINTSRCS)' \
		  MACHINE='' \
		  OPT='$(OPT)' \
		  USAGE='-DUSAGE'

sunos3.4:
	$(MAKE) $(MFLAGS) $(SUNOS-CC) $(SUNOS-COMMON) \
		SFILE='s-sun34.h' \
		$(TARGETS)
sunos3.5:
	$(MAKE) $(MFLAGS) $(SUNOS-CC) $(SUNOS-COMMON) \
		SFILE='s-sun35.h' \
		$(TARGETS)

sunos sunos4.x:
	$(MAKE) $(MFLAGS) $(SUNOS-CC) $(SUNOS-COMMON) \
		SFILE='s-sun40.h' \
		$(TARGETS)

#-----------------------------------------------------------------------
sysv3b2:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		SFILE='s-sysv3b2.h' \
		$(TARGETS)

#-----------------------------------------------------------------------
sysv52:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		SFILE='s-sysv52.h' \
		$(TARGETS)

#-----------------------------------------------------------------------
ultrix20:
	$(MAKE) $(MFLAGS) \
		$(COMMON)
		SFILE='s-ultrix20.h' \
		$(TARGETS)

#-----------------------------------------------------------------------
ultrix40 ultrix41 ultrix42 ultrix ultrix4x:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		CC='cc -Dconst=' \
		SFILE='s-ultrix40.h' \
		$(TARGETS)

#-----------------------------------------------------------------------
umaxv:
	$(MAKE) $(MFLAGS) \
		$(COMMON) \
		SFILE='s-umaxv.h' \
		$(TARGETS)

#=======================================================================
# File dependencies generated by "make depends" and inserted manually;
# automatic schemes risk corrupting, or destroying the Makefile, and
# anyway, this job needs to be done only very rarely.  Unfortunately,
# not all UNIX makes support a uniform include directive.  System
# header files are intentionally excluded from the dependency lists,
# to enhance the portability of this Makefile.  These lists should not
# require changes unless #include statements in the source code have
# been altered.

action.o:         $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/cmfncs.h $(CCMD)/datime.h  \
                  action.c         acttab.h         address.h         \
                  args.h           chartype.h       compat.h          \
                  config.h         extern.h         keytab.h          \
                  mm.h             osfiles.h        parse.h           \
                  pathnames.h      $(SFILE)         seq.h

address.o:        $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.c         \
                  address.h        args.h           chartype.h        \
                  compat.h         config.h         extern.h          \
                  keytab.h         mm.h             osfiles.h         \
                  pathnames.h      $(SFILE)         seq.h

alias.o:          $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  alias.c          args.h           chartype.h        \
                  compat.h         config.h         extern.h          \
                  keytab.h         mm.h             osfiles.h         \
                  parse.h          pathnames.h      $(SFILE)          \
                  seq.h

argsort.o:        args.h           argsort.c

babyl.o:          address.h        args.h           babyl.c           \
                  babyl.h          chartype.h       compat.h          \
                  config.h         extern.h         mm.h              \
                  osfiles.h        pathnames.h      rd.h              \
                  $(SFILE)         seq.h

browse.o:         $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           browse.c         chartype.h        \
                  cmds.h           compat.h         config.h          \
                  extern.h         keytab.h         mm.h              \
                  osfiles.h        parse.h          pathnames.h       \
                  $(SFILE)         seq.h

buildhelp.o:      args.h           buildhelp.c      compat.h          \
                  config.h         help.h           osfiles.h         \
                  $(SFILE)

cmds.o:           $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       cmds.c            \
                  cmds.h           compat.h         config.h          \
                  extern.h         keytab.h         mm.h              \
                  osfiles.h        parse.h          pathnames.h       \
                  rd.h             $(SFILE)         seq.h

compat.o:         args.h           compat.c         compat.h          \
                  config.h         osfiles.h        $(SFILE)

dates.o:          address.h        args.h           chartype.h        \
                  compat.h         config.h         dates.c           \
                  extern.h         mm.h             osfiles.h         \
                  pathnames.h      $(SFILE)         seq.h

debug.o:          args.h           compat.h         config.h          \
                  debug.c          osfiles.h        $(SFILE)

display.o:        $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       cmds.h            \
                  compat.h         config.h         display.c         \
                  extern.h         keytab.h         message.h         \
                  mm.h             osfiles.h        parse.h           \
                  pathnames.h      $(SFILE)         seq.h

doinit.o:         $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       compat.h          \
                  config.h         doinit.c         extern.h          \
                  keytab.h         mm.h             osfiles.h         \
                  parse.h          pathnames.h      $(SFILE)          \
                  seq.h            set.h

dt.o:             $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       compat.h          \
                  config.h         dt.c             extern.h          \
                  keytab.h         mm.h             osfiles.h         \
                  pathnames.h      $(SFILE)         seq.h

edit.o:           $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       compat.h          \
                  config.h         edit.c           extern.h          \
                  keytab.h         message.h        mm.h              \
                  osfiles.h        pathnames.h      rd.h              \
                  $(SFILE)         seq.h

exit.o:           $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       cmds.h            \
                  compat.h         config.h         exit.c            \
                  extern.h         keytab.h         mm.h              \
                  osfiles.h        parse.h          pathnames.h       \
                  $(SFILE)         seq.h

file.o:           $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       cmds.h            \
                  compat.h         config.h         extern.h          \
                  file.c           keytab.h         mm.h              \
                  osfiles.h        parse.h          pathnames.h       \
                  rd.h             $(SFILE)         seq.h

formattab.o:      $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       compat.h          \
                  config.h         extern.h         formattab.c       \
                  keytab.h         mm.h             osfiles.h         \
                  parse.h          pathnames.h      rd.h              \
                  $(SFILE)         seq.h

getmail.o:        args.h           compat.h         config.h          \
                  getmail.c        osfiles.h        $(SFILE)

headers.o:        $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       compat.h          \
                  config.h         extern.h         headers.c         \
                  keytab.h         mm.h             osfiles.h         \
                  parse.h          pathnames.h      $(SFILE)          \
                  seq.h

help.o:           $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       cmds.h            \
                  compat.h         config.h         extern.h          \
                  help.c           help.h           keytab.h          \
                  mm.h             osfiles.h        parse.h           \
                  pathnames.h      $(SFILE)         seq.h             \
                  set.h

hname.o:          address.h        args.h           chartype.h        \
                  compat.h         config.h         extern.h          \
                  hname.c          mm.h             osfiles.h         \
                  pathnames.h      $(SFILE)         seq.h

init.o:           $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       cmds.h            \
                  compat.h         config.h         extern.h          \
                  init.c           keytab.h         mm.h              \
                  osfiles.h        parse.h          pathnames.h       \
                  $(SFILE)         seq.h            set.h

keywords.o:       $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       compat.h          \
                  config.h         extern.h         keytab.h          \
                  keywords.c       message.h        mm.h              \
                  osfiles.h        parse.h          pathnames.h       \
                  rd.h             $(SFILE)         seq.h

localfile.o:      localfile.c

mailrc.o:         address.h        args.h           chartype.h        \
                  compat.h         config.h         extern.h          \
                  mailrc.c         mm.h             osfiles.h         \
                  pathnames.h      $(SFILE)         seq.h

mailtypes.o:      address.h        args.h           chartype.h        \
                  compat.h         config.h         extern.h          \
                  mailtypes.c      mm.h             osfiles.h         \
                  pathnames.h      rd.h             $(SFILE)          \
                  seq.h

mbox.o:           address.h        args.h           chartype.h        \
                  compat.h         config.h         extern.h          \
                  mbox.c           mm.h             osfiles.h         \
                  pathnames.h      rd.h             $(SFILE)          \
                  seq.h

mh.o:             address.h        args.h           chartype.h        \
                  compat.h         config.h         extern.h          \
                  mh.c             mm.h             osfiles.h         \
                  pathnames.h      $(SFILE)         seq.h

misc.o:           $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       compat.h          \
                  config.h         extern.h         help.h            \
                  keytab.h         misc.c           mm.h              \
                  osfiles.h        parse.h          pathnames.h       \
                  rd.h             $(SFILE)         seq.h

mkversion.o:      args.h           compat.h         config.h          \
                  mkversion.c      mm-patchlevel.h  osfiles.h         \
                  $(SFILE)

mm-trans.o:       args.h           compat.h         config.h          \
                  mm-trans.c       osfiles.h        $(SFILE)

mm.o:             $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h acttab.h          \
                  address.h        args.h           chartype.h        \
                  cmds.h           compat.h         config.h          \
                  extern.h         keytab.h         mm.c              \
                  mm.h             osfiles.h        parse.h           \
                  pathnames.h      $(SFILE)         seq.h             \
                  set.h

more.o:           $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       compat.h          \
                  config.h         extern.h         keytab.h          \
                  mm.h             more.c           osfiles.h         \
                  parse.h          pathnames.h      $(SFILE)          \
                  seq.h

move.o:           $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       cmds.h            \
                  compat.h         config.h         extern.h          \
                  keytab.h         mm.h             move.c            \
                  osfiles.h        parse.h          pathnames.h       \
                  rd.h             $(SFILE)         seq.h

movemail.o:       args.h           compat.h         config.h          \
                  movemail.c       osfiles.h        $(SFILE)

mtxt.o:           address.h        args.h           chartype.h        \
                  compat.h         config.h         extern.h          \
                  mm.h             mtxt.c           osfiles.h         \
                  pathnames.h      rd.h             $(SFILE)          \
                  seq.h

newmail.o:        $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       cmds.h            \
                  compat.h         config.h         extern.h          \
                  keytab.h         mm.h             newmail.c         \
                  osfiles.h        parse.h          pathnames.h       \
                  rd.h             $(SFILE)         seq.h

novice.o:         $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       compat.h          \
                  config.h         extern.h         keytab.h          \
                  mm.h             novice.c         osfiles.h         \
                  parse.h          pathnames.h      $(SFILE)          \
                  seq.h

parse.o:          $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       compat.h          \
                  config.h         extern.h         keytab.h          \
                  mm.h             osfiles.h        parse.c           \
                  parse.h          pathnames.h      $(SFILE)          \
                  seq.h

parsemsg.o:       $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       cmds.h            \
                  compat.h         config.h         extern.h          \
                  keytab.h         message.h        mm.h              \
                  osfiles.h        parse.h          parsemsg.c        \
                  pathnames.h      $(SFILE)         seq.h

pop2.o:           address.h        args.h           chartype.h        \
                  compat.h         config.h         extern.h          \
                  mm.h             osfiles.h        pathnames.h       \
                  pop2.c           $(SFILE)         seq.h

pop3.o:           address.h        args.h           chartype.h        \
                  compat.h         config.h         extern.h          \
                  mm.h             osfiles.h        pathnames.h       \
                  pop3.c           $(SFILE)         seq.h

prepatch.o:       args.h           compat.h         config.h          \
                  osfiles.h        prepatch.c       $(SFILE)

print.o:          $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       cmds.h            \
                  compat.h         config.h         extern.h          \
                  keytab.h         mm.h             osfiles.h         \
                  parse.h          pathnames.h      print.c           \
                  $(SFILE)         seq.h

prof-formattab.o: $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       compat.h          \
                  config.h         extern.h         formattab.c       \
                  keytab.h         mm.h             osfiles.h         \
                  parse.h          pathnames.h      prof-formattab.c  \
                  rd.h             $(SFILE)         seq.h

rd.o:             $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       compat.h          \
                  config.h         extern.h         keytab.h          \
                  mm.h             osfiles.h        parse.h           \
                  pathnames.h      rd.c             rd.h              \
                  $(SFILE)         seq.h

read.o:           $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       cmds.h            \
                  compat.h         config.h         extern.h          \
                  keytab.h         mm.h             osfiles.h         \
                  parse.h          pathnames.h      read.c            \
                  $(SFILE)         seq.h

send.o:           $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       cmds.h            \
                  compat.h         config.h         extern.h          \
                  keytab.h         message.h        mm.h              \
                  osfiles.h        parse.h          pathnames.h       \
                  $(SFILE)         send.c           seq.h

sendcmds.o:       $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       cmds.h            \
                  compat.h         config.h         extern.h          \
                  keytab.h         message.h        mm.h              \
                  osfiles.h        parse.h          pathnames.h       \
                  $(SFILE)         sendcmds.c       seq.h

sendmail.o:       $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       compat.h          \
                  config.h         extern.h         keytab.h          \
                  message.h        mm.h             osfiles.h         \
                  parse.h          pathnames.h      rd.h              \
                  $(SFILE)         sendmail.c       seq.h

seq.o:            $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       compat.h          \
                  config.h         extern.h         keytab.h          \
                  mm.h             osfiles.h        parse.h           \
                  pathnames.h      $(SFILE)         seq.c             \
                  seq.h

set.o:            $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       cmds.h            \
                  compat.h         config.h         extern.h          \
                  keytab.h         mm.h             osfiles.h         \
                  parse.h          pathnames.h      $(SFILE)          \
                  seq.h            set.c            set.h

signals.o:        address.h        args.h           chartype.h        \
                  compat.h         config.h         extern.h          \
                  mm.h             osfiles.h        pathnames.h       \
                  $(SFILE)         seq.h            signals.c

support.o:        $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       compat.h          \
                  config.h         extern.h         keytab.h          \
                  mm.h             osfiles.h        pathnames.h       \
                  $(SFILE)         seq.h            support.c

sys-prof.o:       $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           chartype.h       compat.h          \
                  config.h         extern.h         keytab.h          \
                  mm-patchlevel.h  mm.h             osfiles.h         \
                  pathnames.h      $(SFILE)         seq.h             \
                  set.h            sys-prof.c       version.h

token.o:          address.h        args.h           chartype.h        \
                  compat.h         config.h         extern.h          \
                  mm.h             osfiles.h        pathnames.h       \
                  $(SFILE)         seq.h            token.c           \
                  token.h

usage.o:          args.h           usage.c

version.o:        $(CCMD)/args.h   $(CCMD)/ccmd.h   $(CCMD)/ccmdmd.h  \
                  $(CCMD)/cmfnc.h  $(CCMD)/datime.h address.h         \
                  args.h           babyl.h          chartype.h        \
                  cmds.h           compat.h         config.h          \
                  extern.h         help.h           keytab.h          \
                  message.h        mm-patchlevel.h  mm.h              \
                  osfiles.h        parse.h          pathnames.h       \
                  rd.h             $(SFILE)         seq.h             \
                  set.h            version.c        version.h

whoami.o:         args.h           compat.h         config.h          \
                  osfiles.h        $(SFILE)         whoami.c

whobuilt.o:       whobuilt.c

#=======================================================================
