xref: /freebsd/contrib/sendmail/smrsh/Makefile.m4 (revision 6e8394b8baa7d5d9153ab90de6824bcd19b3b4e1)
1#
2#  This Makefile is designed to work on the old "make" program.
3#
4#	@(#)Makefile.m4	8.14	(Berkeley)	7/12/1998
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# include directories
23INCDIRS=-I${SRCDIR} confINCDIRS
24
25# loader options
26LDOPTS=	ifdef(`confLDOPTS', `confLDOPTS')
27
28# library directories
29LIBDIRS=confLIBDIRS
30
31# libraries required on your system
32LIBS=	ifdef(`confLIBS', `confLIBS')
33
34# location of smrsh binary (usually /usr/libexec or /usr/etc)
35EBINDIR=${DESTDIR}ifdef(`confEBINDIR', `confEBINDIR', `/usr/libexec')
36
37# additional .o files needed
38OBJADD=	ifdef(`confOBJADD', `confOBJADD')
39
40undivert(1)
41
42###################  end of user configuration flags  ######################
43
44BUILDBIN=confBUILDBIN
45COPTS=	-I. ${INCDIRS} ${ENVDEF}
46CFLAGS=	$O ${COPTS}
47
48BEFORE= confBEFORE
49OBJS=	smrsh.o ${OBJADD}
50
51# Which *roff program has -mandoc support
52NROFF=	ifdef(`confNROFF', `confNROFF', `groff -Tascii')
53MANDOC=	ifdef(`confMANDOC', `confMANDOC', `-mandoc')
54
55INSTALL=ifdef(`confINSTALL', `confINSTALL', `install')
56BINOWN=	ifdef(`confUBINOWN', `confUBINOWN', `bin')
57BINGRP=	ifdef(`confUBINGRP', `confUBINGRP', `bin')
58BINMODE=ifdef(`confUBINMODE', `confUBINMODE', `555')
59
60MANOWN=	ifdef(`confMANOWN', `confMANOWN', `bin')
61MANGRP=	ifdef(`confMANGRP', `confMANGRP', `bin')
62MANMODE=ifdef(`confMANMODE', `confMANMODE', `444')
63
64MANROOT=${DESTDIR}ifdef(`confMANROOT', `confMANROOT', `/usr/share/man/cat')
65MAN8=	${MANROOT}ifdef(`confMAN8', `confMAN8', `8')
66MAN8EXT=ifdef(`confMAN8EXT', `confMAN8EXT', `8')
67MAN8SRC=ifdef(`confMAN8SRC', `confMAN8SRC', `0')
68
69ALL=	smrsh smrsh.${MAN8SRC}
70
71all: ${ALL}
72
73smrsh: ${BEFORE} ${OBJS}
74	${CC} -o smrsh ${LDOPTS} ${OBJS} ${LIBDIRS} ${LIBS}
75
76undivert(3)
77
78smrsh.${MAN8SRC}: smrsh.8
79	${NROFF} ${MANDOC} smrsh.8 > smrsh.${MAN8SRC}
80
81install: install-smrsh install-docs
82
83install-smrsh: smrsh
84	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} smrsh ${EBINDIR}
85
86install-docs: smrsh.${MAN8SRC}
87ifdef(`confNO_MAN_INSTALL', `dnl',
88`	${INSTALL} -c -o ${MANOWN} -g ${MANGRP} -m ${MANMODE} smrsh.${MAN8SRC} ${MAN8}/smrsh.${MAN8EXT}')
89
90clean:
91	rm -f ${OBJS} smrsh smrsh.${MAN8SRC}
92
93################  Dependency scripts
94include(confBUILDTOOLSDIR/M4/depend/ifdef(`confDEPEND_TYPE', `confDEPEND_TYPE',
95`generic').m4)dnl
96################  End of dependency scripts
97