1 # Makefile for PO directory in any package using GNU gettext.
2 # Copyright (C) 1995-1997, 2000-2007, 2009-2010 by Ulrich Drepper <drepper@gnu.ai.mit.edu>
4 # Copying and distribution of this file, with or without modification,
5 # are permitted in any medium without royalty provided the copyright
6 # notice and this notice are preserved. This file is offered as-is,
7 # without any warranty.
9 # Origin: gettext-0.19.8
10 GETTEXT_MACRO_VERSION
= 0.19
14 PACKAGE_BUGREPORT
= bug-recutils@gnu.org
25 exec_prefix = ${prefix}
26 datarootdir
= ${prefix}/share
27 datadir = ${datarootdir}
28 localedir
= ${datarootdir}/locale
29 gettextsrcdir
= $(datadir)/gettext
/po
31 INSTALL
= /usr
/bin
/install -c
32 INSTALL_DATA
= ${INSTALL} -m
644
35 # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
36 # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
37 # ${SHELL} /mnt/lfs/build/recutils/recutils-1.8/build-aux/install-sh does not start with $(SHELL), so we add it.
38 # In automake >= 1.10, $(MKDIR_P) is derived from ${MKDIR_P}, which is defined
39 # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
40 # versions, $(mkinstalldirs) and $(install_sh) are unused.
41 mkinstalldirs
= $(SHELL
) ${SHELL} /mnt
/lfs
/build
/recutils
/recutils-1.8
/build-aux
/install-sh
-d
42 install_sh
= $(SHELL
) ${SHELL} /mnt
/lfs
/build
/recutils
/recutils-1.8
/build-aux
/install-sh
43 MKDIR_P
= /bin
/mkdir
-p
46 # When building gettext-tools, we prefer to use the built programs
47 # rather than installed programs. However, we can't do that when we
48 # are cross compiling.
49 CROSS_COMPILING
= @CROSS_COMPILING@
51 GMSGFMT_
= /usr
/bin
/msgfmt
52 GMSGFMT_no
= /usr
/bin
/msgfmt
53 GMSGFMT_yes
= /usr
/bin
/msgfmt
54 GMSGFMT
= $(GMSGFMT_
$(USE_MSGCTXT
))
55 MSGFMT_
= /usr
/bin
/msgfmt
56 MSGFMT_no
= /usr
/bin
/msgfmt
57 MSGFMT_yes
= /usr
/bin
/msgfmt
58 MSGFMT
= $(MSGFMT_
$(USE_MSGCTXT
))
59 XGETTEXT_
= /usr
/bin
/xgettext
60 XGETTEXT_no
= /usr
/bin
/xgettext
61 XGETTEXT_yes
= /usr
/bin
/xgettext
62 XGETTEXT
= $(XGETTEXT_
$(USE_MSGCTXT
))
64 MSGMERGE_UPDATE
= /usr
/bin
/msgmerge
--update
71 UPDATEPOFILES
= @UPDATEPOFILES@
72 DUMMYPOFILES
= @DUMMYPOFILES@
73 DISTFILES.common
= Makefile.in.in remove-potcdate.sin \
74 $(DISTFILES.common.extra1
) $(DISTFILES.common.extra2
) $(DISTFILES.common.extra3
)
75 DISTFILES
= $(DISTFILES.common
) Makevars POTFILES.in \
76 $(POFILES
) $(GMOFILES
) \
77 $(DISTFILES.extra1
) $(DISTFILES.extra2
) $(DISTFILES.extra3
)
83 POFILESDEPS_
= $(srcdir)/$(DOMAIN
).pot
84 POFILESDEPS_yes
= $(POFILESDEPS_
)
86 POFILESDEPS
= $(POFILESDEPS_
$(PO_DEPENDS_ON_POT
))
88 DISTFILESDEPS_
= update-po
89 DISTFILESDEPS_yes
= $(DISTFILESDEPS_
)
91 DISTFILESDEPS
= $(DISTFILESDEPS_
$(DIST_DEPENDS_ON_UPDATE_PO
))
93 # Makevars gets inserted here. (Don't remove this line!)
96 .SUFFIXES
: .po .gmo .mo .sed .sin .nop .po-create .po-update
99 @echo
"$(MSGFMT) -c -o $@ $<"; \
100 $(MSGFMT
) -c
-o t-
$@
$< && mv t-
$@
$@
103 @lang
=`echo $* | sed -e 's,.*/,,'`; \
104 test "$(srcdir)" = .
&& cdcmd
="" || cdcmd
="cd $(srcdir) && "; \
105 echo
"$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
106 cd
$(srcdir) && rm -f
$${lang}.gmo
&& $(GMSGFMT
) -c
--statistics
--verbose
-o t-
$${lang}.gmo
$${lang}.po
&& mv t-
$${lang}.gmo
$${lang}.gmo
109 sed
-e
'/^#/d' $< > t-
$@
118 # Ensure that the gettext macros and this Makefile.in.in are in sync.
119 CHECK_MACRO_VERSION
= \
120 test "$(GETTEXT_MACRO_VERSION)" = "0.19" \
121 ||
{ 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.19" 1>&2; \
125 # $(srcdir)/$(DOMAIN).pot is only created when needed. When xgettext finds no
126 # internationalized messages, no $(srcdir)/$(DOMAIN).pot is created (because
127 # we don't want to bother translators with empty POT files). We assume that
128 # LINGUAS is empty in this case, i.e. $(POFILES) and $(GMOFILES) are empty.
129 # In this case, stamp-po is a nop (i.e. a phony target).
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 @
$(CHECK_MACRO_VERSION
)
141 test ! -f
$(srcdir)/$(DOMAIN
).pot || \
142 test -z
"$(GMOFILES)" ||
$(MAKE
) $(GMOFILES
)
143 @
test ! -f
$(srcdir)/$(DOMAIN
).pot ||
{ \
144 echo
"touch stamp-po" && \
145 echo timestamp
> stamp-poT
&& \
146 mv stamp-poT stamp-po
; \
149 # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
150 # otherwise packages like GCC can not be built if only parts of the source
151 # have been downloaded.
153 # This target rebuilds $(DOMAIN).pot; it is an expensive operation.
154 # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed.
155 # The determination of whether the package xyz is a GNU one is based on the
156 # heuristic whether some file in the top level directory mentions "GNU xyz".
157 # If GNU 'find' is available, we avoid grepping through monster files.
158 $(DOMAIN
).pot-update
: $(POTFILES
) $(srcdir)/POTFILES.in remove-potcdate.sed
159 package_gnu
="$(PACKAGE_GNU)"; \
160 test -n
"$$package_gnu" ||
{ \
161 if
{ if
(LC_ALL
=C find
--version
) 2>/dev
/null | grep GNU
>/dev
/null
; then \
162 LC_ALL
=C find
-L
$(top_srcdir
) -maxdepth
1 -type f \
163 -size
-10000000c
-exec grep
'GNU recutils' \
164 /dev
/null
'{}' ';' 2>/dev
/null
; \
166 LC_ALL
=C grep
'GNU recutils' $(top_srcdir
)/* 2>/dev
/null
; \
168 } | grep
-v
'libtool:' >/dev
/null
; then \
174 if
test "$$package_gnu" = "yes"; then \
175 package_prefix
='GNU '; \
179 if
test -n
'$(MSGID_BUGS_ADDRESS)' ||
test '$(PACKAGE_BUGREPORT)' = '@'PACKAGE_BUGREPORT
'@'; then \
180 msgid_bugs_address
='$(MSGID_BUGS_ADDRESS)'; \
182 msgid_bugs_address
='$(PACKAGE_BUGREPORT)'; \
184 case
`$(XGETTEXT) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
185 '' |
0.
[0-9] |
0.
[0-9].
* |
0.1[0-5] |
0.1[0-5].
* |
0.16 |
0.16.
[0-1]*) \
186 $(XGETTEXT
) --default-domain
=$(DOMAIN
) --directory
=$(top_srcdir
) \
187 --add-comments
=TRANSLATORS
: $(XGETTEXT_OPTIONS
) --flag
=error
:3:c-format
--flag
=error_at_line
:5:c-format
--flag
=asprintf
:2:c-format
--flag
=vasprintf
:2:c-format \
188 --files-from
=$(srcdir)/POTFILES.in \
189 --copyright-holder
='$(COPYRIGHT_HOLDER)' \
190 --msgid-bugs-address
="$$msgid_bugs_address" \
193 $(XGETTEXT
) --default-domain
=$(DOMAIN
) --directory
=$(top_srcdir
) \
194 --add-comments
=TRANSLATORS
: $(XGETTEXT_OPTIONS
) --flag
=error
:3:c-format
--flag
=error_at_line
:5:c-format
--flag
=asprintf
:2:c-format
--flag
=vasprintf
:2:c-format \
195 --files-from
=$(srcdir)/POTFILES.in \
196 --copyright-holder
='$(COPYRIGHT_HOLDER)' \
197 --package-name
="$${package_prefix}recutils" \
198 --package-version
='1.8' \
199 --msgid-bugs-address
="$$msgid_bugs_address" \
202 test ! -f
$(DOMAIN
).po ||
{ \
203 if
test -f
$(srcdir)/$(DOMAIN
).pot-header
; then \
204 sed
-e
'1,/^#$$/d' < $(DOMAIN
).po
> $(DOMAIN
).1po
&& \
205 cat
$(srcdir)/$(DOMAIN
).pot-header
$(DOMAIN
).1po
> $(DOMAIN
).po
; \
206 rm -f
$(DOMAIN
).1po
; \
208 if
test -f
$(srcdir)/$(DOMAIN
).pot
; then \
209 sed
-f remove-potcdate.sed
< $(srcdir)/$(DOMAIN
).pot
> $(DOMAIN
).1po
&& \
210 sed
-f remove-potcdate.sed
< $(DOMAIN
).po
> $(DOMAIN
).2po
&& \
211 if cmp
$(DOMAIN
).1po
$(DOMAIN
).2po
>/dev
/null
2>&1; then \
212 rm -f
$(DOMAIN
).1po
$(DOMAIN
).2po
$(DOMAIN
).po
; \
214 rm -f
$(DOMAIN
).1po
$(DOMAIN
).2po
$(srcdir)/$(DOMAIN
).pot
&& \
215 mv
$(DOMAIN
).po
$(srcdir)/$(DOMAIN
).pot
; \
218 mv
$(DOMAIN
).po
$(srcdir)/$(DOMAIN
).pot
; \
222 # This rule has no dependencies: we don't need to update $(DOMAIN).pot at
223 # every "make" invocation, only create it when it is missing.
224 # Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
225 $(srcdir)/$(DOMAIN
).pot
:
226 $(MAKE
) $(DOMAIN
).pot-update
228 # This target rebuilds a PO file if $(DOMAIN).pot has changed.
229 # Note that a PO file is not touched if it doesn't need to be changed.
230 $(POFILES
): $(POFILESDEPS
)
231 @lang
=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
232 if
test -f
"$(srcdir)/$${lang}.po"; then \
233 test -f
$(srcdir)/$(DOMAIN
).pot ||
$(MAKE
) $(srcdir)/$(DOMAIN
).pot
; \
234 test "$(srcdir)" = .
&& cdcmd
="" || cdcmd
="cd $(srcdir) && "; \
235 echo
"$${cdcmd}$(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \
237 && { case
`$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
238 '' |
0.
[0-9] |
0.
[0-9].
* |
0.1[0-7] |
0.1[0-7].
*) \
239 $(MSGMERGE_UPDATE
) $(MSGMERGE_OPTIONS
) $${lang}.po
$(DOMAIN
).pot
;; \
241 $(MSGMERGE_UPDATE
) $(MSGMERGE_OPTIONS
) --lang
=$${lang} $${lang}.po
$(DOMAIN
).pot
;; \
245 $(MAKE
) $${lang}.po-create
; \
249 install: install-exec install-data
251 install-data
: install-data-yes
252 if
test "$(PACKAGE)" = "gettext-tools"; then \
253 $(mkdir_p
) $(DESTDIR
)$(gettextsrcdir
); \
254 for file in
$(DISTFILES.common
) Makevars.template
; do \
255 $(INSTALL_DATA
) $(srcdir)/$$file \
256 $(DESTDIR
)$(gettextsrcdir
)/$$file; \
258 for file in Makevars
; do \
259 rm -f
$(DESTDIR
)$(gettextsrcdir
)/$$file; \
265 install-data-yes
: all
266 @catalogs
='$(CATALOGS)'; \
267 for cat in
$$catalogs; do \
268 cat
=`basename $$cat`; \
269 lang
=`echo $$cat | sed -e 's/\.gmo$$//'`; \
270 dir=$(localedir
)/$$lang/LC_MESSAGES
; \
271 $(mkdir_p
) $(DESTDIR
)$$dir; \
272 if
test -r
$$cat; then realcat
=$$cat; else realcat
=$(srcdir)/$$cat; fi
; \
273 $(INSTALL_DATA
) $$realcat $(DESTDIR
)$$dir/$(DOMAIN
).mo
; \
274 echo
"installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \
275 for lc in
'' $(EXTRA_LOCALE_CATEGORIES
); do \
276 if
test -n
"$$lc"; then \
277 if
(cd
$(DESTDIR
)$(localedir
)/$$lang && LC_ALL
=C ls
-l
-d
$$lc 2>/dev
/null
) | grep
' -> ' >/dev
/null
; then \
278 link
=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
279 mv
$(DESTDIR
)$(localedir
)/$$lang/$$lc $(DESTDIR
)$(localedir
)/$$lang/$$lc.old
; \
280 mkdir
$(DESTDIR
)$(localedir
)/$$lang/$$lc; \
281 (cd
$(DESTDIR
)$(localedir
)/$$lang/$$lc.old
&& \
283 if
test -f
$$file; then \
284 ln
-s ..
/$$link/$$file $(DESTDIR
)$(localedir
)/$$lang/$$lc/$$file; \
287 rm -f
$(DESTDIR
)$(localedir
)/$$lang/$$lc.old
; \
289 if
test -d
$(DESTDIR
)$(localedir
)/$$lang/$$lc; then \
292 rm -f
$(DESTDIR
)$(localedir
)/$$lang/$$lc; \
293 mkdir
$(DESTDIR
)$(localedir
)/$$lang/$$lc; \
296 rm -f
$(DESTDIR
)$(localedir
)/$$lang/$$lc/$(DOMAIN
).mo
; \
297 ln
-s ..
/LC_MESSAGES
/$(DOMAIN
).mo
$(DESTDIR
)$(localedir
)/$$lang/$$lc/$(DOMAIN
).mo
2>/dev
/null || \
298 ln
$(DESTDIR
)$(localedir
)/$$lang/LC_MESSAGES
/$(DOMAIN
).mo
$(DESTDIR
)$(localedir
)/$$lang/$$lc/$(DOMAIN
).mo
2>/dev
/null || \
299 cp
-p
$(DESTDIR
)$(localedir
)/$$lang/LC_MESSAGES
/$(DOMAIN
).mo
$(DESTDIR
)$(localedir
)/$$lang/$$lc/$(DOMAIN
).mo
; \
300 echo
"installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \
305 install-strip
: install
307 installdirs: installdirs-exec installdirs-data
309 installdirs-data
: installdirs-data-yes
310 if
test "$(PACKAGE)" = "gettext-tools"; then \
311 $(mkdir_p
) $(DESTDIR
)$(gettextsrcdir
); \
316 installdirs-data-yes
:
317 @catalogs
='$(CATALOGS)'; \
318 for cat in
$$catalogs; do \
319 cat
=`basename $$cat`; \
320 lang
=`echo $$cat | sed -e 's/\.gmo$$//'`; \
321 dir=$(localedir
)/$$lang/LC_MESSAGES
; \
322 $(mkdir_p
) $(DESTDIR
)$$dir; \
323 for lc in
'' $(EXTRA_LOCALE_CATEGORIES
); do \
324 if
test -n
"$$lc"; then \
325 if
(cd
$(DESTDIR
)$(localedir
)/$$lang && LC_ALL
=C ls
-l
-d
$$lc 2>/dev
/null
) | grep
' -> ' >/dev
/null
; then \
326 link
=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \
327 mv
$(DESTDIR
)$(localedir
)/$$lang/$$lc $(DESTDIR
)$(localedir
)/$$lang/$$lc.old
; \
328 mkdir
$(DESTDIR
)$(localedir
)/$$lang/$$lc; \
329 (cd
$(DESTDIR
)$(localedir
)/$$lang/$$lc.old
&& \
331 if
test -f
$$file; then \
332 ln
-s ..
/$$link/$$file $(DESTDIR
)$(localedir
)/$$lang/$$lc/$$file; \
335 rm -f
$(DESTDIR
)$(localedir
)/$$lang/$$lc.old
; \
337 if
test -d
$(DESTDIR
)$(localedir
)/$$lang/$$lc; then \
340 rm -f
$(DESTDIR
)$(localedir
)/$$lang/$$lc; \
341 mkdir
$(DESTDIR
)$(localedir
)/$$lang/$$lc; \
348 # Define this as empty until I found a useful application.
351 uninstall: uninstall-exec uninstall-data
353 uninstall-data
: uninstall-data-yes
354 if
test "$(PACKAGE)" = "gettext-tools"; then \
355 for file in
$(DISTFILES.common
) Makevars.template
; do \
356 rm -f
$(DESTDIR
)$(gettextsrcdir
)/$$file; \
363 catalogs
='$(CATALOGS)'; \
364 for cat in
$$catalogs; do \
365 cat
=`basename $$cat`; \
366 lang
=`echo $$cat | sed -e 's/\.gmo$$//'`; \
367 for lc in LC_MESSAGES
$(EXTRA_LOCALE_CATEGORIES
); do \
368 rm -f
$(DESTDIR
)$(localedir
)/$$lang/$$lc/$(DOMAIN
).mo
; \
374 info dvi ps pdf html
tags TAGS ctags CTAGS ID
:
377 rm -f remove-potcdate.sed
379 rm -f core core.
* $(DOMAIN
).po
$(DOMAIN
).1po
$(DOMAIN
).2po
*.new.po
385 rm -f Makefile Makefile.in POTFILES
*.mo
387 maintainer-clean
: distclean
388 @echo
"This command is intended for maintainers to use;"
389 @echo
"it deletes files that may require special tools to rebuild."
390 rm -f stamp-po
$(GMOFILES
)
392 distdir
= $(top_builddir
)/$(PACKAGE
)-$(VERSION
)/$(subdir
)
394 test -z
"$(DISTFILESDEPS)" ||
$(MAKE
) $(DISTFILESDEPS
)
396 # This is a separate target because 'update-po' must be executed before.
397 dist2
: stamp-po
$(DISTFILES
)
398 dists
="$(DISTFILES)"; \
399 if
test "$(PACKAGE)" = "gettext-tools"; then \
400 dists
="$$dists Makevars.template"; \
402 if
test -f
$(srcdir)/$(DOMAIN
).pot
; then \
403 dists
="$$dists $(DOMAIN).pot stamp-po"; \
405 if
test -f
$(srcdir)/ChangeLog
; then \
406 dists
="$$dists ChangeLog"; \
408 for i in
0 1 2 3 4 5 6 7 8 9; do \
409 if
test -f
$(srcdir)/ChangeLog.
$$i; then \
410 dists
="$$dists ChangeLog.$$i"; \
413 if
test -f
$(srcdir)/LINGUAS
; then dists
="$$dists LINGUAS"; fi
; \
414 for file in
$$dists; do \
415 if
test -f
$$file; then \
416 cp
-p
$$file $(distdir
) || exit
1; \
418 cp
-p
$(srcdir)/$$file $(distdir
) || exit
1; \
423 $(MAKE
) $(DOMAIN
).pot-update
424 test -z
"$(UPDATEPOFILES)" ||
$(MAKE
) $(UPDATEPOFILES
)
427 # General rule for creating PO files.
430 @lang
=`echo $@ | sed -e 's/\.po-create$$//'`; \
431 echo
"File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \
434 # General rule for updating PO files.
437 @lang
=`echo $@ | sed -e 's/\.po-update$$//'`; \
438 if
test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH
=`pwd`/..
/src
:$$PATH; fi
; \
441 test "$(srcdir)" = .
&& cdcmd
="" || cdcmd
="cd $(srcdir) && "; \
442 echo
"$${cdcmd}$(MSGMERGE) $(MSGMERGE_OPTIONS) --lang=$$lang $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \
444 if
{ case
`$(MSGMERGE) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \
445 '' |
0.
[0-9] |
0.
[0-9].
* |
0.1[0-7] |
0.1[0-7].
*) \
446 $(MSGMERGE
) $(MSGMERGE_OPTIONS
) -o
$$tmpdir/$$lang.new.po
$$lang.po
$(DOMAIN
).pot
;; \
448 $(MSGMERGE
) $(MSGMERGE_OPTIONS
) --lang
=$$lang -o
$$tmpdir/$$lang.new.po
$$lang.po
$(DOMAIN
).pot
;; \
451 if cmp
$$lang.po
$$tmpdir/$$lang.new.po
>/dev
/null
2>&1; then \
452 rm -f
$$tmpdir/$$lang.new.po
; \
454 if mv
-f
$$tmpdir/$$lang.new.po
$$lang.po
; then \
457 echo
"msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \
462 echo
"msgmerge for $$lang.po failed!" 1>&2; \
463 rm -f
$$tmpdir/$$lang.new.po
; \
468 update-gmo
: Makefile
$(GMOFILES
)
471 # Recreate Makefile by invoking config.status. Explicitly invoke the shell,
472 # because execution permission bits may not work on the current file system.
473 # Use /bin/sh, which is the shell determined by autoconf for the use by its
474 # scripts, not $(SHELL) which is hardwired to /bin/sh and may be deficient.
475 Makefile
: Makefile.in.in Makevars
$(top_builddir
)/config.status @POMAKEFILEDEPS@
477 && /bin
/sh .
/config.status
$(subdir
)/$@.in po-directories
481 # Tell versions [3.59,3.63) of GNU make not to export all variables.
482 # Otherwise a system limit (for SysV at least) may be exceeded.