191621Sphantom# $FreeBSD: releng/11.0/share/mk/bsd.nls.mk 301284 2016-06-03 19:25:36Z bdrewery $ 291621Sphantom# 391621Sphantom# This include file <bsd.nls.mk> handles building and installing Native 491621Sphantom# Language Support (NLS) catalogs 591621Sphantom# 691621Sphantom# +++ variables +++ 791621Sphantom# 891621Sphantom# GENCAT A program for converting .msg files into compiled NLS 9143378Sphantom# .cat files. [gencat] 1091621Sphantom# 1191621Sphantom# NLS Source or intermediate .msg files. [set in Makefile] 1291621Sphantom# 1391621Sphantom# NLSDIR Base path for National Language Support files 1491621Sphantom# installation. [${SHAREDIR}/nls] 1591621Sphantom# 1691621Sphantom# NLSGRP National Language Support files group. [${SHAREGRP}] 1791621Sphantom# 1891621Sphantom# NLSMODE National Language Support files mode. [${NOBINMODE}] 1991621Sphantom# 2091621Sphantom# NLSOWN National Language Support files owner. [${SHAREOWN}] 2191621Sphantom 2299257Sru.if !target(__<bsd.init.mk>__) 2399257Sru.error bsd.nls.mk cannot be included directly. 2499257Sru.endif 2594940Sru 26142666SphantomGENCAT?= gencat 2791621Sphantom 2891621Sphantom.SUFFIXES: .cat .msg 2991621Sphantom 3091621Sphantom.msg.cat: 3191621Sphantom ${GENCAT} ${.TARGET} ${.IMPSRC} 3291621Sphantom 33156813Sru.if defined(NLS) && !empty(NLS) && ${MK_NLS} != "no" 3499257Sru 3591621Sphantom# 3691621Sphantom# .msg file pre-build rules 3791621Sphantom# 3899257SruNLSSRCDIR?= ${.CURDIR} 3991621Sphantom.for file in ${NLS} 4099257Sru.if defined(NLSSRCFILES) 4199257SruNLSSRCFILES_${file}?= ${NLSSRCFILES} 4291628Sphantom.endif 4391621Sphantom.if defined(NLSSRCFILES_${file}) 4499257SruNLSSRCDIR_${file}?= ${NLSSRCDIR} 45301284Sbdrewery${file}.msg: ${NLSSRCFILES_${file}:S/^/${NLSSRCDIR_${file}}\//} 4691621Sphantom @rm -f ${.TARGET} 4799257Sru cat ${.ALLSRC} > ${.TARGET} 4899257SruCLEANFILES+= ${file}.msg 4991621Sphantom.endif 5091621Sphantom.endfor 5191621Sphantom 5291621Sphantom# 5391621Sphantom# .cat file build rules 5491621Sphantom# 5599257SruNLS:= ${NLS:=.cat} 5699257SruCLEANFILES+= ${NLS} 5799257SruFILESGROUPS?= FILES 5899257SruFILESGROUPS+= NLS 5999257SruNLSDIR?= ${SHAREDIR}/nls 6091621Sphantom 6191621Sphantom# 6291621Sphantom# installation rules 6391621Sphantom# 64284345Ssjg.if ${MK_STAGING_PROG} == "yes" 65284345Ssjg.if !defined(_SKIP_BUILD) 66288964SsjgSTAGE_TARGETS+= stage_symlinks 67284345Ssjg.endif 68284345SsjgSTAGE_SYMLINKS.NLS= ${NLSSYMLINKS} 69284345SsjgSTAGE_SYMLINKS_DIR.NLS= ${STAGE_OBJTOP} 70284345Ssjg.else 71284345SsjgSYMLINKS+= ${NLSSYMLINKS} 72284345Ssjg.endif 7399257Sru.for file in ${NLS} 7499257SruNLSNAME_${file:T}= ${file:T:R}/${NLSNAME}.cat 7599257Sru.if defined(NLSLINKS_${file:R}) && !empty(NLSLINKS_${file:R}) 76295223Sbdrewery.if !empty(NLSLINKS_${file:R}:M${file:R}) 77295223Sbdrewery.error NLSLINKS_${file:R} contains itself: ${file:R} 78295223Sbdrewery.endif 7999257SruNLSLINKS+= ${file:R} 8099257Sru.endif 8199257Sru.for dst in ${NLSLINKS_${file:R}} 82284345SsjgNLSSYMLINKS+= ../${file:R}/${NLSNAME}.cat ${NLSDIR}/${dst}/${NLSNAME}.cat 8391621Sphantom.endfor 8491632Sphantom.endfor 8591632Sphantom 86156813Sru.endif # defined(NLS) && !empty(NLS) && ${MK_NLS} != "no" 87