1# Makefile for PO directory in any package using GNU gettext. 2# Copyright (C) 1995-1997, 2000-2006 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# 11# Origin: gettext-0.15 12 13PACKAGE = ripperX 14VERSION = 2.7.3 15PACKAGE_BUGREPORT = 16 17SHELL = /bin/sh 18 19 20srcdir = . 21top_srcdir = .. 22 23 24prefix = /usr/local 25exec_prefix = ${prefix} 26datarootdir = ${prefix}/share 27datadir = ${datarootdir} 28localedir = ${datarootdir}/locale 29gettextsrcdir = $(datadir)/gettext/po 30 31INSTALL = /usr/bin/install -c 32INSTALL_DATA = ${INSTALL} -m 644 33mkinstalldirs = $(SHELL) ${SHELL} /tmp/ripperX-build-2.7.3/ripperX-2.7.3/config/install-sh -d 34mkdir_p = /bin/mkdir -p 35 36GMSGFMT_ = /usr/bin/msgfmt 37GMSGFMT_no = /usr/bin/msgfmt 38GMSGFMT_yes = /usr/bin/msgfmt 39GMSGFMT = $(GMSGFMT_$(USE_MSGCTXT)) 40MSGFMT_ = /usr/bin/msgfmt 41MSGFMT_no = /usr/bin/msgfmt 42MSGFMT_yes = /usr/bin/msgfmt 43MSGFMT = $(MSGFMT_$(USE_MSGCTXT)) 44XGETTEXT_ = /usr/bin/xgettext 45XGETTEXT_no = /usr/bin/xgettext 46XGETTEXT_yes = /usr/bin/xgettext 47XGETTEXT = $(XGETTEXT_$(USE_MSGCTXT)) 48MSGMERGE = msgmerge 49MSGMERGE_UPDATE = /usr/bin/msgmerge --update 50MSGINIT = msginit 51MSGCONV = msgconv 52MSGFILTER = msgfilter 53 54POFILES = en_GB.po es.po it.po gl.po de.po 55GMOFILES = en_GB.gmo es.gmo it.gmo gl.gmo de.gmo 56UPDATEPOFILES = en_GB.po-update es.po-update it.po-update gl.po-update de.po-update 57DUMMYPOFILES = en_GB.nop es.nop it.nop gl.nop de.nop 58DISTFILES.common = Makefile.in.in remove-potcdate.sin \ 59$(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) 60DISTFILES = $(DISTFILES.common) Makevars POTFILES.in \ 61$(POFILES) $(GMOFILES) \ 62$(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) 63 64POTFILES = \ 65 ../src/cddb.c \ 66 ../src/cddbp.c \ 67 ../src/config_window_handler.c \ 68 ../src/dir_window_handler.c \ 69 ../src/err_dialog_handler.c \ 70 ../src/job_control.c \ 71 ../src/main_window_handler.c \ 72 ../src/misc_utils.c \ 73 ../src/players_manipulation.c \ 74 ../src/ripper_encoder_manipulation.c \ 75 ../src/select_frame_handler.c \ 76 ../src/status_frame_handler.c 77 78CATALOGS = en_GB.gmo es.gmo it.gmo gl.gmo de.gmo 79 80# Makevars gets inserted here. (Don't remove this line!) 81# Makefile variables for PO directory in any package using GNU gettext. 82 83# Usually the message domain is the same as the package name. 84DOMAIN = $(PACKAGE) 85 86# These two variables depend on the location of this directory. 87subdir = po 88top_builddir = .. 89 90# These options get passed to xgettext. 91XGETTEXT_OPTIONS = \ 92 --keyword=_ --flag=_:1:pass-c-format \ 93 --keyword=Q_ --flag=Q_:1:pass-c-format \ 94 --keyword=N_ --flag=N_:1:pass-c-format \ 95 --keyword='proper_name:1,"This is a proper name. See the gettext manual, section Names."' \ 96 --keyword='proper_name_utf8:1,"This is a proper name. See the gettext manual, section Names."' \ 97 --flag=error:3:c-format --flag=error_at_line:5:c-format 98 99# This is the copyright holder that gets inserted into the header of the 100# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding 101# package. (Note that the msgstr strings, extracted from the package's 102# sources, belong to the copyright holder of the package.) Translators are 103# expected to transfer the copyright for their translations to this person 104# or entity, or to disclaim their copyright. The empty string stands for 105# the public domain; in this case the translators are expected to disclaim 106# their copyright. 107COPYRIGHT_HOLDER = ripperX 108 109# This is the email address or URL to which the translators shall report 110# bugs in the untranslated strings: 111# - Strings which are not entire sentences, see the maintainer guidelines 112# in the GNU gettext documentation, section 'Preparing Strings'. 113# - Strings which use unclear terms or require additional context to be 114# understood. 115# - Strings which make invalid assumptions about notation of date, time or 116# money. 117# - Pluralisation problems. 118# - Incorrect English spelling. 119# - Incorrect formatting. 120# It can be your email address, or a mailing list address where translators 121# can write to without being subscribed, or the URL of a web page through 122# which the translators can contact you. 123MSGID_BUGS_ADDRESS = tmancill@users.sourceforge.net 124 125# This is the list of locale categories, beyond LC_MESSAGES, for which the 126# message catalogs shall be used. It is usually empty. 127EXTRA_LOCALE_CATEGORIES = 128 129# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' 130# context. Possible values are "yes" and "no". Set this to yes if the 131# package uses functions taking also a message context, like pgettext(), or 132# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. 133USE_MSGCTXT = no 134 135.SUFFIXES: 136.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update 137 138.po.mo: 139 @echo "$(MSGFMT) -c -o $@ $<"; \ 140 $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ 141 142.po.gmo: 143 @lang=`echo $* | sed -e 's,.*/,,'`; \ 144 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ 145 echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ 146 cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo 147 148.sin.sed: 149 sed -e '/^#/d' $< > t-$@ 150 mv t-$@ $@ 151 152 153all: all-yes 154 155all-yes: stamp-po 156all-no: 157 158# $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no 159# internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because 160# we don't want to bother translators with empty POT files). We assume that 161# LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty. 162# In this case, stamp-po is a nop (i.e. a phony target). 163 164# stamp-po is a timestamp denoting the last time at which the CATALOGS have 165# been loosely updated. Its purpose is that when a developer or translator 166# checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, 167# "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent 168# invocations of "make" will do nothing. This timestamp would not be necessary 169# if updating the $(CATALOGS) would always touch them; however, the rule for 170# $(POFILES) has been designed to not touch files that don't need to be 171# changed. 172stamp-po: $(srcdir)/$(DOMAIN).pot 173 test ! -f $(srcdir)/$(DOMAIN).pot || \ 174 test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) 175 @test ! -f $(srcdir)/$(DOMAIN).pot || { \ 176 echo "touch stamp-po" && \ 177 echo timestamp > stamp-poT && \ 178 mv stamp-poT stamp-po; \ 179 } 180 181# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', 182# otherwise packages like GCC can not be built if only parts of the source 183# have been downloaded. 184 185# This target rebuilds $(DOMAIN).pot; it is an expensive operation. 186# Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. 187$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed 188 if test -n '$(MSGID_BUGS_ADDRESS)' || test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT'@'; then \ 189 msgid_bugs_address='$(MSGID_BUGS_ADDRESS)'; \ 190 else \ 191 msgid_bugs_address='$(PACKAGE_BUGREPORT)'; \ 192 fi; \ 193 $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ 194 --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ 195 --files-from=$(srcdir)/POTFILES.in \ 196 --copyright-holder='$(COPYRIGHT_HOLDER)' \ 197 --msgid-bugs-address="$$msgid_bugs_address" 198 test ! -f $(DOMAIN).po || { \ 199 if test -f $(srcdir)/$(DOMAIN).pot; then \ 200 sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ 201 sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ 202 if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ 203 rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ 204 else \ 205 rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ 206 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ 207 fi; \ 208 else \ 209 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ 210 fi; \ 211 } 212 213# This rule has no dependencies: we don't need to update $(DOMAIN).pot at 214# every "make" invocation, only create it when it is missing. 215# Only "make $(DOMAIN).pot-update" or "make dist" will force an update. 216$(srcdir)/$(DOMAIN).pot: 217 $(MAKE) $(DOMAIN).pot-update 218 219# This target rebuilds a PO file if $(DOMAIN).pot has changed. 220# Note that a PO file is not touched if it doesn't need to be changed. 221$(POFILES): $(srcdir)/$(DOMAIN).pot 222 @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ 223 if test -f "$(srcdir)/$${lang}.po"; then \ 224 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ 225 echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ 226 cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \ 227 else \ 228 $(MAKE) $${lang}.po-create; \ 229 fi 230 231 232install: install-exec install-data 233install-exec: 234install-data: install-data-yes 235 if test "$(PACKAGE)" = "gettext-tools"; then \ 236 $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ 237 for file in $(DISTFILES.common) Makevars.template; do \ 238 $(INSTALL_DATA) $(srcdir)/$$file \ 239 $(DESTDIR)$(gettextsrcdir)/$$file; \ 240 done; \ 241 for file in Makevars; do \ 242 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ 243 done; \ 244 else \ 245 : ; \ 246 fi 247install-data-no: all 248install-data-yes: all 249 $(mkdir_p) $(DESTDIR)$(datadir) 250 @catalogs='$(CATALOGS)'; \ 251 for cat in $$catalogs; do \ 252 cat=`basename $$cat`; \ 253 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ 254 dir=$(localedir)/$$lang/LC_MESSAGES; \ 255 $(mkdir_p) $(DESTDIR)$$dir; \ 256 if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ 257 $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ 258 echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ 259 for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ 260 if test -n "$$lc"; then \ 261 if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ 262 link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ 263 mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ 264 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ 265 (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ 266 for file in *; do \ 267 if test -f $$file; then \ 268 ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ 269 fi; \ 270 done); \ 271 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ 272 else \ 273 if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ 274 :; \ 275 else \ 276 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ 277 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ 278 fi; \ 279 fi; \ 280 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ 281 ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ 282 ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ 283 cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ 284 echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ 285 fi; \ 286 done; \ 287 done 288 289install-strip: install 290 291installdirs: installdirs-exec installdirs-data 292installdirs-exec: 293installdirs-data: installdirs-data-yes 294 if test "$(PACKAGE)" = "gettext-tools"; then \ 295 $(mkdir_p) $(DESTDIR)$(gettextsrcdir); \ 296 else \ 297 : ; \ 298 fi 299installdirs-data-no: 300installdirs-data-yes: 301 $(mkdir_p) $(DESTDIR)$(datadir) 302 @catalogs='$(CATALOGS)'; \ 303 for cat in $$catalogs; do \ 304 cat=`basename $$cat`; \ 305 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ 306 dir=$(localedir)/$$lang/LC_MESSAGES; \ 307 $(mkdir_p) $(DESTDIR)$$dir; \ 308 for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ 309 if test -n "$$lc"; then \ 310 if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ 311 link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ 312 mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ 313 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ 314 (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ 315 for file in *; do \ 316 if test -f $$file; then \ 317 ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ 318 fi; \ 319 done); \ 320 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ 321 else \ 322 if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ 323 :; \ 324 else \ 325 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ 326 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ 327 fi; \ 328 fi; \ 329 fi; \ 330 done; \ 331 done 332 333# Define this as empty until I found a useful application. 334installcheck: 335 336uninstall: uninstall-exec uninstall-data 337uninstall-exec: 338uninstall-data: uninstall-data-yes 339 if test "$(PACKAGE)" = "gettext-tools"; then \ 340 for file in $(DISTFILES.common) Makevars.template; do \ 341 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ 342 done; \ 343 else \ 344 : ; \ 345 fi 346uninstall-data-no: 347uninstall-data-yes: 348 catalogs='$(CATALOGS)'; \ 349 for cat in $$catalogs; do \ 350 cat=`basename $$cat`; \ 351 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ 352 for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ 353 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ 354 done; \ 355 done 356 357check: all 358 359info dvi ps pdf html tags TAGS ctags CTAGS ID: 360 361mostlyclean: 362 rm -f remove-potcdate.sed 363 rm -f stamp-poT 364 rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po 365 rm -fr *.o 366 367clean: mostlyclean 368 369distclean: clean 370 rm -f Makefile Makefile.in POTFILES *.mo *.gmo 371 372maintainer-clean: distclean 373 @echo "This command is intended for maintainers to use;" 374 @echo "it deletes files that may require special tools to rebuild." 375 rm -f stamp-po $(GMOFILES) 376 377distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) 378dist distdir: 379 $(MAKE) update-po 380 @$(MAKE) dist2 381# This is a separate target because 'update-po' must be executed before. 382dist2: stamp-po $(DISTFILES) 383 dists="$(DISTFILES)"; \ 384 if test "$(PACKAGE)" = "gettext-tools"; then \ 385 dists="$$dists Makevars.template"; \ 386 fi; \ 387 if test -f $(srcdir)/$(DOMAIN).pot; then \ 388 dists="$$dists $(DOMAIN).pot stamp-po"; \ 389 fi; \ 390 if test -f $(srcdir)/ChangeLog; then \ 391 dists="$$dists ChangeLog"; \ 392 fi; \ 393 for i in 0 1 2 3 4 5 6 7 8 9; do \ 394 if test -f $(srcdir)/ChangeLog.$$i; then \ 395 dists="$$dists ChangeLog.$$i"; \ 396 fi; \ 397 done; \ 398 if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ 399 for file in $$dists; do \ 400 if test -f $$file; then \ 401 cp -p $$file $(distdir) || exit 1; \ 402 else \ 403 cp -p $(srcdir)/$$file $(distdir) || exit 1; \ 404 fi; \ 405 done 406 407update-po: Makefile 408 $(MAKE) $(DOMAIN).pot-update 409 test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) 410 $(MAKE) update-gmo 411 412# General rule for creating PO files. 413 414.nop.po-create: 415 @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ 416 echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ 417 exit 1 418 419# General rule for updating PO files. 420 421.nop.po-update: 422 @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ 423 if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ 424 tmpdir=`pwd`; \ 425 echo "$$lang:"; \ 426 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ 427 echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ 428 cd $(srcdir); \ 429 if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ 430 if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ 431 rm -f $$tmpdir/$$lang.new.po; \ 432 else \ 433 if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ 434 :; \ 435 else \ 436 echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ 437 exit 1; \ 438 fi; \ 439 fi; \ 440 else \ 441 echo "msgmerge for $$lang.po failed!" 1>&2; \ 442 rm -f $$tmpdir/$$lang.new.po; \ 443 fi 444 445$(DUMMYPOFILES): 446 447update-gmo: Makefile $(GMOFILES) 448 @: 449 450Makefile: Makefile.in.in Makevars $(top_builddir)/config.status POTFILES.in 451 cd $(top_builddir) \ 452 && $(SHELL) ./config.status $(subdir)/$@.in po-directories 453 454force: 455 456# Tell versions [3.59,3.63) of GNU make not to export all variables. 457# Otherwise a system limit (for SysV at least) may be exceeded. 458.NOEXPORT: 459