xref: /freebsd/usr.sbin/ypserv/Makefile (revision e9ac41698b2f322d55ccf9da50a3596edb2c1800)
1.include <src.opts.mk>
2
3RPCDIR=	${SRCTOP}/include/rpcsvc
4.PATH: ${RPCDIR} ${.CURDIR}/common
5
6PACKAGE=	yp
7PROG=	ypserv
8MAN=	ypserv.8 ypinit.8
9SRCS=	yp_svc.c yp_server.c yp_dblookup.c yp_dnslookup.c \
10	ypxfr_clnt.c yp.h yp_main.c yp_error.c yp_access.c yp_svc_udp.c \
11	yplib_host.c
12
13CFLAGS+= -DDB_CACHE -I.
14
15WARNS?=	0
16
17.if ${MK_TCP_WRAPPERS} != "no"
18CFLAGS+=	-DTCP_WRAPPER
19LIBADD+=	wrap
20.endif
21
22CLEANFILES= yp_svc.c ypxfr_clnt.c yp.h
23
24RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -I -C
25
26# We need to remove the 'static' keyword from _rpcsvcstate so that
27# yp_main.c can see it.
28yp_svc.c: yp.x
29	rm -f ${.TARGET}
30	${RPCGEN} -DYPSERV_ONLY -m ${RPCDIR}/yp.x | \
31	sed s/"static int _rpcsvcstate"/"int _rpcsvcstate"/g > ${.TARGET}
32
33ypxfr_clnt.c: yp.x
34	${RPCGEN} -DYPPUSH_ONLY -l -o ${.TARGET} ${RPCDIR}/yp.x
35
36yp.h: yp.x
37	${RPCGEN} -h -o ${.TARGET} ${RPCDIR}/yp.x
38
39FILES=	Makefile.yp
40FILESNAME= Makefile.dist
41FILESDIR= /var/yp
42SCRIPTS= ypinit.sh
43
44.if !exists(${DESTDIR}${FILESDIR}/Makefile)
45SYMLINKS= ${FILESNAME} ${FILESDIR}/Makefile
46.endif
47
48.include <bsd.prog.mk>
49