1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-15 10:17:20 +00:00
freebsd/share/mk/bsd.nls.mk
Ruslan Ermilov e1fe3dba5c Reimplementation of world/kernel build options. For details, see:
http://lists.freebsd.org/pipermail/freebsd-current/2006-March/061725.html

The src.conf(5) manpage is to follow in a few days.

Brought to you by:	imp, jhb, kris, phk, ru (all bugs are mine)
2006-03-17 18:54:44 +00:00

75 lines
1.6 KiB
Makefile

# $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]
#
# 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}]
.if !target(__<bsd.init.mk>__)
.error bsd.nls.mk cannot be included directly.
.endif
GENCAT?= gencat
.SUFFIXES: .cat .msg
.msg.cat:
${GENCAT} ${.TARGET} ${.IMPSRC}
.if defined(NLS) && !empty(NLS) && ${MK_NLS} != "no"
#
# .msg file pre-build rules
#
NLSSRCDIR?= ${.CURDIR}
.for file in ${NLS}
.if defined(NLSSRCFILES)
NLSSRCFILES_${file}?= ${NLSSRCFILES}
.endif
.if defined(NLSSRCFILES_${file})
NLSSRCDIR_${file}?= ${NLSSRCDIR}
${file}.msg: ${NLSSRCFILES_${file}:S/^/${NLSSRCDIR_${file}}\//}
@rm -f ${.TARGET}
cat ${.ALLSRC} > ${.TARGET}
CLEANFILES+= ${file}.msg
.endif
.endfor
#
# .cat file build rules
#
NLS:= ${NLS:=.cat}
CLEANFILES+= ${NLS}
FILESGROUPS?= FILES
FILESGROUPS+= NLS
NLSDIR?= ${SHAREDIR}/nls
#
# installation rules
#
.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
.endfor
.endfor
.endif # defined(NLS) && !empty(NLS) && ${MK_NLS} != "no"