169455Seric#
269455Seric#  This Makefile is designed to work on the old "make" program.  It does
369455Seric#  not use the obj subdirectory.  It also does not install documentation
469455Seric#  automatically -- think of it as a quick start for sites that have the
569455Seric#  old make program (I recommend that you get and port the new make if you
669455Seric#  are going to be doing any signficant work on sendmail).
769455Seric#
8*69943Seric#	@(#)Makefile.LUNA	8.4 (Berkeley) 06/20/95
969455Seric#
1069455Seric
1169455Seric# use O=-O (usual) or O=-g (debugging)
1269455SericO=	-O
1369455Seric
1469455Seric# define the database mechanisms available for map & alias lookups:
1569455Seric#	-DNDBM -- use new DBM
1669455Seric#	-DNEWDB -- use new Berkeley DB
1769455Seric#	-DNIS -- include NIS support
1869455Seric# The really old (V7) DBM library is no longer supported.
1969455Seric# See READ_ME for a description of how these flags interact.
2069455Seric#
2169455SericDBMDEF=	-DNDBM
2269455Seric
2369455Seric# environment definitions (e.g., -D_AIX3)
2469455SericENVDEF=
2569455Seric
2669455Seric# see also conf.h for additional compilation flags
2769455Seric
2869455Seric# include directories
2969455SericINCDIRS=-I/usr/sww/include
3069455Seric
3169455Seric# loader options
3269455SericLDOPTS=
3369455Seric
3469455Seric# library directories
3569455SericLIBDIRS=-L/usr/sww/lib
3669455Seric
3769455Seric# libraries required on your system
3869455SericLIBS=
3969455Seric
4069455Seric# location of sendmail binary (usually /usr/sbin or /usr/lib)
4169455SericBINDIR=	${DESTDIR}/usr/lib
4269455Seric
4369455Seric# location of sendmail.st file (usually /var/log or /usr/lib)
4469455SericSTDIR=	${DESTDIR}/usr/lib
4569455Seric
4669455Seric# location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
4769455SericHFDIR=	${DESTDIR}/usr/lib
4869455Seric
4969455Seric# additional .o files needed
5069455SericOBJADD=
5169455Seric
5269455Seric# additional pseudo-sources needed
5369647SericBEFORE= dirent.h stddef.h stdlib.h unistd.h limits.h time.h sys/time.h
5469455Seric
5569455Seric###################  end of user configuration flags  ######################
5669455Seric
5769455SericCFLAGS=	-I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
5869455Seric
5969455SericOBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
6069455Seric	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
6169455Seric	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
6269455Seric	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
6369455Seric	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
6469455Seric
6569455SericLINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
6669455SericBINOWN=	root
6769455SericBINGRP=	kmem
6869455SericBINMODE=6555
6969455Seric
7069455SericALL=	sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
7169455Seric
7269455Sericall: ${ALL}
7369455Seric
7469455Sericsendmail: ${BEFORE} ${OBJS}
7569455Seric	${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
7669455Seric
7769455Sericdirent.h:
7869455Seric	echo "#include <sys/dir.h>" > dirent.h
7969455Seric	echo "#define dirent    direct" >> dirent.h
8069455Seric
8169752Sericstddef.h unistd.h limits.h:
8269455Seric	if [ -f /usr/include/$@ ]; then \
8369455Seric		ln -s /usr/include/$@ .; \
8469455Seric	else \
8569455Seric		cp /dev/null $@; \
8669455Seric	fi
8769455Seric
8869752Sericstdlib.h:
8969752Seric	if [ -f /usr/include/stdlib.h ]; then \
9069752Seric		ln -s /usr/include/stdlib.h .; \
9169752Seric	else \
9269752Seric		if [ -f /usr/include/libc.h ]; then \
9369752Seric			ln -s /usr/include/libc.h stdlib.h; \
9469752Seric		else \
9569752Seric			cp /dev/null stdlib.h; \
9669752Seric		fi; \
9769752Seric	fi
9869752Seric
9969455Seric# just for UNIOS-B
10069455Serictime.h:
10169455Seric	echo "#ifndef _LOCAL_TIME_H_" > time.h
10269455Seric	echo "#define _LOCAL_TIME_H_" >> time.h
10369455Seric	cat /usr/include/time.h >> time.h
10469455Seric	echo "#endif" >> time.h
10569455Seric
10669647Sericsys/time.h:
10769647Seric	-mkdir sys
10869647Seric	echo "#ifndef _LOCAL_SYS_TIME_H_" > sys/time.h
10969647Seric	echo "#define _LOCAL_SYS_TIME_H_" >> sys/time.h
11069647Seric	cat /usr/include/sys/time.h >> sys/time.h
11169647Seric	echo "#endif" >> sys/time.h
11269647Seric
11369455SericNROFF=	nroff -h
11469455Seric
11569455Sericaliases.0: aliases.5
11669455Seric	${NROFF} -mandoc aliases.5 > aliases.0
11769455Seric
11869455Sericmailq.0: mailq.1
11969455Seric	${NROFF} -mandoc mailq.1 > mailq.0
12069455Seric
12169455Sericnewaliases.0: newaliases.1
12269455Seric	${NROFF} -mandoc newaliases.1 > newaliases.0
12369455Seric
12469455Sericsendmail.0: sendmail.8
12569455Seric	${NROFF} -mandoc sendmail.8 > sendmail.0
12669455Seric
12769455SericINSTALL=install
12869455Seric
12969455Sericinstall: install-sendmail install-docs
13069455Seric
13169455Sericinstall-sendmail: sendmail
13269455Seric	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
13369455Seric	for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
13469455Seric	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
13569455Seric	    ${STDIR}/sendmail.st
13669455Seric	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
13769455Seric
13869455Seric# doesn't actually install them -- you may want to install pre-nroff versions
13969455Sericinstall-docs: aliases.0 mailq.0 newaliases.0 sendmail.0
14069455Seric
14169455Sericclean:
14269455Seric	rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
14369455Seric
14469455Seric# dependencies
14569455Seric#   gross overkill, and yet still not quite enough....
14669455Seric${OBJS}: sendmail.h conf.h
147*69943Seric
148*69943Sericdepend:
149