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