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#	@(#)Makefile.LUNA	8.3 (Berkeley) 05/29/95
9#
10
11# use O=-O (usual) or O=-g (debugging)
12O=	-O
13
14# define the database mechanisms available for map & alias lookups:
15#	-DNDBM -- use new DBM
16#	-DNEWDB -- use new Berkeley DB
17#	-DNIS -- include NIS support
18# The really old (V7) DBM library is no longer supported.
19# See READ_ME for a description of how these flags interact.
20#
21DBMDEF=	-DNDBM
22
23# environment definitions (e.g., -D_AIX3)
24ENVDEF=
25
26# see also conf.h for additional compilation flags
27
28# include directories
29INCDIRS=-I/usr/sww/include
30
31# loader options
32LDOPTS=
33
34# library directories
35LIBDIRS=-L/usr/sww/lib
36
37# libraries required on your system
38LIBS=
39
40# location of sendmail binary (usually /usr/sbin or /usr/lib)
41BINDIR=	${DESTDIR}/usr/lib
42
43# location of sendmail.st file (usually /var/log or /usr/lib)
44STDIR=	${DESTDIR}/usr/lib
45
46# location of sendmail.hf file (usually /usr/share/misc or /usr/lib)
47HFDIR=	${DESTDIR}/usr/lib
48
49# additional .o files needed
50OBJADD=
51
52# additional pseudo-sources needed
53BEFORE= dirent.h stddef.h stdlib.h unistd.h limits.h time.h sys/time.h
54
55###################  end of user configuration flags  ######################
56
57CFLAGS=	-I. $O ${INCDIRS} ${DBMDEF} ${ENVDEF}
58
59OBJS=	alias.o arpadate.o clock.o collect.o conf.o convtime.o daemon.o \
60	deliver.o domain.o envelope.o err.o headers.o macro.o main.o \
61	map.o mci.o mime.o parseaddr.o queue.o readcf.o recipient.o \
62	savemail.o srvrsmtp.o stab.o stats.o sysexits.o \
63	trace.o udb.o usersmtp.o util.o version.o ${OBJADD}
64
65LINKS=	${DESTDIR}/usr/ucb/newaliases ${DESTDIR}/usr/ucb/mailq
66BINOWN=	root
67BINGRP=	kmem
68BINMODE=6555
69
70ALL=	sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
71
72all: ${ALL}
73
74sendmail: ${BEFORE} ${OBJS}
75	${CC} -o sendmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
76
77dirent.h:
78	echo "#include <sys/dir.h>" > dirent.h
79	echo "#define dirent    direct" >> dirent.h
80
81stddef.h unistd.h limits.h:
82	if [ -f /usr/include/$@ ]; then \
83		ln -s /usr/include/$@ .; \
84	else \
85		cp /dev/null $@; \
86	fi
87
88stdlib.h:
89	if [ -f /usr/include/stdlib.h ]; then \
90		ln -s /usr/include/stdlib.h .; \
91	else \
92		if [ -f /usr/include/libc.h ]; then \
93			ln -s /usr/include/libc.h stdlib.h; \
94		else \
95			cp /dev/null stdlib.h; \
96		fi; \
97	fi
98
99# just for UNIOS-B
100time.h:
101	echo "#ifndef _LOCAL_TIME_H_" > time.h
102	echo "#define _LOCAL_TIME_H_" >> time.h
103	cat /usr/include/time.h >> time.h
104	echo "#endif" >> time.h
105
106sys/time.h:
107	-mkdir sys
108	echo "#ifndef _LOCAL_SYS_TIME_H_" > sys/time.h
109	echo "#define _LOCAL_SYS_TIME_H_" >> sys/time.h
110	cat /usr/include/sys/time.h >> sys/time.h
111	echo "#endif" >> sys/time.h
112
113NROFF=	nroff -h
114
115aliases.0: aliases.5
116	${NROFF} -mandoc aliases.5 > aliases.0
117
118mailq.0: mailq.1
119	${NROFF} -mandoc mailq.1 > mailq.0
120
121newaliases.0: newaliases.1
122	${NROFF} -mandoc newaliases.1 > newaliases.0
123
124sendmail.0: sendmail.8
125	${NROFF} -mandoc sendmail.8 > sendmail.0
126
127INSTALL=install
128
129install: install-sendmail install-docs
130
131install-sendmail: sendmail
132	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} sendmail ${BINDIR}
133	for i in ${LINKS}; do rm -f $$i; ln -s ${BINDIR}/sendmail $$i; done
134	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
135	    ${STDIR}/sendmail.st
136	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 sendmail.hf ${HFDIR}
137
138# doesn't actually install them -- you may want to install pre-nroff versions
139install-docs: aliases.0 mailq.0 newaliases.0 sendmail.0
140
141clean:
142	rm -f ${OBJS} sendmail aliases.0 mailq.0 newaliases.0 sendmail.0
143
144# dependencies
145#   gross overkill, and yet still not quite enough....
146${OBJS}: sendmail.h conf.h
147