-beforeinstall:
- mkdict/obj/mkdict < /usr/share/dict/words > \
- ${DESTDIR}/usr/share/games/boggle/dictionary
- mkindex/obj/mkindex < ${DESTDIR}/usr/share/games/boggle/dictionary > \
- ${DESTDIR}/usr/share/games/boggle/dictindex
- chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/share/games/boggle/dictionary
- chmod 444 ${DESTDIR}/usr/share/games/boggle/dictionary
- chown ${BINOWN}.${BINGRP} ${DESTDIR}/usr/share/games/boggle/dictindex
- chmod 444 ${DESTDIR}/usr/share/games/boggle/dictindex
-
+MKDICTDIR!= cd $(.CURDIR)/mkdict; ${PRINTOBJDIR}
+MKDICT=${MKDICTDIR}/mkdict
+MKINDEXDIR!= cd $(.CURDIR)/mkindex; ${PRINTOBJDIR}
+MKINDEX=${MKINDEXDIR}/mkindex
+WORDS=${NETBSDSRCDIR}/share/dict/web2
+DICTFILES=dictionary dictindex
+.if ${MKSHARE} != "no"
+FILES=${DICTFILES}
+FILESDIR=/usr/share/games/boggle
+.endif
+CLEANFILES+=${DICTFILES}
+
+realall: ${FILES}
+
+${MKDICT}:
+ @cd ${.CURDIR}/mkdict && ${MAKE}
+
+${MKINDEX}:
+ @cd ${.CURDIR}/mkindex && ${MAKE}
+
+dictionary: ${WORDS} ${MKDICT}
+ ${_MKTARGET_CREATE}
+ rm -f ${.TARGET}
+ ${MKDICT} < ${WORDS} > ${.TARGET}
+
+dictindex: dictionary ${MKINDEX}
+ ${_MKTARGET_CREATE}
+ rm -f ${.TARGET}
+ ${MKINDEX} < dictionary > ${.TARGET}
+
+.include <bsd.prog.mk>