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