[15546] | 1 | # Makefile for program source directory in GNU NLS utilities package. |
---|
[18382] | 2 | # Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu> |
---|
[15546] | 3 | # |
---|
| 4 | # This file file be copied and used freely without restrictions. It can |
---|
| 5 | # be used in projects which are not available under the GNU Public License |
---|
| 6 | # but which still want to provide support for the GNU gettext functionality. |
---|
| 7 | # Please note that the actual code is *not* freely available. |
---|
[18382] | 8 | # |
---|
| 9 | # - Modified by Owen Taylor <otaylor@redhat.com> to use GETTEXT_PACKAGE |
---|
| 10 | # instead of PACKAGE and to look for po2tbl in ./ not in intl/ |
---|
| 11 | # |
---|
| 12 | # - Modified by jacob berkman <jacob@ximian.com> to install |
---|
| 13 | # Makefile.in.in and po2tbl.sed.in for use with glib-gettextize |
---|
[15546] | 14 | |
---|
[18382] | 15 | GETTEXT_PACKAGE = @GETTEXT_PACKAGE@ |
---|
[15546] | 16 | PACKAGE = @PACKAGE@ |
---|
| 17 | VERSION = @VERSION@ |
---|
| 18 | |
---|
| 19 | SHELL = /bin/sh |
---|
| 20 | @SET_MAKE@ |
---|
| 21 | |
---|
| 22 | srcdir = @srcdir@ |
---|
| 23 | top_srcdir = @top_srcdir@ |
---|
[18382] | 24 | top_builddir = .. |
---|
[15546] | 25 | VPATH = @srcdir@ |
---|
| 26 | |
---|
| 27 | prefix = @prefix@ |
---|
| 28 | exec_prefix = @exec_prefix@ |
---|
[18662] | 29 | datadir = @datadir@ |
---|
| 30 | libdir = @libdir@ |
---|
| 31 | localedir = $(libdir)/locale |
---|
| 32 | gnulocaledir = $(datadir)/locale |
---|
| 33 | gettextsrcdir = $(datadir)/glib-2.0/gettext/po |
---|
[18382] | 34 | subdir = po |
---|
[15546] | 35 | |
---|
| 36 | INSTALL = @INSTALL@ |
---|
| 37 | INSTALL_DATA = @INSTALL_DATA@ |
---|
[18382] | 38 | MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@ |
---|
[15546] | 39 | |
---|
| 40 | CC = @CC@ |
---|
[18382] | 41 | GENCAT = @GENCAT@ |
---|
[18662] | 42 | GMSGFMT = @GMSGFMT@ |
---|
[15546] | 43 | MSGFMT = @MSGFMT@ |
---|
[18662] | 44 | XGETTEXT = @XGETTEXT@ |
---|
[18382] | 45 | INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ |
---|
| 46 | INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ |
---|
| 47 | MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist |
---|
| 48 | GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot |
---|
[16899] | 49 | |
---|
[15546] | 50 | DEFS = @DEFS@ |
---|
| 51 | CFLAGS = @CFLAGS@ |
---|
| 52 | CPPFLAGS = @CPPFLAGS@ |
---|
| 53 | |
---|
| 54 | INCLUDES = -I.. -I$(top_srcdir)/intl |
---|
| 55 | |
---|
| 56 | COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) |
---|
| 57 | |
---|
[18382] | 58 | SOURCES = |
---|
[15546] | 59 | POFILES = @POFILES@ |
---|
| 60 | GMOFILES = @GMOFILES@ |
---|
[18382] | 61 | DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(GETTEXT_PACKAGE).pot \ |
---|
| 62 | $(POFILES) $(GMOFILES) $(SOURCES) |
---|
[15546] | 63 | |
---|
| 64 | POTFILES = \ |
---|
| 65 | |
---|
| 66 | CATALOGS = @CATALOGS@ |
---|
[18382] | 67 | CATOBJEXT = @CATOBJEXT@ |
---|
| 68 | INSTOBJEXT = @INSTOBJEXT@ |
---|
[15546] | 69 | |
---|
| 70 | .SUFFIXES: |
---|
[18382] | 71 | .SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat |
---|
[15546] | 72 | |
---|
| 73 | .c.o: |
---|
| 74 | $(COMPILE) $< |
---|
| 75 | |
---|
| 76 | .po.pox: |
---|
[18382] | 77 | $(MAKE) $(GETTEXT_PACKAGE).pot |
---|
| 78 | $(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox |
---|
[15546] | 79 | |
---|
| 80 | .po.mo: |
---|
| 81 | $(MSGFMT) -o $@ $< |
---|
| 82 | |
---|
| 83 | .po.gmo: |
---|
| 84 | file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ |
---|
[18382] | 85 | && rm -f $$file && $(GMSGFMT) -o $$file $< |
---|
[15546] | 86 | |
---|
[18382] | 87 | .po.cat: |
---|
| 88 | sed -f ../intl/po2msg.sed < $< > $*.msg \ |
---|
| 89 | && rm -f $@ && $(GENCAT) $@ $*.msg |
---|
[15546] | 90 | |
---|
[18382] | 91 | |
---|
[15546] | 92 | all: all-@USE_NLS@ |
---|
| 93 | |
---|
[16899] | 94 | all-yes: $(CATALOGS) |
---|
[15546] | 95 | all-no: |
---|
| 96 | |
---|
[18382] | 97 | $(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES) |
---|
[15546] | 98 | $(GENPOT) |
---|
| 99 | |
---|
| 100 | install: install-exec install-data |
---|
| 101 | install-exec: |
---|
| 102 | install-data: install-data-@USE_NLS@ |
---|
[18382] | 103 | install-data-no: all |
---|
| 104 | install-data-yes: all |
---|
| 105 | if test -r "$(MKINSTALLDIRS)"; then \ |
---|
| 106 | $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \ |
---|
[15546] | 107 | else \ |
---|
[18382] | 108 | $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \ |
---|
[15546] | 109 | fi |
---|
| 110 | @catalogs='$(CATALOGS)'; \ |
---|
| 111 | for cat in $$catalogs; do \ |
---|
| 112 | cat=`basename $$cat`; \ |
---|
[18382] | 113 | case "$$cat" in \ |
---|
| 114 | *.gmo) destdir=$(gnulocaledir);; \ |
---|
| 115 | *) destdir=$(localedir);; \ |
---|
| 116 | esac; \ |
---|
| 117 | lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ |
---|
| 118 | dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \ |
---|
| 119 | if test -r "$(MKINSTALLDIRS)"; then \ |
---|
| 120 | $(MKINSTALLDIRS) $$dir; \ |
---|
| 121 | else \ |
---|
| 122 | $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \ |
---|
| 123 | fi; \ |
---|
[15546] | 124 | if test -r $$cat; then \ |
---|
[18382] | 125 | $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ |
---|
| 126 | echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \ |
---|
[15546] | 127 | else \ |
---|
[18382] | 128 | $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ |
---|
[15546] | 129 | echo "installing $(srcdir)/$$cat as" \ |
---|
[18382] | 130 | "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \ |
---|
[15546] | 131 | fi; \ |
---|
[18382] | 132 | if test -r $$cat.m; then \ |
---|
| 133 | $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ |
---|
| 134 | echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \ |
---|
| 135 | else \ |
---|
| 136 | if test -r $(srcdir)/$$cat.m ; then \ |
---|
| 137 | $(INSTALL_DATA) $(srcdir)/$$cat.m \ |
---|
| 138 | $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ |
---|
| 139 | echo "installing $(srcdir)/$$cat as" \ |
---|
| 140 | "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \ |
---|
| 141 | else \ |
---|
| 142 | true; \ |
---|
| 143 | fi; \ |
---|
| 144 | fi; \ |
---|
[15546] | 145 | done |
---|
[18382] | 146 | if test "$(PACKAGE)" = "glib"; then \ |
---|
| 147 | if test -r "$(MKINSTALLDIRS)"; then \ |
---|
| 148 | $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \ |
---|
| 149 | else \ |
---|
| 150 | $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \ |
---|
| 151 | fi; \ |
---|
| 152 | $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ |
---|
| 153 | $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ |
---|
| 154 | else \ |
---|
| 155 | : ; \ |
---|
| 156 | fi |
---|
[15546] | 157 | |
---|
| 158 | # Define this as empty until I found a useful application. |
---|
| 159 | installcheck: |
---|
| 160 | |
---|
| 161 | uninstall: |
---|
| 162 | catalogs='$(CATALOGS)'; \ |
---|
| 163 | for cat in $$catalogs; do \ |
---|
| 164 | cat=`basename $$cat`; \ |
---|
[18382] | 165 | lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ |
---|
| 166 | rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ |
---|
| 167 | rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ |
---|
| 168 | rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ |
---|
| 169 | rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ |
---|
[15546] | 170 | done |
---|
[18382] | 171 | rm -f $(DESTDIR)$(gettextsrcdir)/po-Makefile.in.in |
---|
[15546] | 172 | |
---|
| 173 | check: all |
---|
| 174 | |
---|
| 175 | dvi info tags TAGS ID: |
---|
| 176 | |
---|
| 177 | mostlyclean: |
---|
[18382] | 178 | rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp |
---|
[15546] | 179 | rm -fr *.o |
---|
| 180 | |
---|
| 181 | clean: mostlyclean |
---|
| 182 | |
---|
| 183 | distclean: clean |
---|
[18382] | 184 | rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m |
---|
[15546] | 185 | |
---|
| 186 | maintainer-clean: distclean |
---|
| 187 | @echo "This command is intended for maintainers to use;" |
---|
| 188 | @echo "it deletes files that may require special tools to rebuild." |
---|
| 189 | rm -f $(GMOFILES) |
---|
| 190 | |
---|
[18382] | 191 | distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir) |
---|
| 192 | dist distdir: update-po $(DISTFILES) |
---|
[15546] | 193 | dists="$(DISTFILES)"; \ |
---|
| 194 | for file in $$dists; do \ |
---|
[18382] | 195 | ln $(srcdir)/$$file $(distdir) 2> /dev/null \ |
---|
| 196 | || cp -p $(srcdir)/$$file $(distdir); \ |
---|
[15546] | 197 | done |
---|
| 198 | |
---|
| 199 | update-po: Makefile |
---|
[18382] | 200 | $(MAKE) $(GETTEXT_PACKAGE).pot |
---|
[15546] | 201 | cd $(srcdir); \ |
---|
[18382] | 202 | catalogs='$(CATALOGS)'; \ |
---|
[15546] | 203 | for cat in $$catalogs; do \ |
---|
| 204 | cat=`basename $$cat`; \ |
---|
[18382] | 205 | lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ |
---|
[15546] | 206 | cp $$lang.po $$lang.old.po; \ |
---|
| 207 | echo "$$lang:"; \ |
---|
[18382] | 208 | if $(MSGMERGE) $$lang; then \ |
---|
| 209 | rm -f $$lang.old.po; \ |
---|
[15546] | 210 | else \ |
---|
| 211 | echo "msgmerge for $$cat failed!"; \ |
---|
[18382] | 212 | rm -f $$lang.po; \ |
---|
| 213 | mv $$lang.old.po $$lang.po; \ |
---|
[15546] | 214 | fi; \ |
---|
| 215 | done |
---|
| 216 | |
---|
| 217 | .po: Makefile |
---|
| 218 | $(MAKE) $(PACKAGE).pot; |
---|
| 219 | PATH=`pwd`/../src:$$PATH; \ |
---|
| 220 | echo; printf "$*: "; \ |
---|
| 221 | if $(MSGMERGE) $*; then \ |
---|
| 222 | rm -f $*.old.po; \ |
---|
| 223 | else \ |
---|
| 224 | echo "msgmerge for * failed!"; \ |
---|
| 225 | mv $*.old.po $*.po; \ |
---|
| 226 | fi; \ |
---|
| 227 | msgfmt --statistics $*.po; echo; |
---|
| 228 | |
---|
| 229 | |
---|
[18382] | 230 | # POTFILES is created from POTFILES.in by stripping comments, empty lines |
---|
| 231 | # and Intltool tags (enclosed in square brackets), and appending a full |
---|
| 232 | # relative path to them |
---|
| 233 | POTFILES: POTFILES.in |
---|
| 234 | ( if test 'x$(srcdir)' != 'x.'; then \ |
---|
| 235 | posrcprefix='$(top_srcdir)/'; \ |
---|
| 236 | else \ |
---|
| 237 | posrcprefix="../"; \ |
---|
| 238 | fi; \ |
---|
| 239 | rm -f $@-t $@ \ |
---|
| 240 | && (sed -e '/^#/d' \ |
---|
| 241 | -e "s/^\[.*\] +//" \ |
---|
| 242 | -e '/^[ ]*$$/d' \ |
---|
| 243 | -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ |
---|
| 244 | | sed -e '$$s/\\$$//') > $@-t \ |
---|
| 245 | && chmod a-w $@-t \ |
---|
| 246 | && mv $@-t $@ ) |
---|
[15546] | 247 | |
---|
[18382] | 248 | Makefile: Makefile.in.in ../config.status POTFILES |
---|
| 249 | cd .. \ |
---|
[15546] | 250 | && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ |
---|
| 251 | $(SHELL) ./config.status |
---|
| 252 | |
---|
| 253 | # Tell versions [3.59,3.63) of GNU make not to export all variables. |
---|
| 254 | # Otherwise a system limit (for SysV at least) may be exceeded. |
---|
| 255 | .NOEXPORT: |
---|