1 # Makefile for PO directory in any package using GNU gettext.
2 # Copyright (C) 1995-1997, 2000-2004 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
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
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.
11 # Origin: gettext-0.14
13 PACKAGE = libgphoto2_port
26 localedir = $(datadir)/locale
27 gettextsrcdir = $(datadir)/gettext/po
29 INSTALL = /usr/bin/install -c
30 INSTALL_DATA = ${INSTALL} -m 644
31 MKINSTALLDIRS = $(top_builddir)/auto-aux/mkinstalldirs
32 mkinstalldirs = $(SHELL) $(MKINSTALLDIRS)
34 GMSGFMT = /usr/bin/msgfmt
35 MSGFMT = /usr/bin/msgfmt
36 XGETTEXT = /usr/bin/xgettext
38 MSGMERGE_UPDATE = /usr/bin/msgmerge --update
43 POFILES = cs.po da.po de.po fr.po es.po eu.po it.po ja.po nl.po pl.po pt_BR.po ru.po sk.po sv.po uk.po vi.po zh_CN.po zh_TW.po
44 GMOFILES = cs.gmo da.gmo de.gmo fr.gmo es.gmo eu.gmo it.gmo ja.gmo nl.gmo pl.gmo pt_BR.gmo ru.gmo sk.gmo sv.gmo uk.gmo vi.gmo zh_CN.gmo zh_TW.gmo
45 UPDATEPOFILES = cs.po-update da.po-update de.po-update fr.po-update es.po-update eu.po-update it.po-update ja.po-update nl.po-update pl.po-update pt_BR.po-update ru.po-update sk.po-update sv.po-update uk.po-update vi.po-update zh_CN.po-update zh_TW.po-update
46 DUMMYPOFILES = cs.nop da.nop de.nop fr.nop es.nop eu.nop it.nop ja.nop nl.nop pl.nop pt_BR.nop ru.nop sk.nop sv.nop uk.nop vi.nop zh_CN.nop zh_TW.nop
47 DISTFILES.common = Makefile.in.in remove-potcdate.sin \
48 $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3)
49 DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \
50 $(POFILES) $(GMOFILES) \
51 $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3)
54 ../libgphoto2_port/gphoto2-port-info-list.c \
55 ../libgphoto2_port/gphoto2-port-result.c \
56 ../libgphoto2_port/gphoto2-port.c \
60 ../usbdiskdirect/linux.c \
63 CATALOGS = cs.gmo da.gmo de.gmo fr.gmo es.gmo eu.gmo it.gmo ja.gmo nl.gmo pl.gmo pt_BR.gmo ru.gmo sk.gmo sv.gmo uk.gmo vi.gmo zh_CN.gmo zh_TW.gmo
65 # Makevars gets inserted here. (Don't remove this line!)
66 # Makefile variables for PO directory in any package using GNU gettext.
68 # Usually the message domain is the same as the package name.
69 DOMAIN = libgphoto2_port-0
71 # These two variables depend on the location of this directory.
75 # These options get passed to xgettext.
76 XGETTEXT_OPTIONS = --keyword=_ --keyword=N_
78 # This is the copyright holder that gets inserted into the header of the
79 # $(DOMAIN).pot file. Set this to the copyright holder of the surrounding
80 # package. (Note that the msgstr strings, extracted from the package's
81 # sources, belong to the copyright holder of the package.) Translators are
82 # expected to transfer the copyright for their translations to this person
83 # or entity, or to disclaim their copyright. The empty string stands for
84 # the public domain; in this case the translators are expected to disclaim
86 COPYRIGHT_HOLDER = Lutz Mueller and others
88 # This is the email address or URL to which the translators shall report
89 # bugs in the untranslated strings:
90 # - Strings which are not entire sentences, see the maintainer guidelines
91 # in the GNU gettext documentation, section 'Preparing Strings'.
92 # - Strings which use unclear terms or require additional context to be
94 # - Strings which make invalid assumptions about notation of date, time or
96 # - Pluralisation problems.
97 # - Incorrect English spelling.
98 # - Incorrect formatting.
99 # It can be your email address, or a mailing list address where translators
100 # can write to without being subscribed, or the URL of a web page through
101 # which the translators can contact you.
102 MSGID_BUGS_ADDRESS = gphoto-devel@lists.sourceforge.net
104 # This is the list of locale categories, beyond LC_MESSAGES, for which the
105 # message catalogs shall be used. It is usually empty.
106 EXTRA_LOCALE_CATEGORIES =
109 .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
112 @echo "$(MSGFMT) -c -o $@ $<"; \
113 $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
116 @lang=`echo $* | sed -e 's,.*/,,'`; \
117 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
118 echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
119 cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
122 sed -e '/^#/d' $< > t-$@
131 # stamp-po is a timestamp denoting the last time at which the CATALOGS have
132 # been loosely updated. Its purpose is that when a developer or translator
133 # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS,
134 # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent
135 # invocations of "make" will do nothing. This timestamp would not be necessary
136 # if updating the $(CATALOGS) would always touch them; however, the rule for
137 # $(POFILES) has been designed to not touch files that don't need to be
139 stamp-po: $(srcdir)/$(DOMAIN).pot
140 test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
141 @echo "touch stamp-po"
142 @echo timestamp > stamp-poT
143 @mv stamp-poT stamp-po
145 # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
146 # otherwise packages like GCC can not be built if only parts of the source
147 # have been downloaded.
149 # This target rebuilds $(DOMAIN).pot; it is an expensive operation.
150 # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
151 $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
152 $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
153 --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
154 --files-from=$(srcdir)/POTFILES.in \
155 --copyright-holder='$(COPYRIGHT_HOLDER)' \
156 --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)'
157 test ! -f $(DOMAIN).po || { \
158 if test -f $(srcdir)/$(DOMAIN).pot; then \
159 sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
160 sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
161 if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
162 rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
164 rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
165 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
168 mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
172 # This rule has no dependencies: we don't need to update $(DOMAIN).pot at
173 # every "make" invocation, only create it when it is missing.
174 # Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
175 $(srcdir)/$(DOMAIN).pot:
176 $(MAKE) $(DOMAIN).pot-update
178 # This target rebuilds a PO file if $(DOMAIN).pot has changed.
179 # Note that a PO file is not touched if it doesn't need to be changed.
180 $(POFILES): $(srcdir)/$(DOMAIN).pot
181 @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
182 if test -f "$(srcdir)/$${lang}.po"; then \
183 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
184 echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
185 cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
187 $(MAKE) $${lang}.po-create; \
191 install: install-exec install-data
193 install-data: install-data-yes
194 if test "$(PACKAGE)" = "gettext-tools"; then \
195 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
196 for file in $(DISTFILES.common) Makevars.template; do \
197 $(INSTALL_DATA) $(srcdir)/$$file \
198 $(DESTDIR)$(gettextsrcdir)/$$file; \
200 for file in Makevars; do \
201 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
207 install-data-yes: all
208 $(mkinstalldirs) $(DESTDIR)$(datadir)
209 @catalogs='$(CATALOGS)'; \
210 for cat in $$catalogs; do \
211 cat=`basename $$cat`; \
212 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
213 dir=$(localedir)/$$lang/LC_MESSAGES; \
214 $(mkinstalldirs) $(DESTDIR)$$dir; \
215 if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \
216 $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \
217 echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
218 for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
219 if test -n "$$lc"; then \
220 if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
221 link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
222 mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
223 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
224 (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
226 if test -f $$file; then \
227 ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
230 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
232 if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
235 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
236 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
239 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
240 ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
241 ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \
242 cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
243 echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
248 install-strip: install
250 installdirs: installdirs-exec installdirs-data
252 installdirs-data: installdirs-data-yes
253 if test "$(PACKAGE)" = "gettext-tools"; then \
254 $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
259 installdirs-data-yes:
260 $(mkinstalldirs) $(DESTDIR)$(datadir)
261 @catalogs='$(CATALOGS)'; \
262 for cat in $$catalogs; do \
263 cat=`basename $$cat`; \
264 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
265 dir=$(localedir)/$$lang/LC_MESSAGES; \
266 $(mkinstalldirs) $(DESTDIR)$$dir; \
267 for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \
268 if test -n "$$lc"; then \
269 if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \
270 link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
271 mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
272 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
273 (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \
275 if test -f $$file; then \
276 ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \
279 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \
281 if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \
284 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \
285 mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \
292 # Define this as empty until I found a useful application.
295 uninstall: uninstall-exec uninstall-data
297 uninstall-data: uninstall-data-yes
298 if test "$(PACKAGE)" = "gettext-tools"; then \
299 for file in $(DISTFILES.common) Makevars.template; do \
300 rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \
307 catalogs='$(CATALOGS)'; \
308 for cat in $$catalogs; do \
309 cat=`basename $$cat`; \
310 lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \
311 for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \
312 rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \
318 info dvi ps pdf html tags TAGS ctags CTAGS ID:
321 rm -f remove-potcdate.sed
323 rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
329 rm -f Makefile Makefile.in POTFILES *.mo
331 maintainer-clean: distclean
332 @echo "This command is intended for maintainers to use;"
333 @echo "it deletes files that may require special tools to rebuild."
334 rm -f stamp-po $(GMOFILES)
336 distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
340 # This is a separate target because 'update-po' must be executed before.
342 dists="$(DISTFILES)"; \
343 if test "$(PACKAGE)" = "gettext-tools"; then \
344 dists="$$dists Makevars.template"; \
346 if test -f $(srcdir)/ChangeLog; then \
347 dists="$$dists ChangeLog"; \
349 for i in 0 1 2 3 4 5 6 7 8 9; do \
350 if test -f $(srcdir)/ChangeLog.$$i; then \
351 dists="$$dists ChangeLog.$$i"; \
354 if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \
355 for file in $$dists; do \
356 if test -f $$file; then \
357 cp -p $$file $(distdir); \
359 cp -p $(srcdir)/$$file $(distdir); \
364 $(MAKE) $(DOMAIN).pot-update
365 test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES)
368 # General rule for creating PO files.
371 @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \
372 echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
375 # General rule for updating PO files.
378 @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \
379 if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \
382 test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
383 echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
385 if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \
386 if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
387 rm -f $$tmpdir/$$lang.new.po; \
389 if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
392 echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
397 echo "msgmerge for $$lang.po failed!" 1>&2; \
398 rm -f $$tmpdir/$$lang.new.po; \
403 update-gmo: Makefile $(GMOFILES)
406 Makefile: Makefile.in.in $(top_builddir)/config.status POTFILES.in
408 && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \
409 $(SHELL) ./config.status
413 # Tell versions [3.59,3.63) of GNU make not to export all variables.
414 # Otherwise a system limit (for SysV at least) may be exceeded.
416 # Special Makefile rules for English message catalogs with quotation marks.
418 DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot
420 .SUFFIXES: .insert-header .po-update-en
423 $(MAKE) en@quot.po-update
424 en@boldquot.po-create:
425 $(MAKE) en@boldquot.po-update
427 en@quot.po-update: en@quot.po-update-en
428 en@boldquot.po-update: en@boldquot.po-update-en
430 .insert-header.po-update-en:
431 @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \
432 if test "$(PACKAGE)" = "gettext"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \
435 ll=`echo $$lang | sed -e 's/@.*//'`; \
436 LC_ALL=C; export LC_ALL; \
438 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 \
439 if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \
440 rm -f $$tmpdir/$$lang.new.po; \
442 if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \
445 echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
450 echo "creation of $$lang.po failed!" 1>&2; \
451 rm -f $$tmpdir/$$lang.new.po; \
454 en@quot.insert-header: insert-header.sin
455 sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header
457 en@boldquot.insert-header: insert-header.sin
458 sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header
460 mostlyclean: mostlyclean-quot
462 rm -f *.insert-header