fix-gnulib: Strip out useless SUFFIXES assignments.
[dxcommon.git] / snippet / gettext.mk
blob38001147d57d974d1a071afd78c3c3e424ac913e
1 # Copyright © 2011-2012 Nick Bowler
3 # Automake fragment to distribute and install gettext .po/.mo files, intended
4 # for use in a non-recursive build setup. This does not include rules to
5 # generate the .pot file. Two variables must be defined:
7 # POFILES: the complete list of .po files included with the package, and
8 # MOFILES: the set of .mo files to be installed (a user-selected subset
9 # of the available options).
11 # One way to define these variables is to use the DX_LINGUAS autoconf macro
12 # which normally accompanies this fragment.
14 # License WTFPL2: Do What The Fuck You Want To Public License, version 2.
15 # This is free software: you are free to do what the fuck you want to.
16 # There is NO WARRANTY, to the extent permitted by law.
18 ALL_MOFILES = $(POFILES:.po=.mo)
19 EXTRA_DIST += po/LINGUAS $(POFILES) $(ALL_MOFILES)
20 MAINTAINERCLEANFILES += $(ALL_MOFILES)
22 .po.mo:
23 $(AM_V_at) $(MKDIR_P) $(@D)
24 $(AM_V_GEN) $(MSGFMT) $(MSGFMTFLAGS) -c -o $@ $<
26 install-data-local: install-mofiles
27 install-mofiles: $(MOFILES)
28 for mo in $?; do \
29 lang=`expr "$$mo" : '.*/\(.*\)\.mo' \| "$$mo" : '\(.*\)\.mo'`; \
30 test x"$$lang" = x"" && exit 1; \
31 inst="$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES"; \
32 (set -x; $(MKDIR_P) "$$inst") \
33 || exit $$?; \
34 (set -x; $(INSTALL_DATA) "$$mo" "$$inst/$(PACKAGE).mo") \
35 || exit $$?; \
36 done
37 .PHONY: install-mofiles
39 installdirs-local: installdirs-mofiles
40 installdirs-mofiles:
41 for mo in $(MOFILES); do \
42 lang=`expr "$$mo" : '.*/\(.*\)\.mo' \| "$$mo" : '\(.*\)\.mo'`; \
43 test x"$$lang" = x"" && exit 1; \
44 inst="$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES"; \
45 (set -x; $(MKDIR_P) "$$inst") || exit $$?; \
46 done
47 .PHONY: installdirs-mofiles
49 uninstall-local: uninstall-mofiles
50 uninstall-mofiles:
51 for mo in $(ALL_MOFILES); do \
52 lang=`expr "$$mo" : '.*/\(.*\)\.mo' \| "$$mo" : '\(.*\)\.mo'`; \
53 test x"$$lang" = x"" && exit 1; \
54 inst="$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES"; \
55 (set -x; cd "$$inst" && rm -f '$(PACKAGE).mo'); \
56 done
57 .PHONY: uninstall-mofiles