diff options
author | phantom <phantom@FreeBSD.org> | 2002-03-04 09:50:28 +0000 |
---|---|---|
committer | phantom <phantom@FreeBSD.org> | 2002-03-04 09:50:28 +0000 |
commit | 7cccef054ffd00b0bb9ba2e49f433472632a5ab5 (patch) | |
tree | b47b02be95d5e75cb56f56a4ba390b35913264d6 /share/mk | |
parent | dc2d000aa4f2db0d2f362a53018164d3723cd480 (diff) | |
download | FreeBSD-src-7cccef054ffd00b0bb9ba2e49f433472632a5ab5.zip FreeBSD-src-7cccef054ffd00b0bb9ba2e49f433472632a5ab5.tar.gz |
Add basic infrastructure for building and installing Message Catalogs (NLS Catalogs)
Idea obtained from: NetBSD
Reviewed by: silence at -hackers
Diffstat (limited to 'share/mk')
-rw-r--r-- | share/mk/Makefile | 2 | ||||
-rw-r--r-- | share/mk/bsd.nls.mk | 106 |
2 files changed, 107 insertions, 1 deletions
diff --git a/share/mk/Makefile b/share/mk/Makefile index 1c17e9a..b5c104b 100644 --- a/share/mk/Makefile +++ b/share/mk/Makefile @@ -3,7 +3,7 @@ FILES= bsd.README FILES+= bsd.cpu.mk bsd.dep.mk bsd.doc.mk bsd.docb.mk bsd.info.mk bsd.kern.mk bsd.kmod.mk -FILES+= bsd.lib.mk bsd.libnames.mk bsd.man.mk bsd.obj.mk bsd.own.mk +FILES+= bsd.lib.mk bsd.libnames.mk bsd.man.mk bsd.nls.mk bsd.obj.mk bsd.own.mk FILES+= bsd.port.mk bsd.port.post.mk bsd.port.pre.mk bsd.port.subdir.mk FILES+= bsd.prog.mk bsd.sgml.mk bsd.subdir.mk bsd.sys.mk FILES+= sys.mk diff --git a/share/mk/bsd.nls.mk b/share/mk/bsd.nls.mk new file mode 100644 index 0000000..5725fba --- /dev/null +++ b/share/mk/bsd.nls.mk @@ -0,0 +1,106 @@ +# Based on $NetBSD: bsd.nls.mk,v 1.35 2001/11/28 20:19:08 tv Exp $ +# $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 -new] +# +# 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}] +# +# NO_NLS Do not make or install NLS files. [not set] +# +# +++ targets +++ +# +# install: +# Install compiled NLS files +# +# bsd.obj.mk: cleandir and obj + +GENCAT?= gencat -new +# from NetBSD -- to use in libraries +#NLSNAME?= ${PROG:Ulib${LIB}} + +NLSDIR?= ${SHAREDIR}/nls +NLSGRP?= ${SHAREGRP} +NLSMODE?= ${NOBINMODE} +NLSOWN?= ${SHAREOWN} + +NLS?= + +.MAIN: all + +.SUFFIXES: .cat .msg + +.msg.cat: + ${GENCAT} ${.TARGET} ${.IMPSRC} + +# +# .msg file pre-build rules +# +.for file in ${NLS} +.if defined(NLSSRCFILES_${file}) +${file}: + @rm -f ${.TARGET} + cat ${NLSSRCDIR_${file}}/${NLSSRCFILES_${file}} > ${.TARGET} +.endif +CLEANFILES+= ${file} +.endfor + +# +# .cat file build rules +# +NLSALL= ${NLS:.msg=.cat} +CLEANFILES+= ${NLSALL} + +# +# installation rules +# +__nlsinstall: .USE + ${INSTALL} -o ${NLSOWN} -g ${NLSGRP} -m ${NLSMODE} \ + ${.ALLSRC} ${.TARGET} + +.for F in ${NLSALL} +_F:= ${DESTDIR}${NLSDIR}/${F:T:R}/${NLSNAME}.cat + +${_F}: ${F} __nlsinstall # install rule +nlsinstall:: ${_F} +.PRECIOUS: ${_F} # keep if install fails +.endfor + +# + +.if !defined(NO_NLS) && !empty(NLS) +all-nls: ${NLSALL} +.else +all-nls: +.endif + +all: all-nls _SUBDIR +install: beforeinstall nlsinstall afterinstall + +.if !target(distribute) +distribute: +.endif + +.if !target(beforeinstall) +beforeinstall: +.endif + +.if !target(afterinstall) +afterinstall: +.endif + +.include <bsd.obj.mk> |