summaryrefslogtreecommitdiff
path: root/bootstrap/bmake/mk/bsd.nls.mk
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/bmake/mk/bsd.nls.mk')
-rw-r--r--bootstrap/bmake/mk/bsd.nls.mk65
1 files changed, 65 insertions, 0 deletions
diff --git a/bootstrap/bmake/mk/bsd.nls.mk b/bootstrap/bmake/mk/bsd.nls.mk
new file mode 100644
index 00000000000..f9cda49f63c
--- /dev/null
+++ b/bootstrap/bmake/mk/bsd.nls.mk
@@ -0,0 +1,65 @@
+# $NetBSD: bsd.nls.mk,v 1.1.1.1 2004/03/11 13:04:17 grant Exp $
+
+.if !target(__initialized__)
+__initialized__:
+.if exists(${.CURDIR}/../Makefile.inc)
+.include "${.CURDIR}/../Makefile.inc"
+.endif
+.MAIN: all
+.endif
+
+.PHONY: cleannls nlsinstall
+cleandir: cleannls
+
+.SUFFIXES: .cat .msg
+
+.msg.cat:
+ @rm -f ${.TARGET}
+ gencat ${.TARGET} ${.IMPSRC}
+
+.if defined(NLS) && !empty(NLS)
+NLSALL= ${NLS:.msg=.cat}
+.NOPATH: ${NLSALL}
+
+NLSNAME?=${PROG:Ulib${LIB}}
+
+.if ${MKNLS} != "no"
+realinstall: nlsinstall
+realall: ${NLSALL}
+.endif
+
+cleannls:
+ rm -f ${NLSALL}
+
+nlsinstall:: ${DESTDIR}${NLSDIR}
+.PRECIOUS:: ${DESTDIR}${NLSDIR}
+.PHONY:: ${DESTDIR}${NLSDIR}
+
+${DESTDIR}${NLSDIR}:
+ @if [ ! -d ${.TARGET} ] || [ -h ${.TARGET} ] ; then \
+ echo creating ${.TARGET}; \
+ /bin/rm -rf ${.TARGET}; \
+ ${INSTALL} ${INSTPRIV} -d -o ${NLSOWN} -g ${NLSGRP} -m 755 \
+ ${.TARGET}; \
+ fi
+
+nlsinstall:: ${NLSALL:@F@${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat@}
+.PRECIOUS: ${NLSALL:@F@${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat@}
+.if !defined(UPDATE)
+.PHONY: ${NLSALL:@F@${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat@}
+.endif
+
+__nlsinstall: .USE
+ ${INSTALL} ${INSTPRIV} -d -o ${NLSOWN} -g ${NLSGRP} ${.TARGET:H}
+ ${INSTALL} ${RENAME} ${PRESERVE} ${COPY} ${INSTPRIV} -o ${NLSOWN} \
+ -g ${NLSGRP} -m ${NLSMODE} ${.ALLSRC} ${.TARGET}
+
+.for F in ${NLSALL:O:u}
+.if !defined(BUILD) && !make(all) && !make(${F})
+${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat: .MADE
+.endif
+${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat: ${F} __nlsinstall
+.endfor
+.else
+cleannls:
+.endif