-$(LOCALPOFILED) $(POFILES): $(POTFILE)
- $(AM_V_GEN)$(MSGMERGE) --quiet $(top_srcdir)/$@ $? -o $@,tmp
+$(POTFILE): $(ALL_TRANSLATABLE_FILES) Makefile
+ @$(MKDIR_P) po
+ $(AM_V_GEN)$(XGETTEXT) $(XGETTEXT_OPTIONS) $(TRANSLATABLE_FILES) --language=C --keyword=_ --keyword=N_ -o $@,tmp
+ $(AM_V_at)test -z "$(UI_FILES)" || $(XGETTEXT) $(XGETTEXT_OPTIONS) -j $(UI_FILES) --language=Glade -o $@,tmp
+ $(AM_V_at)$(XGETTEXT) $(XGETTEXT_OPTIONS) -j doc/org.gnu.pspp.metainfo.xml.in -o $@,tmp
+ $(AM_V_at)$(XGETTEXT) $(XGETTEXT_OPTIONS) -j doc/org.gnu.pspp.desktop.in -o $@,tmp
+ $(AM_V_at)mv $@,tmp $@
+
+$(LOCALPOFILES) $(POFILES): $(POTFILE)
+ $(AM_V_GEN)$(MSGMERGE) --previous --quiet $(top_srcdir)/$@ $? -o $@,tmp