1# Makefile for PO directory in any package using GNU gettext. 2# Copyright (C) 1995-1997, 2000-2002 by Ulrich Drepper <drepper@gnu.ai.mit.edu> 3# 4# This file can be copied and used freely without restrictions. It can 5# be used in projects which are not available under the GNU General Public 6# License but which still want to provide support for the GNU gettext 7# functionality. 8# Please note that the actual code of GNU gettext is covered by the GNU 9# General Public License and is *not* in the public domain. 10 11PACKAGE = LPRng 12VERSION = 3.8.22 13 14SHELL = /bin/sh 15 16 17srcdir = . 18top_srcdir = .. 19 20 21prefix = /usr/local 22exec_prefix = ${prefix} 23datadir = ${prefix}/share 24localedir = $(datadir)/locale 25gettextsrcdir = $(datadir)/gettext/po 26 27INSTALL = /usr/bin/install -c 28INSTALL_DATA = ${INSTALL} -m 644 29MKINSTALLDIRS = ./mkinstalldirs 30mkinstalldirs = $(SHELL) `case "$(MKINSTALLDIRS)" in /*) echo "$(MKINSTALLDIRS)" ;; *) echo "$(top_builddir)/$(MKINSTALLDIRS)" ;; esac` 31 32GMSGFMT = /usr/bin/msgfmt 33MSGFMT = /usr/bin/msgfmt 34XGETTEXT = /usr/bin/xgettext 35MSGMERGE = msgmerge 36MSGMERGE_UPDATE = /usr/bin/msgmerge --update 37MSGINIT = msginit 38MSGCONV = msgconv 39MSGFILTER = msgfilter 40 41POFILES = fr.po 42GMOFILES = fr.gmo 43UPDATEPOFILES = fr.po-update 44DUMMYPOFILES = fr.nop 45DISTFILES.common = Makefile.in.in Makevars remove-potcdate.sin \ 46$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) 47DISTFILES = $(DISTFILES.common) POTFILES.in $(DOMAIN).pot \ 48$(POFILES) $(GMOFILES) \ 49$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) 50 51POTFILES = \ 52 ../src/common/accounting.c \ 53 ../src/common/controlword.c \ 54 ../src/common/linelist.c \ 55 ../src/common/lpc.c \ 56 ../src/common/lpd.c \ 57 ../src/common/lpd_control.c \ 58 ../src/common/lpd_jobs.c \ 59 ../src/common/lpd_rcvjob.c \ 60 ../src/common/lpd_remove.c \ 61 ../src/common/lpd_secure.c \ 62 ../src/common/lpd_status.c \ 63 ../src/common/lpq.c \ 64 ../src/common/lpr.c \ 65 ../src/common/lprm.c \ 66 ../src/common/sendjob.c \ 67 ../src/common/sendmail.c \ 68 ../src/common/sendreq.c \ 69 ../src/common/vars.c 70 71CATALOGS = fr.gmo 72 73# Makevars gets inserted here. (Don't remove this line!) 74# Makefile variables for PO directory in any package using GNU gettext. 75 76# Usually the message domain is the same as the package name. 77DOMAIN = $(PACKAGE) 78 79# These two variables depend on the location of this directory. 80subdir = po 81top_builddir = .. 82 83# These options get passed to xgettext. 84XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ 85 86# This is the copyright holder that gets inserted into the header of the 87# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding 88# package. (Note that the msgstr strings, extracted from the package's 89# sources, belong to the copyright holder of the package.) Translators are 90# expected to transfer the copyright for their translations to this person 91# or entity, or to disclaim their copyright. The empty string stands for 92# the public domain; in this case the translators are expected to disclaim 93# their copyright. 94COPYRIGHT_HOLDER = Free Software Foundation, Inc. 95 96# This is the list of locale categories, beyond LC_MESSAGES, for which the 97# message catalogs shall be used. It is usually empty. 98EXTRA_LOCALE_CATEGORIES = 99 100.SUFFIXES: 101.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-update 102 103.po.mo: 104 @echo "$(MSGFMT) -c -o $@ $<"; \ 105 $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ 106 107.po.gmo: 108 @lang=`echo $* | sed -e 's,.*/,,'`; \ 109 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ 110 echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ 111 cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo 112 113.sin.sed: 114 sed -e '/^#/d' $< > t-$@ 115 mv t-$@ $@ 116 117 118all: all-no 119 120all-yes: $(CATALOGS) 121all-no: 122 123# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', 124# otherwise packages like GCC can not be built if only parts of the source 125# have been downloaded. 126 127$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed 128 $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ 129 --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ 130 --files-from=$(srcdir)/POTFILES.in \ 131 --copyright-holder='$(COPYRIGHT_HOLDER)' 132 test ! -f $(DOMAIN).po || { \ 133 if test -f $(srcdir)/$(DOMAIN).pot; then \ 134 sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ 135 sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ 136 if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ 137 rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ 138 else \ 139 rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ 140 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ 141 fi; \ 142 else \ 143 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ 144 fi; \ 145 } 146 147$(srcdir)/$(DOMAIN).pot: 148 $(MAKE) $(DOMAIN).pot-update 149 150$(POFILES): $(srcdir)/$(DOMAIN).pot 151 @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ 152 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ 153 echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ 154 cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot 155 156 157install: install-exec install-data 158install-exec: 159install-data: install-data-no 160 if test "$(PACKAGE)" = "gettext"; then \ 161 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ 162 for file in $(DISTFILES.common); do \ 163 $(INSTALL_DATA) $(srcdir)/$$file \ 164 $(DESTDIR)$(gettextsrcdir)/$$file; \ 165 done; \ 166 else \ 167 : ; \ 168 fi 169install-data-no: all 170install-data-yes: all 171 $(mkinstalldirs) $(DESTDIR)$(datadir) 172 @catalogs='$(CATALOGS)'; \ 173 for cat in $$catalogs; do \ 174 cat=`basename $$cat`; \ 175 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ 176 dir=$(localedir)/$$lang/LC_MESSAGES; \ 177 $(mkinstalldirs) $(DESTDIR)$$dir; \ 178 if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ 179 $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ 180 echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ 181 for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ 182 if test -n "$$lc"; then \ 183 if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ 184 link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ 185 mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ 186 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ 187 (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ 188 for file in *; do \ 189 if test -f $$file; then \ 190 ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ 191 fi; \ 192 done); \ 193 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ 194 else \ 195 if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ 196 :; \ 197 else \ 198 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ 199 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ 200 fi; \ 201 fi; \ 202 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ 203 ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ 204 ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ 205 cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ 206 echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ 207 fi; \ 208 done; \ 209 done 210 211install-strip: install 212 213installdirs: installdirs-exec installdirs-data 214installdirs-exec: 215installdirs-data: installdirs-data-no 216 if test "$(PACKAGE)" = "gettext"; then \ 217 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ 218 else \ 219 : ; \ 220 fi 221installdirs-data-no: 222installdirs-data-yes: 223 $(mkinstalldirs) $(DESTDIR)$(datadir) 224 @catalogs='$(CATALOGS)'; \ 225 for cat in $$catalogs; do \ 226 cat=`basename $$cat`; \ 227 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ 228 dir=$(localedir)/$$lang/LC_MESSAGES; \ 229 $(mkinstalldirs) $(DESTDIR)$$dir; \ 230 for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ 231 if test -n "$$lc"; then \ 232 if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ 233 link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ 234 mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ 235 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ 236 (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ 237 for file in *; do \ 238 if test -f $$file; then \ 239 ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ 240 fi; \ 241 done); \ 242 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ 243 else \ 244 if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ 245 :; \ 246 else \ 247 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ 248 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ 249 fi; \ 250 fi; \ 251 fi; \ 252 done; \ 253 done 254 255# Define this as empty until I found a useful application. 256installcheck: 257 258uninstall: uninstall-exec uninstall-data 259uninstall-exec: 260uninstall-data: uninstall-data-no 261 if test "$(PACKAGE)" = "gettext"; then \ 262 for file in $(DISTFILES.common); do \ 263 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ 264 done; \ 265 else \ 266 : ; \ 267 fi 268uninstall-data-no: 269uninstall-data-yes: 270 catalogs='$(CATALOGS)'; \ 271 for cat in $$catalogs; do \ 272 cat=`basename $$cat`; \ 273 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ 274 for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ 275 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ 276 done; \ 277 done 278 279check: all 280 281dvi info tags TAGS ID: 282 283mostlyclean: 284 rm -f remove-potcdate.sed 285 rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po 286 rm -fr *.o 287 288clean: mostlyclean 289 290distclean: clean 291 rm -f Makefile Makefile.in POTFILES *.mo 292 293maintainer-clean: distclean 294 @echo "This command is intended for maintainers to use;" 295 @echo "it deletes files that may require special tools to rebuild." 296 rm -f $(GMOFILES) 297 298distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) 299dist distdir: 300 $(MAKE) update-po 301 @$(MAKE) dist2 302# This is a separate target because 'update-po' must be executed before. 303dist2: $(DISTFILES) 304 dists="$(DISTFILES)"; \ 305 if test -f $(srcdir)/ChangeLog; then dists="$$dists ChangeLog"; fi; \ 306 if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ 307 for file in $$dists; do \ 308 if test -f $$file; then \ 309 cp -p $$file $(distdir); \ 310 else \ 311 cp -p $(srcdir)/$$file $(distdir); \ 312 fi; \ 313 done 314 315update-po: Makefile 316 $(MAKE) $(DOMAIN).pot-update 317 $(MAKE) $(UPDATEPOFILES) 318 $(MAKE) update-gmo 319 320# General rule for updating PO files. 321 322.nop.po-update: 323 @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ 324 if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; fi; \ 325 tmpdir=`pwd`; \ 326 echo "$$lang:"; \ 327 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ 328 echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ 329 cd $(srcdir); \ 330 if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ 331 if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ 332 rm -f $$tmpdir/$$lang.new.po; \ 333 else \ 334 if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ 335 :; \ 336 else \ 337 echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ 338 exit 1; \ 339 fi; \ 340 fi; \ 341 else \ 342 echo "msgmerge for $$lang.po failed!" 1>&2; \ 343 rm -f $$tmpdir/$$lang.new.po; \ 344 fi 345 346$(DUMMYPOFILES): 347 348update-gmo: Makefile $(GMOFILES) 349 @: 350 351Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in 352 cd $(top_builddir) \ 353 && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ 354 $(SHELL) ./config.status 355 356force: 357 358# Tell versions [3.59,3.63) of GNU make not to export all variables. 359# Otherwise a system limit (for SysV at least) may be exceeded. 360.NOEXPORT: 361# Special Makefile rules for English message catalogs with quotation marks. 362 363DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot 364 365.SUFFIXES: .insert-header .po-update-en 366 367en@quot.po-update: en@quot.po-update-en 368en@boldquot.po-update: en@boldquot.po-update-en 369 370.insert-header.po-update-en: 371 @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ 372 if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ 373 tmpdir=`pwd`; \ 374 echo "$$lang:"; \ 375 ll=`echo $$lang | sed -e 's/@.*//'`; \ 376 LC_ALL=C; export LC_ALL; \ 377 cd $(srcdir); \ 378 if $(MSGINIT) -i $(DOMAIN).pot --no-translator -l $$ll -o - 2>/dev/null | sed -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | $(MSGFILTER) sed -f `echo $$lang | sed -e 's/.*@//'`.sed 2>/dev/null > $$tmpdir/$$lang.new.po; then \ 379 if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ 380 rm -f $$tmpdir/$$lang.new.po; \ 381 else \ 382 if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ 383 :; \ 384 else \ 385 echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ 386 exit 1; \ 387 fi; \ 388 fi; \ 389 else \ 390 echo "creation of $$lang.po failed!" 1>&2; \ 391 rm -f $$tmpdir/$$lang.new.po; \ 392 fi 393 394en@quot.insert-header: insert-header.sin 395 sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header 396 397en@boldquot.insert-header: insert-header.sin 398 sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header 399 400mostlyclean: mostlyclean-quot 401mostlyclean-quot: 402 rm -f *.insert-header 403