1#
2#  This Makefile is designed to work on the old "make" program.  It does
3#  not use the obj subdirectory.  It also does not install documentation
4#  automatically -- think of it as a quick start for sites that have the
5#  old make program (I recommend that you get and port the new make if you
6#  are going to be doing any signficant work on sendmail).
7#
8#  This has been tested on NEXTSTEP 3.3.
9#
10#	@(#)Makefile.NEXTSTEP	8.2 (Berkeley) 06/20/95
11#
12
13# use O=-O (usual) or O=-g (debugging)
14O=	-O
15
16# NEXTSTEP 3.1 and 3.2 only support m68k and i386
17ARCH=	-arch m68k -arch i386 -arch hppa -arch sparc
18#ARCH=	-arch m68k -arch i386
19
20COPTS=	-Wno-precomp
21
22# define the database mechanisms available for map & alias lookups:
23#	-DNDBM -- use new DBM
24#	-DNEWDB -- use new Berkeley DB
25#	-DNIS -- include NIS support
26# The really old (V7) DBM library is no longer supported.
27# See READ_ME for a description of how these flags interact.
28#
29DBMDEF=	-DNDBM -DNIS -DNETINFO
30#DBMDEF=	-DNDBM -DNEWDB -DNIS -DNETINFO
31
32# environment definitions (e.g., -D_AIX3)
33ENVDEF=	-DNeXT
34
35# see also conf.h for additional compilation flags
36
37# include directories
38INCDIRS=-I/usr/local/include
39
40# library directories
41LIBDIRS=-L/usr/local/lib
42
43# libraries required on your system
44LIBS=	-ldbm
45#LIBS=	-ldbm -ldb
46
47# location of sendmail binary (usually /usr/sbin or /usr/lib)
48BINDIR=	${DESTDIR}/usr/lib
49
50# location of sendmail.st file (usually /var/log or /usr/lib)
51STDIR=	${DESTDIR}/etc/sendmail
52
53# location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
54HFDIR=	${DESTDIR}/usr/lib
55
56# additional .o files needed
57OBJADD=
58
59# additional pseudo-sources needed
60BEFORE=	unistd.h dirent.h
61
62###################  end of user configuration flags  ######################
63
64CFLAGS=	-I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF} ${COPTS} ${ARCH}
65
66OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
67	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
68	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
69	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
70	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
71
72LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
73BINOWN=	root
74BINGRP=	kmem
75BINMODE=6555
76
77ALL=	sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
78
79all: ${ALL}
80
81sendmail: ${BEFORE} ${OBJS}
82	${CC} ${ARCH} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
83
84unistd.h:
85	cp /dev/null unistd.h
86
87dirent.h:
88	echo "#include <sys/dir.h>" > dirent.h
89	echo "#define dirent	direct" >> dirent.h
90
91#NROFF=	nroff -h
92NROFF=	groff -Tascii
93MANDOC=	-mandoc
94
95aliases.0: aliases.5
96	${NROFF} ${MANDOC} aliases.5 > aliases.0
97
98mailq.0: mailq.1
99	${NROFF} ${MANDOC} mailq.1 > mailq.0
100
101newaliases.0: newaliases.1
102	${NROFF} ${MANDOC} newaliases.1 > newaliases.0
103
104sendmail.0: sendmail.8
105	${NROFF} ${MANDOC} sendmail.8 > sendmail.0
106
107install: install-sendmail install-docs
108
109install-sendmail: sendmail
110	install -s -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
111	for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
112	cp /dev/null  ${STDIR}/sendmail.st
113	chown ${BINOWN}.${BINGRP} ${STDIR}/sendmail.st
114	chmod 644 ${STDIR}/sendmail.st
115	install -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
116
117# doesn't actually install them -- you may want to install pre-nroff versions
118install-docs: aliases.0 mailq.0 newaliases.0 sendmail.0
119
120clean:
121	rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
122
123# dependencies
124#   gross overkill, and yet still not quite enough....
125${OBJS}: sendmail.h conf.h
126
127depend:
128