@@ -13,7 +13,6 @@ VERSION = @VERSION@
1313PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
1414SED = @SED@
1515SHELL = /bin/sh
16- @SET_MAKE@
1716srcdir = @srcdir@
1817top_srcdir = @top_srcdir@
1918VPATH = @srcdir@
@@ -41,6 +40,7 @@ MSGFMT = $(MSGFMT_$(USE_MSGCTXT))
4140
4241POFILES = @POFILES@
4342GMOFILES = @GMOFILES@
43+ MOFILES = @MOFILES@
4444
4545POTFILES = \
4646
@@ -50,21 +50,45 @@ CATALOGS = @CATALOGS@
5050
5151.SUFFIXES:
5252.SUFFIXES: .po .gmo .mo
53+ .PHONY: all
54+
55+ all: all-@USE_NLS@
56+
57+ all-yes: update-po update-mo
58+
59+ all-no:
5360
5461.po.mo:
5562 @echo "$(MSGFMT) -c -o $@ $<"; \
5663 $(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
5764
5865.po.gmo:
5966 @lang=`echo $* | sed -e 's,.*/,,'`; \
60- test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
61- echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
67+ echo "cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o $${lang}.gmo $${lang}.po"; \
6268 cd $(srcdir) && rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics --verbose -o t-$${lang}.gmo $${lang}.po && mv t-$${lang}.gmo $${lang}.gmo
6369
64- all: all-@USE_NLS@
65- all-yes:
66- test -z "$(GMOFILES)" || $(MAKE) $(GMOFILES)
67- all-no:
70+ $(srcdir)/$(DOMAIN).pot:
71+ test -f $(srcdir)/$(DOMAIN).pot || touch $(srcdir)/$(DOMAIN).pot;
72+
73+ .po: $(srcdir)/$(DOMAIN).pot
74+ @lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
75+ if test -f "$(srcdir)/$${lang}.po"; then \
76+ echo "cd $(srcdir) && $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot"; \
77+ cd $(srcdir) && $(MSGMERGE_UPDATE) $(MSGMERGE_OPTIONS) --lang=$${lang} $${lang}.po $(DOMAIN).pot; \
78+ else \
79+ echo "po file does not exist"; \
80+ exit 1; \
81+ fi
82+
83+ update-gmo update-mo:
84+ if test -n "$(GMOFILES)"; then \
85+ $(MAKE) $(GMOFILES); \
86+ else \
87+ test "$(MOFILES)" = "@MOFILES@" || $(MAKE) $(MOFILES); \
88+ fi
89+
90+ update-po:
91+ test -z "$(POFILES)" || $(MAKE) $(POFILES)
6892
6993install: install-@USE_NLS@
7094install-strip: install
@@ -165,9 +189,13 @@ info dvi ps pdf html tags TAGS ctags CTAGS ID:
165189install-dvi install-ps install-pdf install-html:
166190
167191distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
168- dist distdir: all
192+ dist distdir: update-po update-mo
169193 $(mkdir_p) $(distdir); \
170- dists="$(POFILES) $(GMOFILES)"; \
194+ if test -n "$(GMOFILES)"; then \
195+ dists="$(POFILES) $(GMOFILES)"; \
196+ else \
197+ dists="$(POFILES) $(MOFILES)"; \
198+ fi; \
171199 if test "$(PACKAGE)" = "gettext-tools"; then \
172200 dists="$$dists Makevars.template"; \
173201 fi; \
@@ -200,9 +228,12 @@ dist distdir: all
200228 fi; \
201229 done
202230
231+ Makefile: Makefile.in.in Makevars $(top_builddir)/config.status
232+ cd $(top_builddir) && @SHELL@ ./config.status $(subdir)/
[email protected] po-directories;
233+
203234mostlyclean clean:
204235 rm -f core core.* $(DOMAIN).po $(DOMAIN).1po $(DOMAIN).2po *.new.po
205236 rm -fr *.o
206237
207- distclean: clean
208- rm -f Makefile Makefile.in *.mo
238+ maintainer-clean distclean: clean
239+ rm -f Makefile Makefile.in *.mo *.gmo
0 commit comments