Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 1 | # Makefile for PO directory in any package using GNU gettext. |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 2 | # Copyright (C) 1995-1997, 2000-2004 by Ulrich Drepper <drepper@gnu.ai.mit.edu> |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 3 | # |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 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. |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 10 | # |
| 11 | # Origin: gettext-0.14 |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 12 | |
| 13 | PACKAGE = @PACKAGE@ |
| 14 | VERSION = @VERSION@ |
| 15 | |
| 16 | SHELL = /bin/sh |
| 17 | @SET_MAKE@ |
| 18 | |
| 19 | srcdir = @srcdir@ |
| 20 | top_srcdir = @top_srcdir@ |
| 21 | VPATH = @srcdir@ |
| 22 | |
| 23 | prefix = @prefix@ |
| 24 | exec_prefix = @exec_prefix@ |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 25 | datadir = @datadir@ |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 26 | localedir = $(datadir)/locale |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 27 | gettextsrcdir = $(datadir)/gettext/po |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 28 | |
| 29 | INSTALL = @INSTALL@ |
| 30 | INSTALL_DATA = @INSTALL_DATA@ |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 31 | MKINSTALLDIRS = @MKINSTALLDIRS@ |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 32 | mkinstalldirs = $(SHELL) $(MKINSTALLDIRS) |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 33 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 34 | GMSGFMT = @GMSGFMT@ |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 35 | MSGFMT = @MSGFMT@ |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 36 | XGETTEXT = @XGETTEXT@ |
| 37 | MSGMERGE = msgmerge |
| 38 | MSGMERGE_UPDATE = @MSGMERGE@ --update |
| 39 | MSGINIT = msginit |
| 40 | MSGCONV = msgconv |
| 41 | MSGFILTER = msgfilter |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 42 | |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 43 | POFILES = @POFILES@ |
| 44 | GMOFILES = @GMOFILES@ |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 45 | UPDATEPOFILES = @UPDATEPOFILES@ |
| 46 | DUMMYPOFILES = @DUMMYPOFILES@ |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 47 | DISTFILES.common = Makefile.in.in remove-potcdate.sin \ |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 48 | $(DISTFILES.common.extra1) $(DISTFILES.common.extra2) $(DISTFILES.common.extra3) |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 49 | DISTFILES = $(DISTFILES.common) Makevars POTFILES.in $(DOMAIN).pot stamp-po \ |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 50 | $(POFILES) $(GMOFILES) \ |
| 51 | $(DISTFILES.extra1) $(DISTFILES.extra2) $(DISTFILES.extra3) |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 52 | |
| 53 | POTFILES = \ |
| 54 | |
| 55 | CATALOGS = @CATALOGS@ |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 56 | |
| 57 | # Makevars gets inserted here. (Don't remove this line!) |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 58 | |
| 59 | .SUFFIXES: |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 60 | .SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 61 | |
| 62 | .po.mo: |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 63 | @echo "$(MSGFMT) -c -o $@ $<"; \ |
| 64 | $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@ |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 65 | |
| 66 | .po.gmo: |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 67 | @lang=`echo $* | sed -e 's,.*/,,'`; \ |
| 68 | test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 69 | echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \ |
| 70 | cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 71 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 72 | .sin.sed: |
| 73 | sed -e '/^#/d' $< > t-$@ |
| 74 | mv t-$@ $@ |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 75 | |
| 76 | |
| 77 | all: all-@USE_NLS@ |
| 78 | |
Theodore Ts'o | 98919bd | 2005-02-04 10:43:58 -0500 | [diff] [blame] | 79 | all-yes: @MAINTAINER_CMT@stamp-po |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 80 | all-no: |
| 81 | |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 82 | # stamp-po is a timestamp denoting the last time at which the CATALOGS have |
| 83 | # been loosely updated. Its purpose is that when a developer or translator |
| 84 | # checks out the package via CVS, and the $(DOMAIN).pot file is not in CVS, |
| 85 | # "make" will update the $(DOMAIN).pot and the $(CATALOGS), but subsequent |
| 86 | # invocations of "make" will do nothing. This timestamp would not be necessary |
| 87 | # if updating the $(CATALOGS) would always touch them; however, the rule for |
| 88 | # $(POFILES) has been designed to not touch files that don't need to be |
| 89 | # changed. |
| 90 | stamp-po: $(srcdir)/$(DOMAIN).pot |
| 91 | test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES) |
| 92 | @echo "touch stamp-po" |
| 93 | @echo timestamp > stamp-poT |
| 94 | @mv stamp-poT stamp-po |
| 95 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 96 | # Note: Target 'all' must not depend on target '$(DOMAIN).pot-update', |
| 97 | # otherwise packages like GCC can not be built if only parts of the source |
| 98 | # have been downloaded. |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 99 | |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 100 | # This target rebuilds $(DOMAIN).pot; it is an expensive operation. |
| 101 | # Note that $(DOMAIN).pot is not touched if it doesn't need to be changed. |
Theodore Ts'o | 7ae1983 | 2005-06-19 09:45:36 -0400 | [diff] [blame] | 102 | $(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed \ |
| 103 | $(srcdir)/at-expand.pl |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 104 | $(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \ |
| 105 | --add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \ |
| 106 | --files-from=$(srcdir)/POTFILES.in \ |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 107 | --copyright-holder='$(COPYRIGHT_HOLDER)' \ |
| 108 | --msgid-bugs-address='$(MSGID_BUGS_ADDRESS)' |
Theodore Ts'o | c0b7e79 | 2005-05-09 20:39:02 -0400 | [diff] [blame] | 109 | perl $(srcdir)/at-expand.pl < $(DOMAIN).po > $(DOMAIN).po.new |
| 110 | mv $(DOMAIN).po $(DOMAIN).po.bak |
| 111 | mv $(DOMAIN).po.new $(DOMAIN).po |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 112 | test ! -f $(DOMAIN).po || { \ |
| 113 | if test -f $(srcdir)/$(DOMAIN).pot; then \ |
| 114 | sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \ |
| 115 | sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \ |
| 116 | if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \ |
| 117 | rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \ |
| 118 | else \ |
| 119 | rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \ |
| 120 | mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ |
| 121 | fi; \ |
| 122 | else \ |
| 123 | mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \ |
| 124 | fi; \ |
| 125 | } |
| 126 | |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 127 | # This rule has no dependencies: we don't need to update $(DOMAIN).pot at |
| 128 | # every "make" invocation, only create it when it is missing. |
| 129 | # Only "make $(DOMAIN).pot-update" or "make dist" will force an update. |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 130 | $(srcdir)/$(DOMAIN).pot: |
| 131 | $(MAKE) $(DOMAIN).pot-update |
| 132 | |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 133 | # This target rebuilds a PO file if $(DOMAIN).pot has changed. |
| 134 | # Note that a PO file is not touched if it doesn't need to be changed. |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 135 | $(POFILES): $(srcdir)/$(DOMAIN).pot |
| 136 | @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \ |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 137 | if test -f "$(srcdir)/$${lang}.po"; then \ |
| 138 | test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ |
| 139 | echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \ |
| 140 | cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \ |
| 141 | else \ |
| 142 | $(MAKE) $${lang}.po-create; \ |
| 143 | fi |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 144 | |
| 145 | |
| 146 | install: install-exec install-data |
| 147 | install-exec: |
| 148 | install-data: install-data-@USE_NLS@ |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 149 | if test "$(PACKAGE)" = "gettext-tools"; then \ |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 150 | $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 151 | for file in $(DISTFILES.common) Makevars.template; do \ |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 152 | $(INSTALL_DATA) $(srcdir)/$$file \ |
| 153 | $(DESTDIR)$(gettextsrcdir)/$$file; \ |
| 154 | done; \ |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 155 | for file in Makevars; do \ |
| 156 | rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ |
| 157 | done; \ |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 158 | else \ |
| 159 | : ; \ |
| 160 | fi |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 161 | install-data-no: all |
| 162 | install-data-yes: all |
| 163 | $(mkinstalldirs) $(DESTDIR)$(datadir) |
| 164 | @catalogs='$(CATALOGS)'; \ |
| 165 | for cat in $$catalogs; do \ |
| 166 | cat=`basename $$cat`; \ |
| 167 | lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ |
| 168 | dir=$(localedir)/$$lang/LC_MESSAGES; \ |
| 169 | $(mkinstalldirs) $(DESTDIR)$$dir; \ |
| 170 | if test -r $$cat; then realcat=$$cat; else realcat=$(srcdir)/$$cat; fi; \ |
| 171 | $(INSTALL_DATA) $$realcat $(DESTDIR)$$dir/$(DOMAIN).mo; \ |
| 172 | echo "installing $$realcat as $(DESTDIR)$$dir/$(DOMAIN).mo"; \ |
| 173 | for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ |
| 174 | if test -n "$$lc"; then \ |
| 175 | if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ |
| 176 | link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ |
| 177 | mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ |
| 178 | mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ |
| 179 | (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ |
| 180 | for file in *; do \ |
| 181 | if test -f $$file; then \ |
| 182 | ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ |
| 183 | fi; \ |
| 184 | done); \ |
| 185 | rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ |
| 186 | else \ |
| 187 | if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ |
| 188 | :; \ |
| 189 | else \ |
| 190 | rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ |
| 191 | mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ |
| 192 | fi; \ |
| 193 | fi; \ |
| 194 | rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ |
| 195 | ln -s ../LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ |
| 196 | ln $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo 2>/dev/null || \ |
| 197 | cp -p $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(DOMAIN).mo $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ |
| 198 | echo "installing $$realcat link as $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo"; \ |
| 199 | fi; \ |
| 200 | done; \ |
| 201 | done |
| 202 | |
| 203 | install-strip: install |
| 204 | |
| 205 | installdirs: installdirs-exec installdirs-data |
| 206 | installdirs-exec: |
| 207 | installdirs-data: installdirs-data-@USE_NLS@ |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 208 | if test "$(PACKAGE)" = "gettext-tools"; then \ |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 209 | $(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \ |
| 210 | else \ |
| 211 | : ; \ |
| 212 | fi |
| 213 | installdirs-data-no: |
| 214 | installdirs-data-yes: |
| 215 | $(mkinstalldirs) $(DESTDIR)$(datadir) |
| 216 | @catalogs='$(CATALOGS)'; \ |
| 217 | for cat in $$catalogs; do \ |
| 218 | cat=`basename $$cat`; \ |
| 219 | lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ |
| 220 | dir=$(localedir)/$$lang/LC_MESSAGES; \ |
| 221 | $(mkinstalldirs) $(DESTDIR)$$dir; \ |
| 222 | for lc in '' $(EXTRA_LOCALE_CATEGORIES); do \ |
| 223 | if test -n "$$lc"; then \ |
| 224 | if (cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc 2>/dev/null) | grep ' -> ' >/dev/null; then \ |
| 225 | link=`cd $(DESTDIR)$(localedir)/$$lang && LC_ALL=C ls -l -d $$lc | sed -e 's/^.* -> //'`; \ |
| 226 | mv $(DESTDIR)$(localedir)/$$lang/$$lc $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ |
| 227 | mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ |
| 228 | (cd $(DESTDIR)$(localedir)/$$lang/$$lc.old && \ |
| 229 | for file in *; do \ |
| 230 | if test -f $$file; then \ |
| 231 | ln -s ../$$link/$$file $(DESTDIR)$(localedir)/$$lang/$$lc/$$file; \ |
| 232 | fi; \ |
| 233 | done); \ |
| 234 | rm -f $(DESTDIR)$(localedir)/$$lang/$$lc.old; \ |
| 235 | else \ |
| 236 | if test -d $(DESTDIR)$(localedir)/$$lang/$$lc; then \ |
| 237 | :; \ |
| 238 | else \ |
| 239 | rm -f $(DESTDIR)$(localedir)/$$lang/$$lc; \ |
| 240 | mkdir $(DESTDIR)$(localedir)/$$lang/$$lc; \ |
| 241 | fi; \ |
| 242 | fi; \ |
| 243 | fi; \ |
| 244 | done; \ |
| 245 | done |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 246 | |
| 247 | # Define this as empty until I found a useful application. |
| 248 | installcheck: |
| 249 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 250 | uninstall: uninstall-exec uninstall-data |
| 251 | uninstall-exec: |
| 252 | uninstall-data: uninstall-data-@USE_NLS@ |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 253 | if test "$(PACKAGE)" = "gettext-tools"; then \ |
| 254 | for file in $(DISTFILES.common) Makevars.template; do \ |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 255 | rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \ |
| 256 | done; \ |
| 257 | else \ |
| 258 | : ; \ |
| 259 | fi |
| 260 | uninstall-data-no: |
| 261 | uninstall-data-yes: |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 262 | catalogs='$(CATALOGS)'; \ |
| 263 | for cat in $$catalogs; do \ |
| 264 | cat=`basename $$cat`; \ |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 265 | lang=`echo $$cat | sed -e 's/\.gmo$$//'`; \ |
| 266 | for lc in LC_MESSAGES $(EXTRA_LOCALE_CATEGORIES); do \ |
| 267 | rm -f $(DESTDIR)$(localedir)/$$lang/$$lc/$(DOMAIN).mo; \ |
| 268 | done; \ |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 269 | done |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 270 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 271 | check: all |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 272 | |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 273 | info dvi ps pdf html tags TAGS ctags CTAGS ID: |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 274 | |
| 275 | mostlyclean: |
Theodore Ts'o | c0b7e79 | 2005-05-09 20:39:02 -0400 | [diff] [blame] | 276 | rm -f remove-potcdate.sed |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 277 | rm -f stamp-poT |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 278 | rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po |
Theodore Ts'o | c0b7e79 | 2005-05-09 20:39:02 -0400 | [diff] [blame] | 279 | rm -f $(DOMAIN).po.bak |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 280 | rm -fr *.o |
| 281 | |
| 282 | clean: mostlyclean |
| 283 | |
| 284 | distclean: clean |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 285 | rm -f Makefile Makefile.in POTFILES *.mo |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 286 | |
| 287 | maintainer-clean: distclean |
| 288 | @echo "This command is intended for maintainers to use;" |
| 289 | @echo "it deletes files that may require special tools to rebuild." |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 290 | rm -f stamp-po $(GMOFILES) |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 291 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 292 | distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) |
| 293 | dist distdir: |
| 294 | $(MAKE) update-po |
| 295 | @$(MAKE) dist2 |
| 296 | # This is a separate target because 'update-po' must be executed before. |
| 297 | dist2: $(DISTFILES) |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 298 | dists="$(DISTFILES)"; \ |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 299 | if test "$(PACKAGE)" = "gettext-tools"; then \ |
| 300 | dists="$$dists Makevars.template"; \ |
| 301 | fi; \ |
| 302 | if test -f $(srcdir)/ChangeLog; then \ |
| 303 | dists="$$dists ChangeLog"; \ |
| 304 | fi; \ |
| 305 | for i in 0 1 2 3 4 5 6 7 8 9; do \ |
| 306 | if test -f $(srcdir)/ChangeLog.$$i; then \ |
| 307 | dists="$$dists ChangeLog.$$i"; \ |
| 308 | fi; \ |
| 309 | done; \ |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 310 | if test -f $(srcdir)/LINGUAS; then dists="$$dists LINGUAS"; fi; \ |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 311 | for file in $$dists; do \ |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 312 | if test -f $$file; then \ |
| 313 | cp -p $$file $(distdir); \ |
| 314 | else \ |
| 315 | cp -p $(srcdir)/$$file $(distdir); \ |
| 316 | fi; \ |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 317 | done |
| 318 | |
| 319 | update-po: Makefile |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 320 | $(MAKE) $(DOMAIN).pot-update |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 321 | test -z "$(UPDATEPOFILES)" || $(MAKE) $(UPDATEPOFILES) |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 322 | $(MAKE) update-gmo |
| 323 | |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 324 | # General rule for creating PO files. |
| 325 | |
| 326 | .nop.po-create: |
| 327 | @lang=`echo $@ | sed -e 's/\.po-create$$//'`; \ |
| 328 | echo "File $$lang.po does not exist. If you are a translator, you can create it through 'msginit'." 1>&2; \ |
| 329 | exit 1 |
| 330 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 331 | # General rule for updating PO files. |
| 332 | |
| 333 | .nop.po-update: |
| 334 | @lang=`echo $@ | sed -e 's/\.po-update$$//'`; \ |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 335 | if test "$(PACKAGE)" = "gettext-tools"; then PATH=`pwd`/../src:$$PATH; fi; \ |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 336 | tmpdir=`pwd`; \ |
| 337 | echo "$$lang:"; \ |
| 338 | test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \ |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 339 | echo "$${cdcmd}$(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$lang.new.po"; \ |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 340 | cd $(srcdir); \ |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 341 | if $(MSGMERGE) $$lang.po $(DOMAIN).pot -o $$tmpdir/$$lang.new.po; then \ |
| 342 | if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ |
| 343 | rm -f $$tmpdir/$$lang.new.po; \ |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 344 | else \ |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 345 | if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ |
| 346 | :; \ |
| 347 | else \ |
| 348 | echo "msgmerge for $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ |
| 349 | exit 1; \ |
| 350 | fi; \ |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 351 | fi; \ |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 352 | else \ |
| 353 | echo "msgmerge for $$lang.po failed!" 1>&2; \ |
| 354 | rm -f $$tmpdir/$$lang.new.po; \ |
| 355 | fi |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 356 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 357 | $(DUMMYPOFILES): |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 358 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 359 | update-gmo: Makefile $(GMOFILES) |
| 360 | @: |
| 361 | |
Theodore Ts'o | b0cacab | 2004-11-30 19:00:19 -0500 | [diff] [blame] | 362 | Makefile: Makefile.in.in $(top_builddir)/config.status @POMAKEFILEDEPS@ |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 363 | cd $(top_builddir) \ |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 364 | && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ |
| 365 | $(SHELL) ./config.status |
| 366 | |
Theodore Ts'o | a04eba3 | 2003-05-03 16:35:17 -0400 | [diff] [blame] | 367 | force: |
| 368 | |
Theodore Ts'o | 5bc5a89 | 2000-02-08 20:20:46 +0000 | [diff] [blame] | 369 | # Tell versions [3.59,3.63) of GNU make not to export all variables. |
| 370 | # Otherwise a system limit (for SysV at least) may be exceeded. |
| 371 | .NOEXPORT: |