Merge bmake-20160512
[freebsd.git] / contrib / bmake / mk / nls.mk
1 #       $NetBSD: bsd.nls.mk,v 1.3 1996/10/18 02:34:45 thorpej Exp $
2
3 .if !target(.MAIN)
4 # init.mk not included
5 .-include <${.CURDIR:H}/Makefile.inc>
6
7 .MAIN: all
8 .endif
9
10 .SUFFIXES: .cat .msg
11
12 .msg.cat:
13         @rm -f ${.TARGET}
14         gencat ${.TARGET} ${.IMPSRC}
15
16 .if defined(NLS) && !empty(NLS)
17 NLSALL= ${NLS:.msg=.cat}
18 .NOPATH: ${NLSALL}
19 .endif
20
21 .if !defined(NLSNAME)
22 .if defined(PROG)
23 NLSNAME=${PROG}
24 .else
25 NLSNAME=lib${LIB}
26 .endif
27 .endif
28
29 nlsinstall:
30 .if defined(NLSALL)
31         @for msg in ${NLSALL}; do \
32                 NLSLANG=`basename $$msg .cat`; \
33                 dir=${DESTDIR}${NLSDIR}/$${NLSLANG}; \
34                 ${INSTALL} -d $$dir; \
35                 ${INSTALL} ${COPY} -o ${NLSOWN} -g ${NLSGRP} -m ${NLSMODE} $$msg $$dir/${NLSNAME}.cat; \
36         done
37 .endif
38
39 .if defined(NLSALL)
40 all: ${NLSALL}
41
42 install:  nlsinstall
43
44 cleandir: cleannls
45 cleannls:
46         rm -f ${NLSALL}
47 .endif