1*0a6a1f1dSLionel Sambuc# Makefile for PO directory in any package using GNU gettext. 2*0a6a1f1dSLionel Sambuc# Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper <drepper@gnu.ai.mit.edu> 3*0a6a1f1dSLionel Sambuc# 4*0a6a1f1dSLionel Sambuc# This file can be copied and used freely without restrictions. It can 5*0a6a1f1dSLionel Sambuc# be used in projects which are not available under the GNU General Public 6*0a6a1f1dSLionel Sambuc# License but which still want to provide support for the GNU gettext 7*0a6a1f1dSLionel Sambuc# functionality. 8*0a6a1f1dSLionel Sambuc# Please note that the actual code of GNU gettext is covered by the GNU 9*0a6a1f1dSLionel Sambuc# General Public License and is *not* in the public domain. 10*0a6a1f1dSLionel Sambuc# 11*0a6a1f1dSLionel Sambuc# Origin: gettext-0.18 12*0a6a1f1dSLionel SambucGETTEXT_MACRO_VERSION = 0.18 13*0a6a1f1dSLionel Sambuc 14*0a6a1f1dSLionel SambucPACKAGE = flex 15*0a6a1f1dSLionel SambucVERSION = 2.5.39 16*0a6a1f1dSLionel SambucPACKAGE_BUGREPORT = flex-help@lists.sourceforge.net 17*0a6a1f1dSLionel Sambuc 18*0a6a1f1dSLionel SambucSHELL = /bin/sh 19*0a6a1f1dSLionel Sambuc 20*0a6a1f1dSLionel Sambuc 21*0a6a1f1dSLionel Sambucsrcdir = . 22*0a6a1f1dSLionel Sambuctop_srcdir = .. 23*0a6a1f1dSLionel Sambuc 24*0a6a1f1dSLionel Sambuc 25*0a6a1f1dSLionel Sambucprefix = /usr/local 26*0a6a1f1dSLionel Sambucexec_prefix = ${prefix} 27*0a6a1f1dSLionel Sambucdatarootdir = ${prefix}/share 28*0a6a1f1dSLionel Sambucdatadir = ${datarootdir} 29*0a6a1f1dSLionel Sambuclocaledir = ${datarootdir}/locale 30*0a6a1f1dSLionel Sambucgettextsrcdir = $(datadir)/gettext/po 31*0a6a1f1dSLionel Sambuc 32*0a6a1f1dSLionel SambucINSTALL = /usr/bin/install -c 33*0a6a1f1dSLionel SambucINSTALL_DATA = ${INSTALL} -m 644 34*0a6a1f1dSLionel Sambuc 35*0a6a1f1dSLionel Sambuc# We use $(mkdir_p). 36*0a6a1f1dSLionel Sambuc# In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as 37*0a6a1f1dSLionel Sambuc# "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions, 38*0a6a1f1dSLionel Sambuc# ${SHELL} /usr/src/external/bsd/flex/flex-2.5.39/install-sh does not start with $(SHELL), so we add it. 39*0a6a1f1dSLionel Sambuc# In automake >= 1.10, $(top_builddir)/./install-sh -c -d is derived from ${MKDIR_P}, which is defined 40*0a6a1f1dSLionel Sambuc# either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake 41*0a6a1f1dSLionel Sambuc# versions, $(mkinstalldirs) and $(install_sh) are unused. 42*0a6a1f1dSLionel Sambucmkinstalldirs = $(SHELL) ${SHELL} /usr/src/external/bsd/flex/flex-2.5.39/install-sh -d 43*0a6a1f1dSLionel Sambucinstall_sh = $(SHELL) ${SHELL} /usr/src/external/bsd/flex/flex-2.5.39/install-sh 44*0a6a1f1dSLionel SambucMKDIR_P = .././install-sh -c -d 45*0a6a1f1dSLionel Sambucmkdir_p = $(top_builddir)/./install-sh -c -d 46*0a6a1f1dSLionel Sambuc 47*0a6a1f1dSLionel SambucGMSGFMT_ = /usr/pkg/bin/msgfmt 48*0a6a1f1dSLionel SambucGMSGFMT_no = /usr/pkg/bin/msgfmt 49*0a6a1f1dSLionel SambucGMSGFMT_yes = /usr/pkg/bin/msgfmt 50*0a6a1f1dSLionel SambucGMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) 51*0a6a1f1dSLionel SambucMSGFMT_ = /usr/pkg/bin/msgfmt 52*0a6a1f1dSLionel SambucMSGFMT_no = /usr/pkg/bin/msgfmt 53*0a6a1f1dSLionel SambucMSGFMT_yes = /usr/pkg/bin/msgfmt 54*0a6a1f1dSLionel SambucMSGFMT = $(MSGFMT_$(USE_MSGCTXT)) 55*0a6a1f1dSLionel SambucXGETTEXT_ = /usr/pkg/bin/xgettext 56*0a6a1f1dSLionel SambucXGETTEXT_no = /usr/pkg/bin/xgettext 57*0a6a1f1dSLionel SambucXGETTEXT_yes = /usr/pkg/bin/xgettext 58*0a6a1f1dSLionel SambucXGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) 59*0a6a1f1dSLionel SambucMSGMERGE = msgmerge 60*0a6a1f1dSLionel SambucMSGMERGE_UPDATE = /usr/pkg/bin/msgmerge --update 61*0a6a1f1dSLionel SambucMSGINIT = msginit 62*0a6a1f1dSLionel SambucMSGCONV = msgconv 63*0a6a1f1dSLionel SambucMSGFILTER = msgfilter 64*0a6a1f1dSLionel Sambuc 65*0a6a1f1dSLionel SambucPOFILES = @POFILES@ 66*0a6a1f1dSLionel SambucGMOFILES = @GMOFILES@ 67*0a6a1f1dSLionel SambucUPDATEPOFILES = @UPDATEPOFILES@ 68*0a6a1f1dSLionel SambucDUMMYPOFILES = @DUMMYPOFILES@ 69*0a6a1f1dSLionel SambucDISTFILES.common = Makefile.in.in remove-potcdate.sin \ 70*0a6a1f1dSLionel Sambuc$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) 71*0a6a1f1dSLionel SambucDISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ 72*0a6a1f1dSLionel Sambuc$(POFILES) $(GMOFILES) \ 73*0a6a1f1dSLionel Sambuc$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) 74*0a6a1f1dSLionel Sambuc 75*0a6a1f1dSLionel SambucPOTFILES = \ 76*0a6a1f1dSLionel Sambuc 77*0a6a1f1dSLionel SambucCATALOGS = @CATALOGS@ 78*0a6a1f1dSLionel Sambuc 79*0a6a1f1dSLionel Sambuc# Makevars gets inserted here. (Don't remove this line!) 80*0a6a1f1dSLionel Sambuc 81*0a6a1f1dSLionel Sambuc.SUFFIXES: 82*0a6a1f1dSLionel Sambuc.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update 83*0a6a1f1dSLionel Sambuc 84*0a6a1f1dSLionel Sambuc.po.mo: 85*0a6a1f1dSLionel Sambuc @echo "$(MSGFMT) -c -o $@ $<"; \ 86*0a6a1f1dSLionel Sambuc $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ 87*0a6a1f1dSLionel Sambuc 88*0a6a1f1dSLionel Sambuc.po.gmo: 89*0a6a1f1dSLionel Sambuc @lang=`echo $* | sed -e 's,.*/,,'`; \ 90*0a6a1f1dSLionel Sambuc test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ 91*0a6a1f1dSLionel Sambuc echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \ 92*0a6a1f1dSLionel Sambuc cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo 93*0a6a1f1dSLionel Sambuc 94*0a6a1f1dSLionel Sambuc.sin.sed: 95*0a6a1f1dSLionel Sambuc sed -e '/^#/d' $< > t-$@ 96*0a6a1f1dSLionel Sambuc mv t-$@ $@ 97*0a6a1f1dSLionel Sambuc 98*0a6a1f1dSLionel Sambuc 99*0a6a1f1dSLionel Sambucall: check-macro-version all-no 100*0a6a1f1dSLionel Sambuc 101*0a6a1f1dSLionel Sambucall-yes: stamp-po 102*0a6a1f1dSLionel Sambucall-no: 103*0a6a1f1dSLionel Sambuc 104*0a6a1f1dSLionel Sambuc# Ensure that the gettext macros and this Makefile.in.in are in sync. 105*0a6a1f1dSLionel Sambuccheck-macro-version: 106*0a6a1f1dSLionel Sambuc @test "$(GETTEXT_MACRO_VERSION)" = "0.18" \ 107*0a6a1f1dSLionel Sambuc || { echo "*** error: gettext infrastructure mismatch: using a Makefile.in.in from gettext version $(GETTEXT_MACRO_VERSION) but the autoconf macros are from gettext version 0.18" 1>&2; \ 108*0a6a1f1dSLionel Sambuc exit 1; \ 109*0a6a1f1dSLionel Sambuc } 110*0a6a1f1dSLionel Sambuc 111*0a6a1f1dSLionel Sambuc# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no 112*0a6a1f1dSLionel Sambuc# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because 113*0a6a1f1dSLionel Sambuc# we don't want to bother translators with empty POT files). We assume that 114*0a6a1f1dSLionel Sambuc# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. 115*0a6a1f1dSLionel Sambuc# In this case, stamp-po is a nop (i.e. a phony target). 116*0a6a1f1dSLionel Sambuc 117*0a6a1f1dSLionel Sambuc# stamp-po is a timestamp denoting the last time at which the CATALOGS have 118*0a6a1f1dSLionel Sambuc# been loosely updated. Its purpose is that when a developer or translator 119*0a6a1f1dSLionel Sambuc# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, 120*0a6a1f1dSLionel Sambuc# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent 121*0a6a1f1dSLionel Sambuc# invocations of "make" will do nothing. This timestamp would not be necessary 122*0a6a1f1dSLionel Sambuc# if updating the $(CATALOGS) would always touch them; however, the rule for 123*0a6a1f1dSLionel Sambuc# $(POFILES) has been designed to not touch files that don't need to be 124*0a6a1f1dSLionel Sambuc# changed. 125*0a6a1f1dSLionel Sambucstamp-po: $(srcdir)/$(DOMAIN).pot 126*0a6a1f1dSLionel Sambuc test ! -f $(srcdir)/$(DOMAIN).pot || \ 127*0a6a1f1dSLionel Sambuc test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) 128*0a6a1f1dSLionel Sambuc @test ! -f $(srcdir)/$(DOMAIN).pot || { \ 129*0a6a1f1dSLionel Sambuc echo "touch stamp-po" && \ 130*0a6a1f1dSLionel Sambuc echo timestamp > stamp-poT && \ 131*0a6a1f1dSLionel Sambuc mv stamp-poT stamp-po; \ 132*0a6a1f1dSLionel Sambuc } 133*0a6a1f1dSLionel Sambuc 134*0a6a1f1dSLionel Sambuc# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', 135*0a6a1f1dSLionel Sambuc# otherwise packages like GCC can not be built if only parts of the source 136*0a6a1f1dSLionel Sambuc# have been downloaded. 137*0a6a1f1dSLionel Sambuc 138*0a6a1f1dSLionel Sambuc# This target rebuilds $(DOMAIN).pot; it is an expensive operation. 139*0a6a1f1dSLionel Sambuc# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. 140*0a6a1f1dSLionel Sambuc$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed 141*0a6a1f1dSLionel Sambuc if LC_ALL=C grep 'GNU flex' $(top_srcdir)/* 2>/dev/null | grep -v 'libtool:' >/dev/null; then \ 142*0a6a1f1dSLionel Sambuc package_gnu='GNU '; \ 143*0a6a1f1dSLionel Sambuc else \ 144*0a6a1f1dSLionel Sambuc package_gnu=''; \ 145*0a6a1f1dSLionel Sambuc fi; \ 146*0a6a1f1dSLionel Sambuc if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ 147*0a6a1f1dSLionel Sambuc msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ 148*0a6a1f1dSLionel Sambuc else \ 149*0a6a1f1dSLionel Sambuc msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ 150*0a6a1f1dSLionel Sambuc fi; \ 151*0a6a1f1dSLionel Sambuc case `$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ 152*0a6a1f1dSLionel Sambuc '' | 0.[0-9] | 0.[0-9].* | 0.1[0-5] | 0.1[0-5].* | 0.16 | 0.16.[0-1]*) \ 153*0a6a1f1dSLionel Sambuc $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ 154*0a6a1f1dSLionel Sambuc --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ 155*0a6a1f1dSLionel Sambuc --files-from=$(srcdir)/POTFILES.in \ 156*0a6a1f1dSLionel Sambuc --copyright-holder='$(COPYRIGHT_HOLDER)' \ 157*0a6a1f1dSLionel Sambuc --msgid-bugs-address="$$msgid_bugs_address" \ 158*0a6a1f1dSLionel Sambuc ;; \ 159*0a6a1f1dSLionel Sambuc *) \ 160*0a6a1f1dSLionel Sambuc $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ 161*0a6a1f1dSLionel Sambuc --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ 162*0a6a1f1dSLionel Sambuc --files-from=$(srcdir)/POTFILES.in \ 163*0a6a1f1dSLionel Sambuc --copyright-holder='$(COPYRIGHT_HOLDER)' \ 164*0a6a1f1dSLionel Sambuc --package-name="$${package_gnu}flex" \ 165*0a6a1f1dSLionel Sambuc --package-version='2.5.39' \ 166*0a6a1f1dSLionel Sambuc --msgid-bugs-address="$$msgid_bugs_address" \ 167*0a6a1f1dSLionel Sambuc ;; \ 168*0a6a1f1dSLionel Sambuc esac 169*0a6a1f1dSLionel Sambuc test ! -f $(DOMAIN).po || { \ 170*0a6a1f1dSLionel Sambuc if test -f $(srcdir)/$(DOMAIN).pot; then \ 171*0a6a1f1dSLionel Sambuc sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ 172*0a6a1f1dSLionel Sambuc sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ 173*0a6a1f1dSLionel Sambuc if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ 174*0a6a1f1dSLionel Sambuc rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ 175*0a6a1f1dSLionel Sambuc else \ 176*0a6a1f1dSLionel Sambuc rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ 177*0a6a1f1dSLionel Sambuc mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ 178*0a6a1f1dSLionel Sambuc fi; \ 179*0a6a1f1dSLionel Sambuc else \ 180*0a6a1f1dSLionel Sambuc mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ 181*0a6a1f1dSLionel Sambuc fi; \ 182*0a6a1f1dSLionel Sambuc } 183*0a6a1f1dSLionel Sambuc 184*0a6a1f1dSLionel Sambuc# This rule has no dependencies: we don't need to update $(DOMAIN).pot at 185*0a6a1f1dSLionel Sambuc# every "make" invocation, only create it when it is missing. 186*0a6a1f1dSLionel Sambuc# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. 187*0a6a1f1dSLionel Sambuc$(srcdir)/$(DOMAIN).pot: 188*0a6a1f1dSLionel Sambuc $(MAKE) $(DOMAIN).pot-update 189*0a6a1f1dSLionel Sambuc 190*0a6a1f1dSLionel Sambuc# This target rebuilds a PO file if $(DOMAIN).pot has changed. 191*0a6a1f1dSLionel Sambuc# Note that a PO file is not touched if it doesn't need to be changed. 192*0a6a1f1dSLionel Sambuc$(POFILES): $(srcdir)/$(DOMAIN).pot 193*0a6a1f1dSLionel Sambuc @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ 194*0a6a1f1dSLionel Sambuc if test -f "$(srcdir)/$${lang}.po"; then \ 195*0a6a1f1dSLionel Sambuc test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ 196*0a6a1f1dSLionel Sambuc echo "$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \ 197*0a6a1f1dSLionel Sambuc cd $(srcdir) \ 198*0a6a1f1dSLionel Sambuc && { case `$(MSGMERGE_UPDATE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ 199*0a6a1f1dSLionel Sambuc '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ 200*0a6a1f1dSLionel Sambuc $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) $${lang}.po $(DOMAIN).pot;; \ 201*0a6a1f1dSLionel Sambuc *) \ 202*0a6a1f1dSLionel Sambuc $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot;; \ 203*0a6a1f1dSLionel Sambuc esac; \ 204*0a6a1f1dSLionel Sambuc }; \ 205*0a6a1f1dSLionel Sambuc else \ 206*0a6a1f1dSLionel Sambuc $(MAKE) $${lang}.po-create; \ 207*0a6a1f1dSLionel Sambuc fi 208*0a6a1f1dSLionel Sambuc 209*0a6a1f1dSLionel Sambuc 210*0a6a1f1dSLionel Sambucinstall: install-exec install-data 211*0a6a1f1dSLionel Sambucinstall-exec: 212*0a6a1f1dSLionel Sambucinstall-data: install-data-no 213*0a6a1f1dSLionel Sambuc if test "$(PACKAGE)" = "gettext-tools"; then \ 214*0a6a1f1dSLionel Sambuc $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ 215*0a6a1f1dSLionel Sambuc for file in $(DISTFILES.common) Makevars.template; do \ 216*0a6a1f1dSLionel Sambuc $(INSTALL_DATA) $(srcdir)/$$file \ 217*0a6a1f1dSLionel Sambuc $(DESTDIR)$(gettextsrcdir)/$$file; \ 218*0a6a1f1dSLionel Sambuc done; \ 219*0a6a1f1dSLionel Sambuc for file in Makevars; do \ 220*0a6a1f1dSLionel Sambuc rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ 221*0a6a1f1dSLionel Sambuc done; \ 222*0a6a1f1dSLionel Sambuc else \ 223*0a6a1f1dSLionel Sambuc : ; \ 224*0a6a1f1dSLionel Sambuc fi 225*0a6a1f1dSLionel Sambucinstall-data-no: all 226*0a6a1f1dSLionel Sambucinstall-data-yes: all 227*0a6a1f1dSLionel Sambuc @catalogs='$(CATALOGS)'; \ 228*0a6a1f1dSLionel Sambuc for cat in $$catalogs; do \ 229*0a6a1f1dSLionel Sambuc cat=`basename $$cat`; \ 230*0a6a1f1dSLionel Sambuc lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ 231*0a6a1f1dSLionel Sambuc dir=$(localedir)/$$lang/LC_MESSAGES; \ 232*0a6a1f1dSLionel Sambuc $(mkdir_p) $(DESTDIR)$$dir; \ 233*0a6a1f1dSLionel Sambuc if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ 234*0a6a1f1dSLionel Sambuc $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ 235*0a6a1f1dSLionel Sambuc echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ 236*0a6a1f1dSLionel Sambuc for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ 237*0a6a1f1dSLionel Sambuc if test -n "$$lc"; then \ 238*0a6a1f1dSLionel Sambuc if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ 239*0a6a1f1dSLionel Sambuc link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ 240*0a6a1f1dSLionel Sambuc mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ 241*0a6a1f1dSLionel Sambuc mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ 242*0a6a1f1dSLionel Sambuc (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ 243*0a6a1f1dSLionel Sambuc for file in *; do \ 244*0a6a1f1dSLionel Sambuc if test -f $$file; then \ 245*0a6a1f1dSLionel Sambuc ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ 246*0a6a1f1dSLionel Sambuc fi; \ 247*0a6a1f1dSLionel Sambuc done); \ 248*0a6a1f1dSLionel Sambuc rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ 249*0a6a1f1dSLionel Sambuc else \ 250*0a6a1f1dSLionel Sambuc if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ 251*0a6a1f1dSLionel Sambuc :; \ 252*0a6a1f1dSLionel Sambuc else \ 253*0a6a1f1dSLionel Sambuc rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ 254*0a6a1f1dSLionel Sambuc mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ 255*0a6a1f1dSLionel Sambuc fi; \ 256*0a6a1f1dSLionel Sambuc fi; \ 257*0a6a1f1dSLionel Sambuc rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ 258*0a6a1f1dSLionel Sambuc ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ 259*0a6a1f1dSLionel Sambuc ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ 260*0a6a1f1dSLionel Sambuc cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ 261*0a6a1f1dSLionel Sambuc echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ 262*0a6a1f1dSLionel Sambuc fi; \ 263*0a6a1f1dSLionel Sambuc done; \ 264*0a6a1f1dSLionel Sambuc done 265*0a6a1f1dSLionel Sambuc 266*0a6a1f1dSLionel Sambucinstall-strip: install 267*0a6a1f1dSLionel Sambuc 268*0a6a1f1dSLionel Sambucinstalldirs: installdirs-exec installdirs-data 269*0a6a1f1dSLionel Sambucinstalldirs-exec: 270*0a6a1f1dSLionel Sambucinstalldirs-data: installdirs-data-no 271*0a6a1f1dSLionel Sambuc if test "$(PACKAGE)" = "gettext-tools"; then \ 272*0a6a1f1dSLionel Sambuc $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ 273*0a6a1f1dSLionel Sambuc else \ 274*0a6a1f1dSLionel Sambuc : ; \ 275*0a6a1f1dSLionel Sambuc fi 276*0a6a1f1dSLionel Sambucinstalldirs-data-no: 277*0a6a1f1dSLionel Sambucinstalldirs-data-yes: 278*0a6a1f1dSLionel Sambuc @catalogs='$(CATALOGS)'; \ 279*0a6a1f1dSLionel Sambuc for cat in $$catalogs; do \ 280*0a6a1f1dSLionel Sambuc cat=`basename $$cat`; \ 281*0a6a1f1dSLionel Sambuc lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ 282*0a6a1f1dSLionel Sambuc dir=$(localedir)/$$lang/LC_MESSAGES; \ 283*0a6a1f1dSLionel Sambuc $(mkdir_p) $(DESTDIR)$$dir; \ 284*0a6a1f1dSLionel Sambuc for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ 285*0a6a1f1dSLionel Sambuc if test -n "$$lc"; then \ 286*0a6a1f1dSLionel Sambuc if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ 287*0a6a1f1dSLionel Sambuc link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ 288*0a6a1f1dSLionel Sambuc mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ 289*0a6a1f1dSLionel Sambuc mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ 290*0a6a1f1dSLionel Sambuc (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ 291*0a6a1f1dSLionel Sambuc for file in *; do \ 292*0a6a1f1dSLionel Sambuc if test -f $$file; then \ 293*0a6a1f1dSLionel Sambuc ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ 294*0a6a1f1dSLionel Sambuc fi; \ 295*0a6a1f1dSLionel Sambuc done); \ 296*0a6a1f1dSLionel Sambuc rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ 297*0a6a1f1dSLionel Sambuc else \ 298*0a6a1f1dSLionel Sambuc if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ 299*0a6a1f1dSLionel Sambuc :; \ 300*0a6a1f1dSLionel Sambuc else \ 301*0a6a1f1dSLionel Sambuc rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ 302*0a6a1f1dSLionel Sambuc mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ 303*0a6a1f1dSLionel Sambuc fi; \ 304*0a6a1f1dSLionel Sambuc fi; \ 305*0a6a1f1dSLionel Sambuc fi; \ 306*0a6a1f1dSLionel Sambuc done; \ 307*0a6a1f1dSLionel Sambuc done 308*0a6a1f1dSLionel Sambuc 309*0a6a1f1dSLionel Sambuc# Define this as empty until I found a useful application. 310*0a6a1f1dSLionel Sambucinstallcheck: 311*0a6a1f1dSLionel Sambuc 312*0a6a1f1dSLionel Sambucuninstall: uninstall-exec uninstall-data 313*0a6a1f1dSLionel Sambucuninstall-exec: 314*0a6a1f1dSLionel Sambucuninstall-data: uninstall-data-no 315*0a6a1f1dSLionel Sambuc if test "$(PACKAGE)" = "gettext-tools"; then \ 316*0a6a1f1dSLionel Sambuc for file in $(DISTFILES.common) Makevars.template; do \ 317*0a6a1f1dSLionel Sambuc rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ 318*0a6a1f1dSLionel Sambuc done; \ 319*0a6a1f1dSLionel Sambuc else \ 320*0a6a1f1dSLionel Sambuc : ; \ 321*0a6a1f1dSLionel Sambuc fi 322*0a6a1f1dSLionel Sambucuninstall-data-no: 323*0a6a1f1dSLionel Sambucuninstall-data-yes: 324*0a6a1f1dSLionel Sambuc catalogs='$(CATALOGS)'; \ 325*0a6a1f1dSLionel Sambuc for cat in $$catalogs; do \ 326*0a6a1f1dSLionel Sambuc cat=`basename $$cat`; \ 327*0a6a1f1dSLionel Sambuc lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ 328*0a6a1f1dSLionel Sambuc for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ 329*0a6a1f1dSLionel Sambuc rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ 330*0a6a1f1dSLionel Sambuc done; \ 331*0a6a1f1dSLionel Sambuc done 332*0a6a1f1dSLionel Sambuc 333*0a6a1f1dSLionel Sambuccheck: all 334*0a6a1f1dSLionel Sambuc 335*0a6a1f1dSLionel Sambucinfo dvi ps pdf html tags TAGS ctags CTAGS ID: 336*0a6a1f1dSLionel Sambuc 337*0a6a1f1dSLionel Sambucmostlyclean: 338*0a6a1f1dSLionel Sambuc rm -f remove-potcdate.sed 339*0a6a1f1dSLionel Sambuc rm -f stamp-poT 340*0a6a1f1dSLionel Sambuc rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po 341*0a6a1f1dSLionel Sambuc rm -fr *.o 342*0a6a1f1dSLionel Sambuc 343*0a6a1f1dSLionel Sambucclean: mostlyclean 344*0a6a1f1dSLionel Sambuc 345*0a6a1f1dSLionel Sambucdistclean: clean 346*0a6a1f1dSLionel Sambuc rm -f Makefile Makefile.in POTFILES *.mo 347*0a6a1f1dSLionel Sambuc 348*0a6a1f1dSLionel Sambucmaintainer-clean: distclean 349*0a6a1f1dSLionel Sambuc @echo "This command is intended for maintainers to use;" 350*0a6a1f1dSLionel Sambuc @echo "it deletes files that may require special tools to rebuild." 351*0a6a1f1dSLionel Sambuc rm -f stamp-po $(GMOFILES) 352*0a6a1f1dSLionel Sambuc 353*0a6a1f1dSLionel Sambucdistdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) 354*0a6a1f1dSLionel Sambucdist distdir: 355*0a6a1f1dSLionel Sambuc $(MAKE) update-po 356*0a6a1f1dSLionel Sambuc @$(MAKE) dist2 357*0a6a1f1dSLionel Sambuc# This is a separate target because 'update-po' must be executed before. 358*0a6a1f1dSLionel Sambucdist2: stamp-po $(DISTFILES) 359*0a6a1f1dSLionel Sambuc dists="$(DISTFILES)"; \ 360*0a6a1f1dSLionel Sambuc if test "$(PACKAGE)" = "gettext-tools"; then \ 361*0a6a1f1dSLionel Sambuc dists="$$dists Makevars.template"; \ 362*0a6a1f1dSLionel Sambuc fi; \ 363*0a6a1f1dSLionel Sambuc if test -f $(srcdir)/$(DOMAIN).pot; then \ 364*0a6a1f1dSLionel Sambuc dists="$$dists $(DOMAIN).pot stamp-po"; \ 365*0a6a1f1dSLionel Sambuc fi; \ 366*0a6a1f1dSLionel Sambuc if test -f $(srcdir)/ChangeLog; then \ 367*0a6a1f1dSLionel Sambuc dists="$$dists ChangeLog"; \ 368*0a6a1f1dSLionel Sambuc fi; \ 369*0a6a1f1dSLionel Sambuc for i in 0 1 2 3 4 5 6 7 8 9; do \ 370*0a6a1f1dSLionel Sambuc if test -f $(srcdir)/ChangeLog.$$i; then \ 371*0a6a1f1dSLionel Sambuc dists="$$dists ChangeLog.$$i"; \ 372*0a6a1f1dSLionel Sambuc fi; \ 373*0a6a1f1dSLionel Sambuc done; \ 374*0a6a1f1dSLionel Sambuc if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ 375*0a6a1f1dSLionel Sambuc for file in $$dists; do \ 376*0a6a1f1dSLionel Sambuc if test -f $$file; then \ 377*0a6a1f1dSLionel Sambuc cp -p $$file $(distdir) || exit 1; \ 378*0a6a1f1dSLionel Sambuc else \ 379*0a6a1f1dSLionel Sambuc cp -p $(srcdir)/$$file $(distdir) || exit 1; \ 380*0a6a1f1dSLionel Sambuc fi; \ 381*0a6a1f1dSLionel Sambuc done 382*0a6a1f1dSLionel Sambuc 383*0a6a1f1dSLionel Sambucupdate-po: Makefile 384*0a6a1f1dSLionel Sambuc $(MAKE) $(DOMAIN).pot-update 385*0a6a1f1dSLionel Sambuc test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) 386*0a6a1f1dSLionel Sambuc $(MAKE) update-gmo 387*0a6a1f1dSLionel Sambuc 388*0a6a1f1dSLionel Sambuc# General rule for creating PO files. 389*0a6a1f1dSLionel Sambuc 390*0a6a1f1dSLionel Sambuc.nop.po-create: 391*0a6a1f1dSLionel Sambuc @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ 392*0a6a1f1dSLionel Sambuc echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ 393*0a6a1f1dSLionel Sambuc exit 1 394*0a6a1f1dSLionel Sambuc 395*0a6a1f1dSLionel Sambuc# General rule for updating PO files. 396*0a6a1f1dSLionel Sambuc 397*0a6a1f1dSLionel Sambuc.nop.po-update: 398*0a6a1f1dSLionel Sambuc @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ 399*0a6a1f1dSLionel Sambuc if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ 400*0a6a1f1dSLionel Sambuc tmpdir=`pwd`; \ 401*0a6a1f1dSLionel Sambuc echo "$$lang:"; \ 402*0a6a1f1dSLionel Sambuc test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ 403*0a6a1f1dSLionel Sambuc echo "$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ 404*0a6a1f1dSLionel Sambuc cd $(srcdir); \ 405*0a6a1f1dSLionel Sambuc if { case `$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ 406*0a6a1f1dSLionel Sambuc '' | 0.[0-9] | 0.[0-9].* | 0.1[0-7] | 0.1[0-7].*) \ 407*0a6a1f1dSLionel Sambuc $(MSGMERGE) $(MSGMERGE_OPTIONS) -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ 408*0a6a1f1dSLionel Sambuc *) \ 409*0a6a1f1dSLionel Sambuc $(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang -o $$tmpdir/$$lang.new.po $$lang.po $(DOMAIN).pot;; \ 410*0a6a1f1dSLionel Sambuc esac; \ 411*0a6a1f1dSLionel Sambuc }; then \ 412*0a6a1f1dSLionel Sambuc if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ 413*0a6a1f1dSLionel Sambuc rm -f $$tmpdir/$$lang.new.po; \ 414*0a6a1f1dSLionel Sambuc else \ 415*0a6a1f1dSLionel Sambuc if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ 416*0a6a1f1dSLionel Sambuc :; \ 417*0a6a1f1dSLionel Sambuc else \ 418*0a6a1f1dSLionel Sambuc echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ 419*0a6a1f1dSLionel Sambuc exit 1; \ 420*0a6a1f1dSLionel Sambuc fi; \ 421*0a6a1f1dSLionel Sambuc fi; \ 422*0a6a1f1dSLionel Sambuc else \ 423*0a6a1f1dSLionel Sambuc echo "msgmerge for $$lang.po failed!" 1>&2; \ 424*0a6a1f1dSLionel Sambuc rm -f $$tmpdir/$$lang.new.po; \ 425*0a6a1f1dSLionel Sambuc fi 426*0a6a1f1dSLionel Sambuc 427*0a6a1f1dSLionel Sambuc$(DUMMYPOFILES): 428*0a6a1f1dSLionel Sambuc 429*0a6a1f1dSLionel Sambucupdate-gmo: Makefile $(GMOFILES) 430*0a6a1f1dSLionel Sambuc @: 431*0a6a1f1dSLionel Sambuc 432*0a6a1f1dSLionel Sambuc# Recreate Makefile by invoking config.status. Explicitly invoke the shell, 433*0a6a1f1dSLionel Sambuc# because execution permission bits may not work on the current file system. 434*0a6a1f1dSLionel Sambuc# Use /bin/sh, which is the shell determined by autoconf for the use by its 435*0a6a1f1dSLionel Sambuc# scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient. 436*0a6a1f1dSLionel SambucMakefile: Makefile.in.in Makevars $(top_builddir)/config.status @POMAKEFILEDEPS@ 437*0a6a1f1dSLionel Sambuc cd $(top_builddir) \ 438*0a6a1f1dSLionel Sambuc && /bin/sh ./config.status $(subdir)/$@.in po-directories 439*0a6a1f1dSLionel Sambuc 440*0a6a1f1dSLionel Sambucforce: 441*0a6a1f1dSLionel Sambuc 442*0a6a1f1dSLionel Sambuc# Tell versions [3.59,3.63) of GNU make not to export all variables. 443*0a6a1f1dSLionel Sambuc# Otherwise a system limit (for SysV at least) may be exceeded. 444*0a6a1f1dSLionel Sambuc.NOEXPORT: 445