1 # Copyright © 2011-2012, 2023 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)
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 mos='$?'; for mo in $$mos; 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") || exit; \
33 (set -x; $(INSTALL_DATA) "$$mo" "$$inst/$(PACKAGE).mo") || exit; \
35 .PHONY: install-mofiles
37 installdirs-local: installdirs-mofiles
39 mos='$(MOFILES)'; for mo in $$mos; do \
40 lang=`expr "$$mo" : '.*/\(.*\)\.mo' \| "$$mo" : '\(.*\)\.mo'`; \
41 test x"$$lang" = x"" && exit 1; \
42 inst="$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES"; \
43 (set -x; $(MKDIR_P) "$$inst") || exit; \
45 .PHONY: installdirs-mofiles
47 uninstall-local: uninstall-mofiles
49 mos='$(ALL_MOFILES)'; for mo in $$mos; do \
50 lang=`expr "$$mo" : '.*/\(.*\)\.mo' \| "$$mo" : '\(.*\)\.mo'`; \
51 test x"$$lang" = x"" && exit 1; \
52 inst="$(DESTDIR)$(localedir)/$$lang/LC_MESSAGES"; \
53 (set -x; cd "$$inst" && rm -f '$(PACKAGE).mo'); \
55 .PHONY: uninstall-mofiles