xref: /freebsd/usr.sbin/ypserv/Makefile (revision 05c7a37afb48ddd5ee1bd921a5d46fe59cc70b15)
1# $Id: Makefile,v 1.2 1995/12/16 23:01:04 bde Exp $
2
3PROG=	ypserv
4SRCS=	yp_svc.c yp_server.c yp_dblookup.c yp_dnslookup.c \
5	ypxfr_clnt.c yp_main.c yp_error.c yp_access.c
6
7MAN8=	ypserv.8
8
9CFLAGS+= -I.
10
11CLEANFILES= yp_svc.c ypxfr_clnt.c yp.h
12
13RPCSRC= ${.DESTDIR}/usr/include/rpcsvc/yp.x
14RPCGEN= rpcgen -I -C
15
16# We need to remove the 'static' keyword from _rpcsvcstate so that
17# yp_main.c can see it.
18yp_svc.c: ${RPCSRC} yp.h
19	rm -f ${.TARGET}
20	${RPCGEN} -DYPSERV_ONLY -m ${RPCSRC} | \
21	sed s/"static int _rpcsvcstate"/"int _rpcsvcstate"/g > ${.TARGET}
22
23ypxfr_clnt.c: ${RPCSRC} yp.h
24	${RPCGEN} -DYPPUSH_ONLY -l -o ${.TARGET} ${RPCSRC}
25
26yp.h: ${RPCSRC}
27	${RPCGEN} -h -o ${.TARGET} ${RPCSRC}
28
29afterinstall:
30	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
31		${.CURDIR}/Makefile.yp \
32		${DESTDIR}/var/yp/Makefile
33	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \
34		${.CURDIR}/mknetid \
35		${DESTDIR}/usr/libexec/mknetid
36
37.include <bsd.prog.mk>
38