xref: /freebsd/contrib/sendmail/rmail/Makefile.m4 (revision a8445737e740901f5f2c8d24c12ef7fc8b00134e)
1#
2#  This Makefile is designed to work on the old "make" program.
3#
4#	@(#)Makefile.m4	8.16	(Berkeley)	6/18/98
5#
6
7# C compiler
8CC=	confCC
9
10# Shell
11SHELL=	confSHELL
12
13# use O=-O (usual) or O=-g (debugging)
14O=	ifdef(`confOPTIMIZE', `confOPTIMIZE', `-O')
15
16# location of sendmail source directory
17SRCDIR=	ifdef(`confSRCDIR', `confSRCDIR', `../../src')
18
19# environment definitions (e.g., -D_AIX3)
20ENVDEF=	ifdef(`confENVDEF', `confENVDEF')
21
22# see also conf.h for additional compilation flags
23
24# include directories
25INCDIRS=-I${SRCDIR} confINCDIRS
26
27# loader options
28LDOPTS=	ifdef(`confLDOPTS', `confLDOPTS')
29
30# library directories
31LIBDIRS=confLIBDIRS
32
33# libraries required on your system
34LIBS=	ifdef(`confLIBS', `confLIBS')
35
36# location of rmail binary (usually /usr/sbin or /usr/etc)
37BINDIR=	${DESTDIR}ifdef(`confUBINDIR', `confUBINDIR', `/usr/bin')
38
39# additional .o files needed
40OBJADD=	ifdef(`confOBJADD', `confOBJADD')
41
42undivert(1)
43
44###################  end of user configuration flags  ######################
45
46BUILDBIN=confBUILDBIN
47COPTS=	-I. ${INCDIRS} ${ENVDEF}
48CFLAGS=	$O ${COPTS}
49
50BEFORE= snprintf.c confBEFORE
51OBJS=	rmail.o snprintf.o ${OBJADD}
52
53NROFF=	ifdef(`confNROFF', `confNROFF', `groff -Tascii')
54MANDOC=	ifdef(`confMANDOC', `confMANDOC', `-mandoc')
55
56INSTALL=ifdef(`confINSTALL', `confINSTALL', `install')
57BINOWN=	ifdef(`confUBINOWN', `confUBINOWN', `bin')
58BINGRP=	ifdef(`confUBINGRP', `confUBINGRP', `bin')
59BINMODE=ifdef(`confUBINMODE', `confUBINMODE', `555')
60
61MANOWN=	ifdef(`confMANOWN', `confMANOWN', `bin')
62MANGRP=	ifdef(`confMANGRP', `confMANGRP', `bin')
63MANMODE=ifdef(`confMANMODE', `confMANMODE', `444')
64
65MANROOT=${DESTDIR}ifdef(`confMANROOT', `confMANROOT', `/usr/share/man/cat')
66MAN8=	${MANROOT}ifdef(`confMAN8', `confMAN8', `8')
67MAN8EXT=ifdef(`confMAN8EXT', `confMAN8EXT', `8')
68MAN8SRC=ifdef(`confMAN8SRC', `confMAN8SRC', `0')
69
70ALL=	rmail rmail.${MAN8SRC}
71
72all: ${ALL}
73
74rmail: ${BEFORE} ${OBJS}
75	${CC} -o rmail ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
76
77snprintf.c: ${SRCDIR}/snprintf.c
78	-ln -s ${SRCDIR}/snprintf.c snprintf.c
79
80undivert(3)
81
82rmail.${MAN8SRC}: rmail.8
83	${NROFF} ${MANDOC} rmail.8 > rmail.${MAN8SRC}
84
85install:
86	@echo "NOTE: This version of rmail is not suited for some operating"
87	@echo "      systems.  You can force the install using"
88	@echo "      '${MAKE} force-install'."
89
90force-install: install-rmail install-docs
91
92install-rmail: rmail
93	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} rmail ${BINDIR}
94
95install-docs: rmail.${MAN8SRC}
96ifdef(`confNO_MAN_INSTALL', `dnl',
97`	${INSTALL} -c -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} rmail.${MAN8SRC} ${MAN8}/rmail.${MAN8EXT}')
98
99clean:
100	rm -f ${OBJS} rmail rmail.${MAN8SRC}
101
102################  Dependency scripts
103include(confBUILDTOOLSDIR/M4/depend/ifdef(`confDEPEND_TYPE', `confDEPEND_TYPE',
104`generic').m4)dnl
105################  End of dependency scripts
106