55
57
# Makevars gets inserted here. (Don't remove this line!)
58
.SUFFIXES: .po .gmo .mo .nop .po-update
60
.SUFFIXES: .po .gmo .mo .sed .sin .nop .po-create .po-update
63
@echo "$(MSGFMT) -c -o $@ $<"; \
64
$(MSGFMT) -c -o t-$@ $< && mv t-$@ $@
64
67
@lang=`echo $* | sed -e 's,.*/,,'`; \
65
68
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
66
69
echo "$${cdcmd}rm -f $${lang}.gmo && $(GMSGFMT) -c --statistics -o $${lang}.gmo $${lang}.po"; \
67
cd $(srcdir) && 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
73
sed -e '/^#/d' $< > t-$@
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
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
75
96
# Note: Target 'all' must not depend on target '$(DOMAIN).pot-update',
76
97
# otherwise packages like GCC can not be built if only parts of the source
77
98
# have been downloaded.
79
$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in
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.
102
$(DOMAIN).pot-update: $(POTFILES) $(srcdir)/POTFILES.in remove-potcdate.sed
80
103
$(XGETTEXT) --default-domain=$(DOMAIN) --directory=$(top_srcdir) \
81
104
--add-comments=TRANSLATORS: $(XGETTEXT_OPTIONS) \
82
105
--files-from=$(srcdir)/POTFILES.in \
83
106
--copyright-holder='$(COPYRIGHT_HOLDER)' \
84
&& test ! -f $(DOMAIN).po \
85
|| ( rm -f $(srcdir)/$(DOMAIN).pot \
86
&& mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot )
107
--msgid-bugs-address='$(MSGID_BUGS_ADDRESS)'
108
test ! -f $(DOMAIN).po || { \
109
if test -f $(srcdir)/$(DOMAIN).pot; then \
110
sed -f remove-potcdate.sed < $(srcdir)/$(DOMAIN).pot > $(DOMAIN).1po && \
111
sed -f remove-potcdate.sed < $(DOMAIN).po > $(DOMAIN).2po && \
112
if cmp $(DOMAIN).1po $(DOMAIN).2po >/dev/null 2>&1; then \
113
rm -f $(DOMAIN).1po $(DOMAIN).2po $(DOMAIN).po; \
115
rm -f $(DOMAIN).1po $(DOMAIN).2po $(srcdir)/$(DOMAIN).pot && \
116
mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
119
mv $(DOMAIN).po $(srcdir)/$(DOMAIN).pot; \
123
# This rule has no dependencies: we don't need to update $(DOMAIN).pot at
124
# every "make" invocation, only create it when it is missing.
125
# Only "make $(DOMAIN).pot-update" or "make dist" will force an update.
88
126
$(srcdir)/$(DOMAIN).pot:
89
127
$(MAKE) $(DOMAIN).pot-update
129
# This target rebuilds a PO file if $(DOMAIN).pot has changed.
130
# Note that a PO file is not touched if it doesn't need to be changed.
91
131
$(POFILES): $(srcdir)/$(DOMAIN).pot
92
132
@lang=`echo $@ | sed -e 's,.*/,,' -e 's/\.po$$//'`; \
93
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
94
echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
95
cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot
133
if test -f "$(srcdir)/$${lang}.po"; then \
134
test "$(srcdir)" = . && cdcmd="" || cdcmd="cd $(srcdir) && "; \
135
echo "$${cdcmd}$(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot"; \
136
cd $(srcdir) && $(MSGMERGE_UPDATE) $${lang}.po $(DOMAIN).pot; \
138
$(MAKE) $${lang}.po-create; \
98
142
install: install-exec install-data
100
144
install-data: install-data-@USE_NLS@
101
if test "$(PACKAGE)" = "gettext"; then \
145
if test "$(PACKAGE)" = "gettext-tools"; then \
102
146
$(mkinstalldirs) $(DESTDIR)$(gettextsrcdir); \
103
for file in $(DISTFILES.common); do \
147
for file in $(DISTFILES.common) Makevars.template; do \
104
148
$(INSTALL_DATA) $(srcdir)/$$file \
105
149
$(DESTDIR)$(gettextsrcdir)/$$file; \
151
for file in Makevars; do \
152
rm -f $(DESTDIR)$(gettextsrcdir)/$$file; \