[18371] | 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@ |
---|
| 29 | datadir = $(prefix)/@DATADIRNAME@ |
---|
| 30 | localedir = $(datadir)/locale |
---|
| 31 | gnulocaledir = $(prefix)/share/locale |
---|
| 32 | gettextsrcdir = $(prefix)/share/glib-2.0/gettext/po |
---|
| 33 | subdir = po |
---|
| 34 | |
---|
| 35 | INSTALL = @INSTALL@ |
---|
| 36 | INSTALL_DATA = @INSTALL_DATA@ |
---|
| 37 | MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@ |
---|
| 38 | |
---|
| 39 | CC = @CC@ |
---|
| 40 | GENCAT = @GENCAT@ |
---|
| 41 | GMSGFMT = PATH=../src:$$PATH @GMSGFMT@ |
---|
| 42 | MSGFMT = @MSGFMT@ |
---|
| 43 | XGETTEXT = PATH=../src:$$PATH @XGETTEXT@ |
---|
| 44 | INTLTOOL_UPDATE = @INTLTOOL_UPDATE@ |
---|
| 45 | INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@ |
---|
| 46 | MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist |
---|
| 47 | GENPOT = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot |
---|
| 48 | |
---|
| 49 | DEFS = @DEFS@ |
---|
| 50 | CFLAGS = @CFLAGS@ |
---|
| 51 | CPPFLAGS = @CPPFLAGS@ |
---|
| 52 | |
---|
| 53 | INCLUDES = -I.. -I$(top_srcdir)/intl |
---|
| 54 | |
---|
| 55 | COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) |
---|
| 56 | |
---|
| 57 | SOURCES = |
---|
| 58 | POFILES = @POFILES@ |
---|
| 59 | GMOFILES = @GMOFILES@ |
---|
| 60 | DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(GETTEXT_PACKAGE).pot \ |
---|
| 61 | $(POFILES) $(GMOFILES) $(SOURCES) |
---|
| 62 | |
---|
| 63 | POTFILES = \ |
---|
| 64 | |
---|
| 65 | CATALOGS = @CATALOGS@ |
---|
| 66 | CATOBJEXT = @CATOBJEXT@ |
---|
| 67 | INSTOBJEXT = @INSTOBJEXT@ |
---|
| 68 | |
---|
| 69 | .SUFFIXES: |
---|
| 70 | .SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat |
---|
| 71 | |
---|
| 72 | .c.o: |
---|
| 73 | $(COMPILE) $< |
---|
| 74 | |
---|
| 75 | .po.pox: |
---|
| 76 | $(MAKE) $(GETTEXT_PACKAGE).pot |
---|
| 77 | $(MSGMERGE) $< $(srcdir)/$(GETTEXT_PACKAGE).pot -o $*.pox |
---|
| 78 | |
---|
| 79 | .po.mo: |
---|
| 80 | $(MSGFMT) -o $@ $< |
---|
| 81 | |
---|
| 82 | .po.gmo: |
---|
| 83 | file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ |
---|
| 84 | && rm -f $$file && $(GMSGFMT) -o $$file $< |
---|
| 85 | |
---|
| 86 | .po.cat: |
---|
| 87 | sed -f ../intl/po2msg.sed < $< > $*.msg \ |
---|
| 88 | && rm -f $@ && $(GENCAT) $@ $*.msg |
---|
| 89 | |
---|
| 90 | |
---|
| 91 | all: all-@USE_NLS@ |
---|
| 92 | |
---|
| 93 | all-yes: $(CATALOGS) |
---|
| 94 | all-no: |
---|
| 95 | |
---|
| 96 | $(srcdir)/$(GETTEXT_PACKAGE).pot: $(POTFILES) |
---|
| 97 | $(GENPOT) |
---|
| 98 | |
---|
| 99 | install: install-exec install-data |
---|
| 100 | install-exec: |
---|
| 101 | install-data: install-data-@USE_NLS@ |
---|
| 102 | install-data-no: all |
---|
| 103 | install-data-yes: all |
---|
| 104 | if test -r "$(MKINSTALLDIRS)"; then \ |
---|
| 105 | $(MKINSTALLDIRS) $(DESTDIR)$(datadir); \ |
---|
| 106 | else \ |
---|
| 107 | $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(datadir); \ |
---|
| 108 | fi |
---|
| 109 | @catalogs='$(CATALOGS)'; \ |
---|
| 110 | for cat in $$catalogs; do \ |
---|
| 111 | cat=`basename $$cat`; \ |
---|
| 112 | case "$$cat" in \ |
---|
| 113 | *.gmo) destdir=$(gnulocaledir);; \ |
---|
| 114 | *) destdir=$(localedir);; \ |
---|
| 115 | esac; \ |
---|
| 116 | lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ |
---|
| 117 | dir=$(DESTDIR)$$destdir/$$lang/LC_MESSAGES; \ |
---|
| 118 | if test -r "$(MKINSTALLDIRS)"; then \ |
---|
| 119 | $(MKINSTALLDIRS) $$dir; \ |
---|
| 120 | else \ |
---|
| 121 | $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \ |
---|
| 122 | fi; \ |
---|
| 123 | if test -r $$cat; then \ |
---|
| 124 | $(INSTALL_DATA) $$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ |
---|
| 125 | echo "installing $$cat as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \ |
---|
| 126 | else \ |
---|
| 127 | $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ |
---|
| 128 | echo "installing $(srcdir)/$$cat as" \ |
---|
| 129 | "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT)"; \ |
---|
| 130 | fi; \ |
---|
| 131 | if test -r $$cat.m; then \ |
---|
| 132 | $(INSTALL_DATA) $$cat.m $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ |
---|
| 133 | echo "installing $$cat.m as $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \ |
---|
| 134 | else \ |
---|
| 135 | if test -r $(srcdir)/$$cat.m ; then \ |
---|
| 136 | $(INSTALL_DATA) $(srcdir)/$$cat.m \ |
---|
| 137 | $$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ |
---|
| 138 | echo "installing $(srcdir)/$$cat as" \ |
---|
| 139 | "$$dir/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m"; \ |
---|
| 140 | else \ |
---|
| 141 | true; \ |
---|
| 142 | fi; \ |
---|
| 143 | fi; \ |
---|
| 144 | done |
---|
| 145 | if test "$(PACKAGE)" = "glib"; then \ |
---|
| 146 | if test -r "$(MKINSTALLDIRS)"; then \ |
---|
| 147 | $(MKINSTALLDIRS) $(DESTDIR)$(gettextsrcdir); \ |
---|
| 148 | else \ |
---|
| 149 | $(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(gettextsrcdir); \ |
---|
| 150 | fi; \ |
---|
| 151 | $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ |
---|
| 152 | $(DESTDIR)$(gettextsrcdir)/Makefile.in.in; \ |
---|
| 153 | else \ |
---|
| 154 | : ; \ |
---|
| 155 | fi |
---|
| 156 | |
---|
| 157 | # Define this as empty until I found a useful application. |
---|
| 158 | installcheck: |
---|
| 159 | |
---|
| 160 | uninstall: |
---|
| 161 | catalogs='$(CATALOGS)'; \ |
---|
| 162 | for cat in $$catalogs; do \ |
---|
| 163 | cat=`basename $$cat`; \ |
---|
| 164 | lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ |
---|
| 165 | rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ |
---|
| 166 | rm -f $(DESTDIR)$(localedir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ |
---|
| 167 | rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT); \ |
---|
| 168 | rm -f $(DESTDIR)$(gnulocaledir)/$$lang/LC_MESSAGES/$(GETTEXT_PACKAGE)$(INSTOBJEXT).m; \ |
---|
| 169 | done |
---|
| 170 | rm -f $(DESTDIR)$(gettextsrcdir)/po-Makefile.in.in |
---|
| 171 | |
---|
| 172 | check: all |
---|
| 173 | |
---|
| 174 | dvi info tags TAGS ID: |
---|
| 175 | |
---|
| 176 | mostlyclean: |
---|
| 177 | rm -f core core.* *.pox $(GETTEXT_PACKAGE).po *.old.po cat-id-tbl.tmp |
---|
| 178 | rm -fr *.o |
---|
| 179 | |
---|
| 180 | clean: mostlyclean |
---|
| 181 | |
---|
| 182 | distclean: clean |
---|
| 183 | rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m |
---|
| 184 | |
---|
| 185 | maintainer-clean: distclean |
---|
| 186 | @echo "This command is intended for maintainers to use;" |
---|
| 187 | @echo "it deletes files that may require special tools to rebuild." |
---|
| 188 | rm -f $(GMOFILES) |
---|
| 189 | |
---|
| 190 | distdir = ../$(GETTEXT_PACKAGE)-$(VERSION)/$(subdir) |
---|
| 191 | dist distdir: update-po $(DISTFILES) |
---|
| 192 | dists="$(DISTFILES)"; \ |
---|
| 193 | for file in $$dists; do \ |
---|
| 194 | ln $(srcdir)/$$file $(distdir) 2> /dev/null \ |
---|
| 195 | || cp -p $(srcdir)/$$file $(distdir); \ |
---|
| 196 | done |
---|
| 197 | |
---|
| 198 | update-po: Makefile |
---|
| 199 | $(MAKE) $(GETTEXT_PACKAGE).pot |
---|
| 200 | PATH=`pwd`/../src:$$PATH; \ |
---|
| 201 | cd $(srcdir); \ |
---|
| 202 | catalogs='$(CATALOGS)'; \ |
---|
| 203 | for cat in $$catalogs; do \ |
---|
| 204 | cat=`basename $$cat`; \ |
---|
| 205 | lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ |
---|
| 206 | cp $$lang.po $$lang.old.po; \ |
---|
| 207 | echo "$$lang:"; \ |
---|
| 208 | if $(MSGMERGE) $$lang; then \ |
---|
| 209 | rm -f $$lang.old.po; \ |
---|
| 210 | else \ |
---|
| 211 | echo "msgmerge for $$cat failed!"; \ |
---|
| 212 | rm -f $$lang.po; \ |
---|
| 213 | mv $$lang.old.po $$lang.po; \ |
---|
| 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 | |
---|
| 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 $@ ) |
---|
| 247 | |
---|
| 248 | Makefile: Makefile.in.in ../config.status POTFILES |
---|
| 249 | cd .. \ |
---|
| 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: |
---|