2002-03-04 09:50:28 +00:00
|
|
|
# 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
|
|
|
|
|
2002-04-17 13:49:29 +00:00
|
|
|
.include <bsd.init.mk>
|
|
|
|
|
2002-03-04 09:50:28 +00:00
|
|
|
GENCAT?= gencat -new
|
|
|
|
|
|
|
|
NLSDIR?= ${SHAREDIR}/nls
|
|
|
|
NLSGRP?= ${SHAREGRP}
|
|
|
|
NLSMODE?= ${NOBINMODE}
|
|
|
|
NLSOWN?= ${SHAREOWN}
|
|
|
|
|
|
|
|
NLS?=
|
2002-03-04 12:27:00 +00:00
|
|
|
NLSLINKS=
|
2002-03-04 09:50:28 +00:00
|
|
|
|
|
|
|
.SUFFIXES: .cat .msg
|
|
|
|
|
|
|
|
.msg.cat:
|
|
|
|
${GENCAT} ${.TARGET} ${.IMPSRC}
|
|
|
|
|
|
|
|
#
|
|
|
|
# .msg file pre-build rules
|
|
|
|
#
|
|
|
|
.for file in ${NLS}
|
2002-03-04 10:59:37 +00:00
|
|
|
.if !defined(NLSSRCDIR_${file}) && defined(NLSSRCDIR)
|
|
|
|
NLSSRCDIR_${file}=${NLSSRCDIR}
|
|
|
|
.endif
|
|
|
|
.if !defined(NLSSRCFILES_${file}) && defined(NLSSRCFILES)
|
|
|
|
NLSSRCFILES_${file}=${NLSSRCFILES}
|
|
|
|
.endif
|
|
|
|
|
2002-03-04 09:50:28 +00:00
|
|
|
.if defined(NLSSRCFILES_${file})
|
|
|
|
${file}:
|
|
|
|
@rm -f ${.TARGET}
|
|
|
|
cat ${NLSSRCDIR_${file}}/${NLSSRCFILES_${file}} > ${.TARGET}
|
|
|
|
CLEANFILES+= ${file}
|
2002-03-04 10:59:37 +00:00
|
|
|
.endif
|
2002-03-04 12:27:00 +00:00
|
|
|
|
|
|
|
.if defined(NLSLINKS_${file:C/.msg//g}) && !empty(NLSLINKS_${file:C/.msg//g})
|
|
|
|
NLSLINKS+= ${file:C/.msg//g}
|
|
|
|
.endif
|
2002-03-04 09:50:28 +00:00
|
|
|
.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
|
|
|
|
|
2002-03-04 12:27:00 +00:00
|
|
|
links-nls:
|
|
|
|
.if defined(NLSLINKS) && !empty(NLSLINKS)
|
|
|
|
.for src in ${NLSLINKS}
|
|
|
|
.for dst in ${NLSLINKS_${src}}
|
|
|
|
ln -fs ../${src}/${NLSNAME}.cat \
|
|
|
|
${DESTDIR}${NLSDIR}/${dst}/${NLSNAME}.cat
|
|
|
|
.endfor
|
|
|
|
.endfor
|
|
|
|
.endif
|
|
|
|
|
2002-03-04 09:50:28 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
.if !defined(NO_NLS) && !empty(NLS)
|
|
|
|
all-nls: ${NLSALL}
|
|
|
|
.else
|
|
|
|
all-nls:
|
|
|
|
.endif
|
|
|
|
|
2002-03-04 12:27:00 +00:00
|
|
|
.if !defined(NO_NLS) && !empty(NLS)
|
|
|
|
realinstall: beforeinstall nlsinstall links-nls
|
|
|
|
.else
|
|
|
|
realinstall: beforeinstall
|
|
|
|
.endif
|
|
|
|
|
2002-03-04 09:50:28 +00:00
|
|
|
all: all-nls _SUBDIR
|
2002-03-04 12:27:00 +00:00
|
|
|
install: realinstall afterinstall
|
2002-03-04 09:50:28 +00:00
|
|
|
|
2002-04-15 10:16:26 +00:00
|
|
|
.if !target(all-man)
|
|
|
|
all-man: _SUBDIR
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(maninstall)
|
|
|
|
maninstall: _SUBDIR
|
|
|
|
.endif
|
|
|
|
|
2002-03-04 09:50:28 +00:00
|
|
|
.if !target(distribute)
|
|
|
|
distribute:
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(beforeinstall)
|
|
|
|
beforeinstall:
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.if !target(afterinstall)
|
|
|
|
afterinstall:
|
|
|
|
.endif
|
|
|
|
|
|
|
|
.include <bsd.obj.mk>
|