bsd.nls.mk revision 94940
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 94940 2002-04-17 13:49:29Z ru $ 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 3294940Sru.include <bsd.init.mk> 3394940Sru 3491621SphantomGENCAT?= gencat -new 3591621Sphantom 3691621SphantomNLSDIR?= ${SHAREDIR}/nls 3791621SphantomNLSGRP?= ${SHAREGRP} 3891621SphantomNLSMODE?= ${NOBINMODE} 3991621SphantomNLSOWN?= ${SHAREOWN} 4091621Sphantom 4191621SphantomNLS?= 4291632SphantomNLSLINKS= 4391621Sphantom 4491621Sphantom.SUFFIXES: .cat .msg 4591621Sphantom 4691621Sphantom.msg.cat: 4791621Sphantom ${GENCAT} ${.TARGET} ${.IMPSRC} 4891621Sphantom 4991621Sphantom# 5091621Sphantom# .msg file pre-build rules 5191621Sphantom# 5291621Sphantom.for file in ${NLS} 5391628Sphantom.if !defined(NLSSRCDIR_${file}) && defined(NLSSRCDIR) 5491628SphantomNLSSRCDIR_${file}=${NLSSRCDIR} 5591628Sphantom.endif 5691628Sphantom.if !defined(NLSSRCFILES_${file}) && defined(NLSSRCFILES) 5791628SphantomNLSSRCFILES_${file}=${NLSSRCFILES} 5891628Sphantom.endif 5991628Sphantom 6091621Sphantom.if defined(NLSSRCFILES_${file}) 6191621Sphantom${file}: 6291621Sphantom @rm -f ${.TARGET} 6391621Sphantom cat ${NLSSRCDIR_${file}}/${NLSSRCFILES_${file}} > ${.TARGET} 6491628SphantomCLEANFILES+= ${file} 6591621Sphantom.endif 6691632Sphantom 6791632Sphantom.if defined(NLSLINKS_${file:C/.msg//g}) && !empty(NLSLINKS_${file:C/.msg//g}) 6891632SphantomNLSLINKS+= ${file:C/.msg//g} 6991632Sphantom.endif 7091621Sphantom.endfor 7191621Sphantom 7291621Sphantom# 7391621Sphantom# .cat file build rules 7491621Sphantom# 7591621SphantomNLSALL= ${NLS:.msg=.cat} 7691621SphantomCLEANFILES+= ${NLSALL} 7791621Sphantom 7891621Sphantom# 7991621Sphantom# installation rules 8091621Sphantom# 8191621Sphantom__nlsinstall: .USE 8291621Sphantom ${INSTALL} -o ${NLSOWN} -g ${NLSGRP} -m ${NLSMODE} \ 8391621Sphantom ${.ALLSRC} ${.TARGET} 8491621Sphantom 8591621Sphantom.for F in ${NLSALL} 8691621Sphantom_F:= ${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat 8791621Sphantom 8891621Sphantom${_F}: ${F} __nlsinstall # install rule 8991621Sphantomnlsinstall:: ${_F} 9091621Sphantom.PRECIOUS: ${_F} # keep if install fails 9191621Sphantom.endfor 9291621Sphantom 9391632Sphantomlinks-nls: 9491632Sphantom.if defined(NLSLINKS) && !empty(NLSLINKS) 9591632Sphantom.for src in ${NLSLINKS} 9691632Sphantom.for dst in ${NLSLINKS_${src}} 9791632Sphantom ln -fs ../${src}/${NLSNAME}.cat \ 9891632Sphantom ${DESTDIR}${NLSDIR}/${dst}/${NLSNAME}.cat 9991632Sphantom.endfor 10091632Sphantom.endfor 10191632Sphantom.endif 10291632Sphantom 10391621Sphantom# 10491621Sphantom 10591621Sphantom.if !defined(NO_NLS) && !empty(NLS) 10691621Sphantomall-nls: ${NLSALL} 10791621Sphantom.else 10891621Sphantomall-nls: 10991621Sphantom.endif 11091621Sphantom 11191632Sphantom.if !defined(NO_NLS) && !empty(NLS) 11291632Sphantomrealinstall: beforeinstall nlsinstall links-nls 11391632Sphantom.else 11491632Sphantomrealinstall: beforeinstall 11591632Sphantom.endif 11691632Sphantom 11791621Sphantomall: all-nls _SUBDIR 11891632Sphantominstall: realinstall afterinstall 11991621Sphantom 12094746Sru.if !target(all-man) 12194746Sruall-man: _SUBDIR 12294746Sru.endif 12394746Sru 12494746Sru.if !target(maninstall) 12594746Srumaninstall: _SUBDIR 12694746Sru.endif 12794746Sru 12891621Sphantom.if !target(distribute) 12991621Sphantomdistribute: 13091621Sphantom.endif 13191621Sphantom 13291621Sphantom.if !target(beforeinstall) 13391621Sphantombeforeinstall: 13491621Sphantom.endif 13591621Sphantom 13691621Sphantom.if !target(afterinstall) 13791621Sphantomafterinstall: 13891621Sphantom.endif 13991621Sphantom 14091621Sphantom.include <bsd.obj.mk> 141