Rename df --> df_prod and comment accordingly
[pspp-builds.git] / po / automake.mk
1 include $(top_srcdir)/po/Makevars
2
3 XGETTEXT=xgettext
4 MSGMERGE=msgmerge
5 MSGFMT=msgfmt
6
7 POFILES=po/ca.po po/en_GB.po po/es.po po/fr.po po/lt.po po/nl.po po/pt_BR.po
8
9 POTFILE=po/$(DOMAIN).pot
10
11 TRANSLATABLE_FILES = $(DIST_SOURCES) $(all_q_sources)
12
13 XGETTEXT_OPTIONS = \
14         --copyright-holder="$(COPYRIGHT_HOLDER)" \
15         --package-name=$(PACKAGE) \
16         --package-version=$(VERSION) \
17         --msgid-bugs-address=$(MSGID_BUGS_ADDRESS) \
18         --from-code=UTF-8 \
19         --add-comments='TRANSLATORS:'
20
21 $(POTFILE): $(TRANSLATABLE_FILES) $(UI_FILES)
22         @$(MKDIR_P) po
23         $(XGETTEXT) --directory=$(top_srcdir) $(XGETTEXT_OPTIONS)    $(TRANSLATABLE_FILES) --language=C --keyword=_ --keyword=N_ -o $@
24         $(XGETTEXT) --directory=$(top_srcdir) $(XGETTEXT_OPTIONS) -j $(UI_FILES) --language=glade -o $@
25
26
27 $(POFILES): $(POTFILE)
28         $(MSGMERGE) $(top_srcdir)/$@ $? -o $@
29
30
31 SUFFIXES += .po .gmo
32 .po.gmo:
33         @$(MKDIR_P) `dirname $@`
34         $(MSGFMT) $< -o $@
35
36
37 GMOFILES = $(POFILES:.po=.gmo)
38
39 ALL_LOCAL += $(GMOFILES)
40
41 install-data-hook: $(GMOFILES)
42         for f in $(GMOFILES); do \
43           lang=`echo $$f | sed -e 's%po/\(.*\)\.gmo%\1%' ` ; \
44           $(MKDIR_P) $(DESTDIR)$(prefix)/share/locale/$$lang/LC_MESSAGES; \
45           $(INSTALL_DATA) $$f $(DESTDIR)$(prefix)/share/locale/$$lang/LC_MESSAGES/$(DOMAIN).mo ; \
46         done
47
48 uninstall-hook:
49         for f in $(GMOFILES); do \
50           lang=`echo $$f | sed -e 's%po/\(.*\)\.gmo%\1%' ` ; \
51           rm -f $(DESTDIR)$(prefix)/share/locale/$$lang/LC_MESSAGES/$(DOMAIN).mo ; \
52         done
53
54
55 EXTRA_DIST += $(POFILES) $(POTFILE)
56
57 CLEANFILES += $(GMOFILES) $(POTFILE)
58
59 # Clean $(POFILES) from build directory but not if that's the same as
60 # the source directory.
61 po_CLEAN:
62         @if test "$(srcdir)" != .; then \
63                 echo rm -f $(POFILES); \
64                 rm -f $(POFILES); \
65         fi
66 CLEAN_LOCAL += po_CLEAN