2002-03-04 09:50:28 +00:00
|
|
|
# $FreeBSD$
|
|
|
|
#
|
|
|
|
# This include file <bsd.nls.mk> handles building and installing Native
|
|
|
|
# Language Support (NLS) catalogs
|
|
|
|
#
|
|
|
|
# +++ variables +++
|
|
|
|
#
|
|
|
|
# GENCAT A program for converting .msg files into compiled NLS
|
|
|
|
# .cat files. [gencat -new]
|
|
|
|
#
|
|
|
|
# NLS Source or intermediate .msg files. [set in Makefile]
|
|
|
|
#
|
|
|
|
# NLSDIR Base path for National Language Support files
|
|
|
|
# installation. [${SHAREDIR}/nls]
|
|
|
|
#
|
|
|
|
# NLSGRP National Language Support files group. [${SHAREGRP}]
|
|
|
|
#
|
|
|
|
# NLSMODE National Language Support files mode. [${NOBINMODE}]
|
|
|
|
#
|
|
|
|
# NLSOWN National Language Support files owner. [${SHAREOWN}]
|
|
|
|
#
|
|
|
|
# NO_NLS Do not make or install NLS files. [not set]
|
|
|
|
|
2002-07-02 12:37:09 +00:00
|
|
|
.if !target(__<bsd.init.mk>__)
|
|
|
|
.error bsd.nls.mk cannot be included directly.
|
|
|
|
.endif
|
2002-04-17 13:49:29 +00:00
|
|
|
|
2005-02-27 16:36:54 +00:00
|
|
|
GENCAT?= gencat
|
2002-03-04 09:50:28 +00:00
|
|
|
|
|
|
|
.SUFFIXES: .cat .msg
|
|
|
|
|
|
|
|
.msg.cat:
|
|
|
|
${GENCAT} ${.TARGET} ${.IMPSRC}
|
|
|
|
|
2002-07-02 12:37:09 +00:00
|
|
|
.if defined(NLS) && !empty(NLS) && !defined(NO_NLS)
|
|
|
|
|
2002-03-04 09:50:28 +00:00
|
|
|
#
|
|
|
|
# .msg file pre-build rules
|
|
|
|
#
|
2002-07-02 12:37:09 +00:00
|
|
|
NLSSRCDIR?= ${.CURDIR}
|
2002-03-04 09:50:28 +00:00
|
|
|
.for file in ${NLS}
|
2002-07-02 12:37:09 +00:00
|
|
|
.if defined(NLSSRCFILES)
|
|
|
|
NLSSRCFILES_${file}?= ${NLSSRCFILES}
|
2002-03-04 10:59:37 +00:00
|
|
|
.endif
|
2002-03-04 09:50:28 +00:00
|
|
|
.if defined(NLSSRCFILES_${file})
|
2002-07-02 12:37:09 +00:00
|
|
|
NLSSRCDIR_${file}?= ${NLSSRCDIR}
|
|
|
|
${file}.msg: ${NLSSRCFILES_${file}:S/^/${NLSSRCDIR_${file}}\//}
|
2002-03-04 09:50:28 +00:00
|
|
|
@rm -f ${.TARGET}
|
2002-07-02 12:37:09 +00:00
|
|
|
cat ${.ALLSRC} > ${.TARGET}
|
|
|
|
CLEANFILES+= ${file}.msg
|
2002-03-04 12:27:00 +00:00
|
|
|
.endif
|
2002-03-04 09:50:28 +00:00
|
|
|
.endfor
|
|
|
|
|
|
|
|
#
|
|
|
|
# .cat file build rules
|
|
|
|
#
|
2002-07-02 12:37:09 +00:00
|
|
|
NLS:= ${NLS:=.cat}
|
|
|
|
CLEANFILES+= ${NLS}
|
|
|
|
FILESGROUPS?= FILES
|
|
|
|
FILESGROUPS+= NLS
|
|
|
|
NLSDIR?= ${SHAREDIR}/nls
|
2002-03-04 09:50:28 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# installation rules
|
|
|
|
#
|
2002-07-02 12:37:09 +00:00
|
|
|
.for file in ${NLS}
|
|
|
|
NLSNAME_${file:T}= ${file:T:R}/${NLSNAME}.cat
|
|
|
|
.if defined(NLSLINKS_${file:R}) && !empty(NLSLINKS_${file:R})
|
|
|
|
NLSLINKS+= ${file:R}
|
|
|
|
.endif
|
|
|
|
.for dst in ${NLSLINKS_${file:R}}
|
|
|
|
SYMLINKS+= ../${file:R}/${NLSNAME}.cat ${NLSDIR}/${dst}/${NLSNAME}.cat
|
2002-03-04 12:27:00 +00:00
|
|
|
.endfor
|
|
|
|
.endfor
|
2002-03-04 09:50:28 +00:00
|
|
|
|
2002-07-02 12:37:09 +00:00
|
|
|
.endif defined(NLS) && !empty(NLS) && !defined(NO_NLS)
|