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 NEC EWS-UX/V 4.2
9#
10#	@(#)Makefile.EWS-UX_V	8.2 (Berkeley) 05/24/95
11#
12
13# use O=-O (usual) or O=-g (debugging)
14O=	-O
15
16# make sure that /bin/cc is used (do not use /usr/ucb/cc).
17#CC=	/bin/cc
18CC=	/usr/abiccs/bin/cc
19
20# define the database mechanism used for alias lookups:
21#	-DNDBM -- use new DBM
22#	-DNEWDB -- use new Berkeley DB
23#	-DNIS -- include NIS support
24# The really old (V7) DBM library is no longer supported.
25# See READ_ME for a description of how these flags interact.
26#
27DBMDEF=	-DNDBM -DNIS
28
29# environment definitions (e.g., -D_AIX3)
30ENVDEF=	-Dnec_ews_svr4 -KOlimit=900
31
32# see also conf.h for additional compilation flags
33
34# include directories
35INCDIRS=-I/usr/sww/include
36
37# library directories
38LIBDIRS=-L/usr/sww/lib
39
40# libraries required on your system
41#  delete -l44bsd if you are not running BIND 4.9.x
42LIBS=	ndbm.o -lsocket -lnsl -lelf -lresolv # -l44bsd # with NDBM
43#LIBS=	-lsocket -lnsl -lelf -ldb -lresolv # -l44bsd   # with NEWDB
44
45# location of sendmail binary (usually /usr/sbin or /usr/lib)
46BINDIR=	${DESTDIR}/usr/ucblib
47
48# location of sendmail.st file (usually /var/log or /usr/lib)
49STDIR=	${DESTDIR}/var/ucblib
50
51# location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
52HFDIR=	${DESTDIR}/var/ucblib
53
54# additional .o files needed
55OBJADD=
56
57# things to be made before compilation begins
58BEFORE=	sysexits.h ndbm.h ndbm.o
59
60###################  end of user configuration flags  ######################
61
62CFLAGS=	-I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
63
64OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
65	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
66	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
67	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
68	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
69
70LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
71BINOWN=	root
72BINGRP=	sys
73BINMODE=6555
74INSTALL=/usr/ucb/install
75
76ALL=	sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
77
78all: ${ALL}
79
80sendmail: ${BEFORE} ${OBJS}
81	${CC} -o sendmail ${OBJS} ${LIBDIRS} ${LIBS}
82
83sysexits.h:
84	echo '#ifndef _LOCAL_SYSEXITS_H_' > sysexits.h;
85	echo '#define _LOCAL_SYSEXITS_H_' >> sysexits.h;
86	cat /usr/abiccs/ucbinclude/sysexits.h >> sysexits.h;
87	echo '#endif /* _LOCAL_SYSEXITS_H_ */' >> sysexits.h;
88#	ln -s /usr/abiccs/ucbinclude/sysexits.h .
89
90ndbm.h:
91	ln -s /usr/abiccs/ucbinclude/ndbm.h .
92
93ndbm.o:
94	ar x /usr/abiccs/ucblib/libucb.a ndbm.o
95#	ar x /usr/ucblib/libucb.a ndbm.o
96
97#NROFF=	nroff -h
98NROFF=	groff -Tascii
99MANDOC=	-mandoc
100
101aliases.0: aliases.5
102	${NROFF} ${MANDOC} aliases.5 > aliases.0
103
104mailq.0: mailq.1
105	${NROFF} ${MANDOC} mailq.1 > mailq.0
106
107newaliases.0: newaliases.1
108	${NROFF} ${MANDOC} newaliases.1 > newaliases.0
109
110sendmail.0: sendmail.8
111	${NROFF} ${MANDOC} sendmail.8 > sendmail.0
112
113install: install-sendmail install-docs
114
115install-sendmail: sendmail
116	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
117	for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
118	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
119	    ${STDIR}/sendmail.st
120	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
121
122# doesn't actually install them -- you may want to install pre-nroff versions
123install-docs: aliases.0 mailq.0 newaliases.0 sendmail.0
124
125clean:
126	rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
127
128# dependencies
129#   gross overkill, and yet still not quite enough....
130${OBJS}: sendmail.h conf.h
131