bsd.nls.mk revision 91628
191621Sphantom# Based on $NetBSD: bsd.nls.mk,v 1.35 2001/11/28 20:19:08 tv Exp $ 291621Sphantom# $FreeBSD: head/share/mk/bsd.nls.mk 91628 2002-03-04 10:59:37Z phantom $ 391621Sphantom# 491621Sphantom# This include file <bsd.nls.mk> handles building and installing Native 591621Sphantom# Language Support (NLS) catalogs 691621Sphantom# 791621Sphantom# +++ variables +++ 891621Sphantom# 991621Sphantom# GENCAT A program for converting .msg files into compiled NLS 1091621Sphantom# .cat files. [gencat -new] 1191621Sphantom# 1291621Sphantom# NLS Source or intermediate .msg files. [set in Makefile] 1391621Sphantom# 1491621Sphantom# NLSDIR Base path for National Language Support files 1591621Sphantom# installation. [${SHAREDIR}/nls] 1691621Sphantom# 1791621Sphantom# NLSGRP National Language Support files group. [${SHAREGRP}] 1891621Sphantom# 1991621Sphantom# NLSMODE National Language Support files mode. [${NOBINMODE}] 2091621Sphantom# 2191621Sphantom# NLSOWN National Language Support files owner. [${SHAREOWN}] 2291621Sphantom# 2391621Sphantom# NO_NLS Do not make or install NLS files. [not set] 2491621Sphantom# 2591621Sphantom# +++ targets +++ 2691621Sphantom# 2791621Sphantom# install: 2891621Sphantom# Install compiled NLS files 2991621Sphantom# 3091621Sphantom# bsd.obj.mk: cleandir and obj 3191621Sphantom 3291621SphantomGENCAT?= gencat -new 3391621Sphantom 3491621SphantomNLSDIR?= ${SHAREDIR}/nls 3591621SphantomNLSGRP?= ${SHAREGRP} 3691621SphantomNLSMODE?= ${NOBINMODE} 3791621SphantomNLSOWN?= ${SHAREOWN} 3891621Sphantom 3991621SphantomNLS?= 4091621Sphantom 4191621Sphantom.MAIN: all 4291621Sphantom 4391621Sphantom.SUFFIXES: .cat .msg 4491621Sphantom 4591621Sphantom.msg.cat: 4691621Sphantom ${GENCAT} ${.TARGET} ${.IMPSRC} 4791621Sphantom 4891621Sphantom# 4991621Sphantom# .msg file pre-build rules 5091621Sphantom# 5191621Sphantom.for file in ${NLS} 5291628Sphantom.if !defined(NLSSRCDIR_${file}) && defined(NLSSRCDIR) 5391628SphantomNLSSRCDIR_${file}=${NLSSRCDIR} 5491628Sphantom.endif 5591628Sphantom.if !defined(NLSSRCFILES_${file}) && defined(NLSSRCFILES) 5691628SphantomNLSSRCFILES_${file}=${NLSSRCFILES} 5791628Sphantom.endif 5891628Sphantom 5991621Sphantom.if defined(NLSSRCFILES_${file}) 6091621Sphantom${file}: 6191621Sphantom @rm -f ${.TARGET} 6291621Sphantom cat ${NLSSRCDIR_${file}}/${NLSSRCFILES_${file}} > ${.TARGET} 6391628SphantomCLEANFILES+= ${file} 6491621Sphantom.endif 6591621Sphantom.endfor 6691621Sphantom 6791621Sphantom# 6891621Sphantom# .cat file build rules 6991621Sphantom# 7091621SphantomNLSALL= ${NLS:.msg=.cat} 7191621SphantomCLEANFILES+= ${NLSALL} 7291621Sphantom 7391621Sphantom# 7491621Sphantom# installation rules 7591621Sphantom# 7691621Sphantom__nlsinstall: .USE 7791621Sphantom ${INSTALL} -o ${NLSOWN} -g ${NLSGRP} -m ${NLSMODE} \ 7891621Sphantom ${.ALLSRC} ${.TARGET} 7991621Sphantom 8091621Sphantom.for F in ${NLSALL} 8191621Sphantom_F:= ${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat 8291621Sphantom 8391621Sphantom${_F}: ${F} __nlsinstall # install rule 8491621Sphantomnlsinstall:: ${_F} 8591621Sphantom.PRECIOUS: ${_F} # keep if install fails 8691621Sphantom.endfor 8791621Sphantom 8891621Sphantom# 8991621Sphantom 9091621Sphantom.if !defined(NO_NLS) && !empty(NLS) 9191621Sphantomall-nls: ${NLSALL} 9291621Sphantom.else 9391621Sphantomall-nls: 9491621Sphantom.endif 9591621Sphantom 9691621Sphantomall: all-nls _SUBDIR 9791621Sphantominstall: beforeinstall nlsinstall afterinstall 9891621Sphantom 9991621Sphantom.if !target(distribute) 10091621Sphantomdistribute: 10191621Sphantom.endif 10291621Sphantom 10391621Sphantom.if !target(beforeinstall) 10491621Sphantombeforeinstall: 10591621Sphantom.endif 10691621Sphantom 10791621Sphantom.if !target(afterinstall) 10891621Sphantomafterinstall: 10991621Sphantom.endif 11091621Sphantom 11191621Sphantom.include <bsd.obj.mk> 112