summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ypserv/Makefile
blob: db215237126eeed00682ec680c0ef04461ca87a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# $FreeBSD$

RPCDIR=	${.CURDIR}/../../include/rpcsvc
.PATH: ${RPCDIR}

PROG=	ypserv
MAN=	ypserv.8 ypinit.8
SRCS=	yp_svc.c yp_server.c yp_dblookup.c yp_dnslookup.c \
	ypxfr_clnt.c yp.h yp_main.c yp_error.c yp_access.c yp_svc_udp.c

CFLAGS+= -DDB_CACHE -DTCP_WRAPPER -I.

DPADD=	${LIBWRAP}
LDADD=	-lwrap

CLEANFILES= yp_svc.c ypxfr_clnt.c yp.h

RPCGEN= rpcgen -I -C

# We need to remove the 'static' keyword from _rpcsvcstate so that
# yp_main.c can see it.
yp_svc.c: yp.x
	rm -f ${.TARGET}
	${RPCGEN} -DYPSERV_ONLY -m ${RPCDIR}/yp.x | \
	sed s/"static int _rpcsvcstate"/"int _rpcsvcstate"/g > ${.TARGET}

ypxfr_clnt.c: yp.x
	${RPCGEN} -DYPPUSH_ONLY -l -o ${.TARGET} ${RPCDIR}/yp.x

yp.h: yp.x
	${RPCGEN} -h -o ${.TARGET} ${RPCDIR}/yp.x

afterinstall:
	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 444 \
		${.CURDIR}/Makefile.yp \
		${DESTDIR}/var/yp/Makefile.dist
	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m 555 \
		${.CURDIR}/ypinit.sh ${DESTDIR}${BINDIR}/ypinit
	@if [ ! -f ${DESTDIR}/var/yp/Makefile.dist ]; then \
		ln -s	${DESTDIR}/var/yp/Makefile.dist \
			${DESTDIR}/var/yp/Makefile; fi

.include <bsd.prog.mk>
OpenPOWER on IntegriCloud