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
|
2005-03-10 15:58:16 +00:00
|
|
|
# .cat files. [gencat]
|
2002-03-04 09:50:28 +00:00
|
|
|
#
|
|
|
|
# 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}]
|
|
|
|
|
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}
|
|
|
|
|
2006-03-17 18:54:44 +00:00
|
|
|
.if defined(NLS) && !empty(NLS) && ${MK_NLS} != "no"
|
2002-07-02 12:37:09 +00:00
|
|
|
|
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}
|
2016-06-03 19:25:36 +00:00
|
|
|
${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
|
|
|
|
#
|
2013-01-17 18:28:26 +00:00
|
|
|
.if ${MK_STAGING_PROG} == "yes"
|
|
|
|
.if !defined(_SKIP_BUILD)
|
2015-10-07 00:24:27 +00:00
|
|
|
STAGE_TARGETS+= stage_symlinks
|
2013-01-17 18:28:26 +00:00
|
|
|
.endif
|
|
|
|
STAGE_SYMLINKS.NLS= ${NLSSYMLINKS}
|
|
|
|
STAGE_SYMLINKS_DIR.NLS= ${STAGE_OBJTOP}
|
|
|
|
.else
|
|
|
|
SYMLINKS+= ${NLSSYMLINKS}
|
|
|
|
.endif
|
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})
|
2016-02-03 23:37:14 +00:00
|
|
|
.if !empty(NLSLINKS_${file:R}:M${file:R})
|
|
|
|
.error NLSLINKS_${file:R} contains itself: ${file:R}
|
|
|
|
.endif
|
2002-07-02 12:37:09 +00:00
|
|
|
NLSLINKS+= ${file:R}
|
|
|
|
.endif
|
|
|
|
.for dst in ${NLSLINKS_${file:R}}
|
2013-01-17 18:28:26 +00:00
|
|
|
NLSSYMLINKS+= ../${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
|
|
|
|
2006-03-17 18:54:44 +00:00
|
|
|
.endif # defined(NLS) && !empty(NLS) && ${MK_NLS} != "no"
|