xref: /freebsd/usr.bin/chpass/Makefile (revision 952d112864d8008aa87278a30a539d888a8493cd)
1#	@(#)Makefile	8.2 (Berkeley) 4/2/94
2
3PROG=	chpass
4SRCS=	chpass.c edit.c field.c pw_copy.c pw_scan.c pw_util.c table.c util.c
5BINOWN=	root
6BINMODE=4555
7.PATH:	${.CURDIR}/../../usr.sbin/pwd_mkdb ${.CURDIR}/../../usr.sbin/vipw \
8	${.CURDIR}/../../libexec/ypxfr \
9	${.CURDIR}/../../usr.sbin/rpc.yppasswdd
10CFLAGS+=-I${.CURDIR}/../../usr.sbin/pwd_mkdb -I${.CURDIR}/../../usr.sbin/vipw
11LINKS=	${BINDIR}/chpass ${BINDIR}/chfn
12LINKS+=	${BINDIR}/chpass ${BINDIR}/chsh
13LINKS+=	${BINDIR}/chpass ${BINDIR}/ypchpass
14LINKS+=	${BINDIR}/chpass ${BINDIR}/ypchfn
15LINKS+=	${BINDIR}/chpass ${BINDIR}/ypchsh
16MLINKS=	chpass.1 chfn.1 chpass.1 chsh.1
17COPTS+=	-DYP -I. -I${.CURDIR}/../../libexec/ypxfr \
18	-I${.CURDIR}/../../usr.sbin/rpc.yppasswdd -Dyp_error=warnx
19
20#Some people need this, uncomment to activate
21#COPTS+= -DRESTRICT_FULLNAME_CHANGE
22
23SRCS+=	yppasswd_private_xdr.c yppasswd_comm.c yp_clnt.c \
24	yppasswd_clnt.c pw_yp.c ypxfr_misc.c
25CLEANFILES= yp_clnt.c yp.h yppasswd_clnt.c yppasswd.h \
26	    yppasswd_private_xdr.c yppasswd_private.h
27
28DPADD=	${LIBRPCSVC} ${LIBCRYPT}
29LDADD+=	-lrpcsvc -lcrypt
30
31RPCGEN= rpcgen -C
32RPCSRC= ${DESTDIR}/usr/include/rpcsvc/yp.x
33RPCSRC_PW= ${DESTDIR}/usr/include/rpcsvc/yppasswd.x
34RPCSRC_PRIV= ${.CURDIR}/../../usr.sbin/rpc.yppasswdd/yppasswd_private.x
35
36yp.h: ${RPCSRC}
37	${RPCGEN} -h -o ${.TARGET} ${RPCSRC}
38
39yp_clnt.c: ${RPCSRC} yp.h
40	${RPCGEN} -l -o ${.TARGET} ${RPCSRC}
41
42yppasswd.h: ${RPCSRC_PW}
43	${RPCGEN} -h -o ${.TARGET} ${RPCSRC_PW}
44
45yppasswd_clnt.c: ${RPCSRC_PW} yppasswd.h
46	${RPCGEN} -l -o ${.TARGET} ${RPCSRC_PW}
47
48yppasswd_private.h: ${RPCSRC_PRIV}
49	${RPCGEN} -h -o ${.TARGET} ${RPCSRC_PRIV}
50
51yppasswd_private_xdr.c: ${RPCSRC_PRIV} yppasswd_private.h
52	${RPCGEN} -c -o ${.TARGET} ${RPCSRC_PRIV}
53
54beforeinstall:
55.for i in chpass chfn chsh ypchpass ypchfn ypchsh
56	[ ! -e ${DESTDIR}${BINDIR}/$i ] || \
57		chflags noschg ${DESTDIR}${BINDIR}/$i
58.endfor
59
60afterinstall:
61	chflags schg ${DESTDIR}${BINDIR}/chpass
62
63.include <bsd.prog.mk>
64