xref: /freebsd/usr.sbin/ypserv/Makefile (revision 41466b50c1d5bfd1cf6adaae547a579a75d7c04e)
1# $FreeBSD$
2
3RPCDIR=	${.CURDIR}/../../include/rpcsvc
4.PATH: ${RPCDIR}
5
6PROG=	ypserv
7MAN=	ypserv.8 ypinit.8
8SRCS=	yp_svc.c yp_server.c yp_dblookup.c yp_dnslookup.c \
9	ypxfr_clnt.c yp.h yp_main.c yp_error.c yp_access.c yp_svc_udp.c
10
11CFLAGS+= -I. -DDB_CACHE
12
13CLEANFILES= yp_svc.c ypxfr_clnt.c yp.h
14
15RPCGEN= rpcgen -I -C
16
17# We need to remove the 'static' keyword from _rpcsvcstate so that
18# yp_main.c can see it.
19yp_svc.c: yp.x
20	rm -f ${.TARGET}
21	${RPCGEN} -DYPSERV_ONLY -m ${RPCDIR}/yp.x | \
22	sed s/"static int _rpcsvcstate"/"int _rpcsvcstate"/g > ${.TARGET}
23
24ypxfr_clnt.c: yp.x
25	${RPCGEN} -DYPPUSH_ONLY -l -o ${.TARGET} ${RPCDIR}/yp.x
26
27yp.h: yp.x
28	${RPCGEN} -h -o ${.TARGET} ${RPCDIR}/yp.x
29
30afterinstall:
31	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
32		${.CURDIR}/Makefile.yp \
33		${DESTDIR}/var/yp/Makefile.dist
34	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 \
35		${.CURDIR}/ypinit.sh ${DESTDIR}${BINDIR}/ypinit
36	@if [ ! -f ${DESTDIR}/var/yp/Makefile.dist ]; then \
37		ln -s	${DESTDIR}/var/yp/Makefile.dist \
38			${DESTDIR}/var/yp/Makefile; fi
39
40.include <bsd.prog.mk>
41