1# Based on $NetBSD: bsd.nls.mk,v 1.35 2001/11/28 20:19:08 tv Exp $
| 1# Based on $NetBSD: bsd.nls.mk,v 1.35 2001/11/28 20:19:08 tv Exp $
|
2# $FreeBSD: head/share/mk/bsd.nls.mk 91628 2002-03-04 10:59:37Z phantom $
| 2# $FreeBSD: head/share/mk/bsd.nls.mk 91632 2002-03-04 12:27:00Z phantom $
|
3# 4# This include file <bsd.nls.mk> handles building and installing Native 5# Language Support (NLS) catalogs 6# 7# +++ variables +++ 8# 9# GENCAT A program for converting .msg files into compiled NLS 10# .cat files. [gencat -new] 11# 12# NLS Source or intermediate .msg files. [set in Makefile] 13# 14# NLSDIR Base path for National Language Support files 15# installation. [${SHAREDIR}/nls] 16# 17# NLSGRP National Language Support files group. [${SHAREGRP}] 18# 19# NLSMODE National Language Support files mode. [${NOBINMODE}] 20# 21# NLSOWN National Language Support files owner. [${SHAREOWN}] 22# 23# NO_NLS Do not make or install NLS files. [not set] 24# 25# +++ targets +++ 26# 27# install: 28# Install compiled NLS files 29# 30# bsd.obj.mk: cleandir and obj 31 32GENCAT?= gencat -new 33 34NLSDIR?= ${SHAREDIR}/nls 35NLSGRP?= ${SHAREGRP} 36NLSMODE?= ${NOBINMODE} 37NLSOWN?= ${SHAREOWN} 38 39NLS?=
| 3# 4# This include file <bsd.nls.mk> handles building and installing Native 5# Language Support (NLS) catalogs 6# 7# +++ variables +++ 8# 9# GENCAT A program for converting .msg files into compiled NLS 10# .cat files. [gencat -new] 11# 12# NLS Source or intermediate .msg files. [set in Makefile] 13# 14# NLSDIR Base path for National Language Support files 15# installation. [${SHAREDIR}/nls] 16# 17# NLSGRP National Language Support files group. [${SHAREGRP}] 18# 19# NLSMODE National Language Support files mode. [${NOBINMODE}] 20# 21# NLSOWN National Language Support files owner. [${SHAREOWN}] 22# 23# NO_NLS Do not make or install NLS files. [not set] 24# 25# +++ targets +++ 26# 27# install: 28# Install compiled NLS files 29# 30# bsd.obj.mk: cleandir and obj 31 32GENCAT?= gencat -new 33 34NLSDIR?= ${SHAREDIR}/nls 35NLSGRP?= ${SHAREGRP} 36NLSMODE?= ${NOBINMODE} 37NLSOWN?= ${SHAREOWN} 38 39NLS?=
|
| 40NLSLINKS=
|
40 41.MAIN: all 42 43.SUFFIXES: .cat .msg 44 45.msg.cat: 46 ${GENCAT} ${.TARGET} ${.IMPSRC} 47 48# 49# .msg file pre-build rules 50# 51.for file in ${NLS} 52.if !defined(NLSSRCDIR_${file}) && defined(NLSSRCDIR) 53NLSSRCDIR_${file}=${NLSSRCDIR} 54.endif 55.if !defined(NLSSRCFILES_${file}) && defined(NLSSRCFILES) 56NLSSRCFILES_${file}=${NLSSRCFILES} 57.endif 58 59.if defined(NLSSRCFILES_${file}) 60${file}: 61 @rm -f ${.TARGET} 62 cat ${NLSSRCDIR_${file}}/${NLSSRCFILES_${file}} > ${.TARGET} 63CLEANFILES+= ${file} 64.endif
| 41 42.MAIN: all 43 44.SUFFIXES: .cat .msg 45 46.msg.cat: 47 ${GENCAT} ${.TARGET} ${.IMPSRC} 48 49# 50# .msg file pre-build rules 51# 52.for file in ${NLS} 53.if !defined(NLSSRCDIR_${file}) && defined(NLSSRCDIR) 54NLSSRCDIR_${file}=${NLSSRCDIR} 55.endif 56.if !defined(NLSSRCFILES_${file}) && defined(NLSSRCFILES) 57NLSSRCFILES_${file}=${NLSSRCFILES} 58.endif 59 60.if defined(NLSSRCFILES_${file}) 61${file}: 62 @rm -f ${.TARGET} 63 cat ${NLSSRCDIR_${file}}/${NLSSRCFILES_${file}} > ${.TARGET} 64CLEANFILES+= ${file} 65.endif
|
| 66 67.if defined(NLSLINKS_${file:C/.msg//g}) && !empty(NLSLINKS_${file:C/.msg//g}) 68NLSLINKS+= ${file:C/.msg//g} 69.endif
|
65.endfor 66 67# 68# .cat file build rules 69# 70NLSALL= ${NLS:.msg=.cat} 71CLEANFILES+= ${NLSALL} 72 73# 74# installation rules 75# 76__nlsinstall: .USE 77 ${INSTALL} -o ${NLSOWN} -g ${NLSGRP} -m ${NLSMODE} \ 78 ${.ALLSRC} ${.TARGET} 79 80.for F in ${NLSALL} 81_F:= ${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat 82 83${_F}: ${F} __nlsinstall # install rule 84nlsinstall:: ${_F} 85.PRECIOUS: ${_F} # keep if install fails 86.endfor 87
| 70.endfor 71 72# 73# .cat file build rules 74# 75NLSALL= ${NLS:.msg=.cat} 76CLEANFILES+= ${NLSALL} 77 78# 79# installation rules 80# 81__nlsinstall: .USE 82 ${INSTALL} -o ${NLSOWN} -g ${NLSGRP} -m ${NLSMODE} \ 83 ${.ALLSRC} ${.TARGET} 84 85.for F in ${NLSALL} 86_F:= ${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat 87 88${_F}: ${F} __nlsinstall # install rule 89nlsinstall:: ${_F} 90.PRECIOUS: ${_F} # keep if install fails 91.endfor 92
|
| 93links-nls: 94.if defined(NLSLINKS) && !empty(NLSLINKS) 95.for src in ${NLSLINKS} 96.for dst in ${NLSLINKS_${src}} 97 ln -fs ../${src}/${NLSNAME}.cat \ 98 ${DESTDIR}${NLSDIR}/${dst}/${NLSNAME}.cat 99.endfor 100.endfor 101.endif 102
|
88# 89 90.if !defined(NO_NLS) && !empty(NLS) 91all-nls: ${NLSALL} 92.else 93all-nls: 94.endif 95
| 103# 104 105.if !defined(NO_NLS) && !empty(NLS) 106all-nls: ${NLSALL} 107.else 108all-nls: 109.endif 110
|
| 111.if !defined(NO_NLS) && !empty(NLS) 112realinstall: beforeinstall nlsinstall links-nls 113.else 114realinstall: beforeinstall 115.endif 116
|
96all: all-nls _SUBDIR
| 117all: all-nls _SUBDIR
|
97install: beforeinstall nlsinstall afterinstall
| 118install: realinstall afterinstall
|
98 99.if !target(distribute) 100distribute: 101.endif 102 103.if !target(beforeinstall) 104beforeinstall: 105.endif 106 107.if !target(afterinstall) 108afterinstall: 109.endif 110 111.include <bsd.obj.mk>
| 119 120.if !target(distribute) 121distribute: 122.endif 123 124.if !target(beforeinstall) 125beforeinstall: 126.endif 127 128.if !target(afterinstall) 129afterinstall: 130.endif 131 132.include <bsd.obj.mk>
|