diff options
author | Ruslan Ermilov <ru@FreeBSD.org> | 2002-07-02 12:37:09 +0000 |
---|---|---|
committer | Ruslan Ermilov <ru@FreeBSD.org> | 2002-07-02 12:37:09 +0000 |
commit | 8479adc1d3d8677ec1137981cf6715b1a5b96073 (patch) | |
tree | 91ad217324f8e79373a55d46b03690c4339c7ea5 /share/mk/bsd.nls.mk | |
parent | 84f94a79a03d9df7f22224ac30832e6944991dad (diff) | |
download | src-8479adc1d3d8677ec1137981cf6715b1a5b96073.tar.gz src-8479adc1d3d8677ec1137981cf6715b1a5b96073.zip |
Reimplemented bsd.nls.mk using bsd.files.mk and bsd.links.mk.
Provided the (previously missing) dependency on source files
for intermediate .msg files.
Provided the default for NLSSRCDIR (defaults to .CURDIR).
Slightly changed the API: NLS should now list plain locale
names, without the .msg suffix.
When included from bsd.prog.mk, NLSNAME defaults to PROG.
Notes
Notes:
svn path=/head/; revision=99257
Diffstat (limited to 'share/mk/bsd.nls.mk')
-rw-r--r-- | share/mk/bsd.nls.mk | 102 |
1 files changed, 25 insertions, 77 deletions
diff --git a/share/mk/bsd.nls.mk b/share/mk/bsd.nls.mk index bbf481b21c5e..34896ccaaf5b 100644 --- a/share/mk/bsd.nls.mk +++ b/share/mk/bsd.nls.mk @@ -1,4 +1,3 @@ -# 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 @@ -21,108 +20,57 @@ # 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 -.include <bsd.init.mk> +.if !target(__<bsd.init.mk>__) +.error bsd.nls.mk cannot be included directly. +.endif GENCAT?= gencat -new -NLSDIR?= ${SHAREDIR}/nls -NLSGRP?= ${SHAREGRP} -NLSMODE?= ${NOBINMODE} -NLSOWN?= ${SHAREOWN} - -NLS?= -NLSLINKS= - .SUFFIXES: .cat .msg .msg.cat: ${GENCAT} ${.TARGET} ${.IMPSRC} +.if defined(NLS) && !empty(NLS) && !defined(NO_NLS) + # # .msg file pre-build rules # +NLSSRCDIR?= ${.CURDIR} .for file in ${NLS} -.if !defined(NLSSRCDIR_${file}) && defined(NLSSRCDIR) -NLSSRCDIR_${file}=${NLSSRCDIR} -.endif -.if !defined(NLSSRCFILES_${file}) && defined(NLSSRCFILES) -NLSSRCFILES_${file}=${NLSSRCFILES} +.if defined(NLSSRCFILES) +NLSSRCFILES_${file}?= ${NLSSRCFILES} .endif - .if defined(NLSSRCFILES_${file}) -${file}: +NLSSRCDIR_${file}?= ${NLSSRCDIR} +${file}.msg: ${NLSSRCFILES_${file}:S/^/${NLSSRCDIR_${file}}\//} @rm -f ${.TARGET} - cat ${NLSSRCDIR_${file}}/${NLSSRCFILES_${file}} > ${.TARGET} -CLEANFILES+= ${file} -.endif - -.if defined(NLSLINKS_${file:C/.msg//g}) && !empty(NLSLINKS_${file:C/.msg//g}) -NLSLINKS+= ${file:C/.msg//g} + cat ${.ALLSRC} > ${.TARGET} +CLEANFILES+= ${file}.msg .endif .endfor # # .cat file build rules # -NLSALL= ${NLS:.msg=.cat} -CLEANFILES+= ${NLSALL} +NLS:= ${NLS:=.cat} +CLEANFILES+= ${NLS} +FILESGROUPS?= FILES +FILESGROUPS+= NLS +NLSDIR?= ${SHAREDIR}/nls # # 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 - -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 +.for file in ${NLS} +NLSNAME_${file:T}= ${file:T:R}/${NLSNAME}.cat +.if defined(NLSLINKS_${file:R}) && !empty(NLSLINKS_${file:R}) +NLSLINKS+= ${file:R} +.endif +.for dst in ${NLSLINKS_${file:R}} +SYMLINKS+= ../${file:R}/${NLSNAME}.cat ${NLSDIR}/${dst}/${NLSNAME}.cat .endfor .endfor -.endif - -# - -.if !defined(NO_NLS) && !empty(NLS) -all-nls: ${NLSALL} -.else -all-nls: -.endif - -.if !defined(NO_NLS) && !empty(NLS) -realinstall: beforeinstall nlsinstall links-nls -.else -realinstall: beforeinstall -.endif - -all: all-nls -install: realinstall afterinstall - -.if !target(beforeinstall) -beforeinstall: -.endif - -.if !target(afterinstall) -afterinstall: -.endif -.include <bsd.obj.mk> +.endif defined(NLS) && !empty(NLS) && !defined(NO_NLS) |