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